-
Notifications
You must be signed in to change notification settings - Fork 284
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
Use rctx.original_name if available, Go 1.23.6 #1694
Merged
simuons
merged 1 commit into
bazelbuild:master
from
mbland:use-original-name-if-available
Feb 13, 2025
Merged
Use rctx.original_name if available, Go 1.23.6 #1694
simuons
merged 1 commit into
bazelbuild:master
from
mbland:use-original-name-if-available
Feb 13, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prepares for `repository_ctx.original_name` support in Bazel 8.1.0 per bazelbuild/bazel#24467 and bumps Go to 1.23.6. Part of bazelbuild#1482 and bazelbuild#1652. The underlying repo rules will now use `repository_ctx.original_name` if it's available. I've confirmed that these changes use `repository_ctx.original_name` under Bazel 8.1.0rc2 after commenting out the wrappers and restoring the original repo rule symbols. --- This change ensures compatibility with future Bazel releases. New comments indicate where to simplify code after dropping support for Bazel versions that don't have `repository_ctx.original_name`. The Go 1.23.6 bump is a convenience update that isn't essential to the rest of the change. Under Bzlmod, `repository_ctx.name` contains the canonical repository name. This broke the `_alias_repository` and `jvm_import_external` repository rules, which used `repository_ctx.name` to generate default top level target names for their repos. bazelbuild#1650 added wrapper macros passing the original name as an extra attribute to the underlying repo rules as a portable workaround. The Bazel maintainers eventually recognized this as a common use case and added `repository_ctx.original_name` to eliminate the need for such wrappers (eventually). - https://bazel.build/rules/lib/builtins/repository_ctx#name - https://bazel.build/rules/lib/builtins/repository_ctx#original_name
simuons
approved these changes
Feb 11, 2025
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Feb 14, 2025
Works around breakages when building under `WORKSPACE` with Bazel 8.1.0, as described in bazelbuild/bazel#25286. Part of bazelbuild#1652. PR bazelbuild#1694 added support for `rctx.original_name` after the implementation of bazelbuild/bazel#24467 landed in 8.1.0rc2. However, I hadn't tested `WORKSPACE` builds with 8.1.0rc2 before 8.1.0 came out. This resolves the breakage, but should only be necessary if a Bazel 8 release containing a fix for bazelbuild/bazel#25286 isn't yet available.
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Feb 18, 2025
Works around breakages when building under `WORKSPACE` with Bazel 8.1.0, as described in bazelbuild/bazel#25286. Part of bazelbuild#1652. PR bazelbuild#1694 added support for `rctx.original_name` after the implementation of bazelbuild/bazel#24467 landed in 8.1.0rc2. However, I hadn't tested `WORKSPACE` builds with 8.1.0rc2 before 8.1.0 came out. This resolves the breakage until a Bazel 8 release containing a fix for bazelbuild/bazel#25286 becomes available (possibly Bazel 8.2.0).
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Feb 18, 2025
Works around breakages when building under `WORKSPACE` with Bazel 8.1.0, as described in bazelbuild/bazel#25286. Part of bazelbuild#1652. PR bazelbuild#1694 added support for `rctx.original_name` after the implementation of bazelbuild/bazel#24467 landed in 8.1.0rc2. However, I hadn't tested `WORKSPACE` builds with 8.1.0rc2 before 8.1.0 came out. This resolves the breakage until a Bazel 8 release containing a fix for bazelbuild/bazel#25286 becomes available (possibly Bazel 8.2.0).
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Feb 19, 2025
Works around breakages when building under `WORKSPACE` with Bazel 8.1.0, as described in bazelbuild/bazel#25286. Part of bazelbuild#1652. PR bazelbuild#1694 added support for `rctx.original_name` after the implementation of bazelbuild/bazel#24467 landed in 8.1.0rc2. However, I hadn't tested `WORKSPACE` builds with 8.1.0rc2 before 8.1.0 came out. This resolves the breakage until a Bazel 8 release containing a fix for bazelbuild/bazel#25286 becomes available (possibly Bazel 8.2.0).
mbland
added a commit
to mbland/rules_scala
that referenced
this pull request
Feb 20, 2025
Works around breakages when building under `WORKSPACE` with Bazel 8.1.0, as described in bazelbuild/bazel#25286. Part of bazelbuild#1652. PR bazelbuild#1694 added support for `rctx.original_name` after the implementation of bazelbuild/bazel#24467 landed in 8.1.0rc2. However, I hadn't tested `WORKSPACE` builds with 8.1.0rc2 before 8.1.0 came out. This resolves the breakage until a Bazel 8 release containing a fix for bazelbuild/bazel#25286 becomes available (possibly Bazel 8.2.0).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Prepares for
repository_ctx.original_name
support in Bazel 8.1.0 per bazelbuild/bazel#24467 and bumps Go to 1.23.6. Part of #1482 and #1652.The underlying repo rules will now use
repository_ctx.original_name
if it's available.I've confirmed that these changes use
repository_ctx.original_name
under Bazel 8.1.0rc2 after commenting out the wrappers and restoring the original repo rule symbols.Motivation
This change ensures compatibility with future Bazel releases. New comments indicate where to simplify code after dropping support for Bazel versions that don't have
repository_ctx.original_name
.The Go 1.23.6 bump is a convenience update that isn't essential to the rest of the change.
Under Bzlmod,
repository_ctx.name
contains the canonical repository name. This broke the_alias_repository
andjvm_import_external
repository rules, which usedrepository_ctx.name
to generate default top level target names for their repos. #1650 added wrapper macros passing the original name as an extra attribute to the underlying repo rules as a portable workaround.The Bazel maintainers eventually recognized this as a common use case and added
repository_ctx.original_name
to eliminate the need for such wrappers (eventually).