Use rctx.original_name if available, Go 1.23.6 #1694
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).