summaryrefslogtreecommitdiffhomepage
path: root/tools/bazel_gazelle_generate.patch
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2021-02-02 09:34:29 -0800
committergVisor bot <gvisor-bot@google.com>2021-02-02 09:37:09 -0800
commit3817c7349de2dde950fd65dcab1f4859c095eeaf (patch)
treed50e24f2443a517c425e28e188e5dc797e778f39 /tools/bazel_gazelle_generate.patch
parent00d21b9ae0e379caba54720c71f200596100c8f0 (diff)
Remove go_tool_library references.
This is required only for the built-in bazel nogo functionality. Since we roll these targets manually via the wrappers, we don't need to use go_tool_library. The inconsistent use of these targets leads to conflicting instantiations of go_default_library and go_tool_library, which both contain the same output files. PiperOrigin-RevId: 355184975
Diffstat (limited to 'tools/bazel_gazelle_generate.patch')
-rw-r--r--tools/bazel_gazelle_generate.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/bazel_gazelle_generate.patch b/tools/bazel_gazelle_generate.patch
new file mode 100644
index 000000000..fd1e1bda6
--- /dev/null
+++ b/tools/bazel_gazelle_generate.patch
@@ -0,0 +1,15 @@
+diff --git a/language/go/generate.go b/language/go/generate.go
+index 2892948..feb4ad6 100644
+--- a/language/go/generate.go
++++ b/language/go/generate.go
+@@ -691,6 +691,10 @@ func (g *generator) setImportAttrs(r *rule.Rule, importPath string) {
+ }
+
+ func (g *generator) commonVisibility(importPath string) []string {
++ if importPath == "golang.org/x/tools/go/analysis/internal/facts" {
++ // Imported by nogo main. We add a visibility exception.
++ return []string{"//visibility:public"}
++ }
+ // If the Bazel package name (rel) contains "internal", add visibility for
+ // subpackages of the parent.
+ // If the import path contains "internal" but rel does not, this is