Skip to content
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

nogo: migrate to configuration transitions #2473

Merged
merged 4 commits into from
May 5, 2020

Conversation

jayconrod
Copy link
Contributor

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

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 bazelbuild#2374
Fixes bazelbuild#2470
@jayconrod jayconrod merged commit 8bdd81a into bazelbuild:master May 5, 2020
@jayconrod jayconrod deleted the nogo-setting branch May 5, 2020 20:59
jayconrod pushed a commit to jayconrod/rules_go that referenced this pull request May 5, 2020
nogo binaries no longer depend on themselves. Since bazelbuild#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 bazelbuild#2374
jayconrod pushed a commit that referenced this pull request 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
jayconrod pushed a commit to jayconrod/rules_go that referenced this pull request May 8, 2020
jayconrod pushed a commit that referenced this pull request May 8, 2020
This rolls back #2473 and #2474 due to #2479, which is caused by bazelbuild/bazel#11291. There doesn't seem to be a way to work around that, and I don't want to hold the release back any longer.

Reopens #2374
Reopens #2470
jayconrod pushed a commit to jayconrod/rules_go that referenced this pull request May 8, 2020
nogo now uses an incoming-edge transition to reset all Go build
settings to their default values. This prevents nogo from being built
with an unusual link mode, as well as other issues.

This change uses some code from bazelbuild#2473, but it doesn't change how nogo
fits into the dependency graph.

Fixes bazelbuild#2470
jayconrod pushed a commit that referenced this pull request May 8, 2020
nogo now uses an incoming-edge transition to reset all Go build
settings to their default values. This prevents nogo from being built
with an unusual link mode, as well as other issues.

This change uses some code from #2473, but it doesn't change how nogo
fits into the dependency graph.

Fixes #2470
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

compilepkg tries to call libdefault_nogo.so
2 participants