-
-
Notifications
You must be signed in to change notification settings - Fork 662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Depend on nogo with a transition and delete go_tool_library #2374
Labels
Comments
I believe this would also allow specifying custom |
jayconrod
pushed a commit
to jayconrod/rules_go
that referenced
this issue
May 5, 2020
The nogo binary to use is now specified using a Starlark flag. For example: bazel build --@io_bazel_rules_go//go/config:nogo=@io_bazel_rules_go//:tools_nogo //:hello .bazelrc is now the recommended way to set this flag. Setting nogo in go_register_toolchains will still work, though that function may be deprecated soon. The flag overrides the go_register_toolchains argument when both are set. Updates bazel-contrib#2374 Fixes bazel-contrib#2470
jayconrod
pushed a commit
to jayconrod/rules_go
that referenced
this issue
May 5, 2020
The nogo binary to use is now specified using a Starlark flag. For example: bazel build --@io_bazel_rules_go//go/config:nogo=@io_bazel_rules_go//:tools_nogo //:hello .bazelrc is now the recommended way to set this flag. Setting nogo in go_register_toolchains will still work, though that function may be deprecated soon. The flag overrides the go_register_toolchains argument when both are set. Updates bazel-contrib#2374 Fixes bazel-contrib#2470
jayconrod
pushed a commit
that referenced
this issue
May 5, 2020
The nogo binary to use is now specified using a Starlark flag. For example: bazel build --@io_bazel_rules_go//go/config:nogo=@io_bazel_rules_go//:tools_nogo //:hello .bazelrc is now the recommended way to set this flag. Setting nogo in go_register_toolchains will still work, though that function may be deprecated soon. The flag overrides the go_register_toolchains argument when both are set. Updates #2374 Fixes #2470
jayconrod
pushed a commit
to jayconrod/rules_go
that referenced
this issue
May 5, 2020
nogo binaries no longer depend on themselves. Since bazel-contrib#2473, the nogo rule uses a configuration transition to disable nogo for itself and its dependencies. This means there's no longer any need for go_tool_library rules for analyzers and utility packages in org_golang_x_tools. So with this change, tools_nogo depends on the regular go_library analyzers. The documentation is updated not to mention go_tool_library anymore. Additionally, this change replaces the go_tool_library targets in org_golang_x_tools with aliases to the go_library targets. So nogo targets that depends on the old symbols should work. Fixes bazel-contrib#2374
jayconrod
pushed a commit
that referenced
this issue
May 5, 2020
nogo binaries no longer depend on themselves. Since #2473, the nogo rule uses a configuration transition to disable nogo for itself and its dependencies. This means there's no longer any need for go_tool_library rules for analyzers and utility packages in org_golang_x_tools. So with this change, tools_nogo depends on the regular go_library analyzers. The documentation is updated not to mention go_tool_library anymore. Additionally, this change replaces the go_tool_library targets in org_golang_x_tools with aliases to the go_library targets. So nogo targets that depends on the old symbols should work. Fixes #2374
This was referenced May 8, 2020
ooc are there still plans to address this? |
Unfortunately, this is blocked by bazelbuild/bazel#11291. |
The upstream bug that has blocked this issue seems to be resolved now: bazelbuild/bazel#11291 (comment) |
robfig
pushed a commit
to robfig/bazel-gazelle
that referenced
this issue
Oct 6, 2021
bazel-contrib/rules_go#2374 has been fixed, so there is no more need for it.
robfig
pushed a commit
to bazel-contrib/bazel-gazelle
that referenced
this issue
Oct 6, 2021
bazel-contrib/rules_go#2374 has been fixed, so there is no more need for it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instead of having the toolchain depend on nogo, a common target like
@io_bazel_rules_go//:go_context_data
should depend on it. The dependency should transition to a configuration that doesn't depend on nogo. That would break the cyclic dependency.With that change, we could deprecate
go_tool_library
, and we could drop a lot of the custom patching for analyses inorg_golang_x_tools
.This would also make it possible to use an alternative nogo binary using a command-line flag.
The text was updated successfully, but these errors were encountered: