Gazelle is a Bazel build file generator for Bazel projects. It natively supports Go and protobuf, and it may be extended to support new languages and custom rule sets.
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
Ubuntu 22.04, amd64
What did you do?
Build gopls with bazel. That is, run bazel build @org_golang_x_tools_gopls//:gopls.
What did you expect to see?
Successful build
What did you see instead?
ERROR: /home/eric/.cache/bazel/_bazel_eric/f1d1ae8a5075539a72e45ef6b412b203/external/org_golang_x_tools_gopls/internal/lsp/analysis/fillstruct/BUILD.bazel:3:11: in go_library rule @org_golang_x_tools_gopls//internal/lsp/analysis/fillstruct:fillstruct: target '@org_golang_x_tools//internal/analysisinternal:analysisinternal' is not visible from target '@org_golang_x_tools_gopls//internal/lsp/analysis/fillstruct:fillstruct'. Check the visibility declaration of the former target if you think the dependency is legitimate
and several more similar errors. I tried passing both the gazelle:default_visibility and gazelle:go_visibility to the build_directives parameter in the go_repository rule for golang.org/x/tools but they didn't do anything.
What version of gazelle are you using?
v0.33.0
What version of rules_go are you using?
v0.41.0
What version of Bazel are you using?
6.0.0
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
Ubuntu 22.04, amd64
What did you do?
Build gopls with bazel. That is, run
bazel build @org_golang_x_tools_gopls//:gopls
.What did you expect to see?
Successful build
What did you see instead?
and several more similar errors. I tried passing both the
gazelle:default_visibility
andgazelle:go_visibility
to thebuild_directives
parameter in thego_repository
rule for golang.org/x/tools but they didn't do anything.