Add repository_ctx.original_name#25121
Conversation
| "The name that was originally specified as the 'name' attribute when this repository rule was instantiated. This name is not necessarily unique among external repositories (see 'name').") | ||
| public String getOriginalName() { | ||
| String originalName = (String) rule.getAttr("$original_name", Type.STRING); | ||
| // The original name isn't set for WORKSPACE-defined repositories as well as repositories |
There was a problem hiding this comment.
Are these still a thing at HEAD? What's our strategy for backporting this, should I add new tests to the backports?
|
@Wyverald @meteorcloudy Since rulesets still have to support WORKSPACE at this point, in which
We wouldn't be able to cherry-pick the change, but for backwards compatibility users already need to resort to canonical repo name parsing where necessary (e.g. repo rules meant to be used with
Implementing this wouldn't be difficult, we could just monkey patch the |
|
I don't have strong preference on either way, I trust you and @Wyverald to make the best decision. But we should definitely document the best practices somewhere, I can follow up on that. |
I don't quite follow this logic -- currently, in either Bzlmod or WORKSPACE, it's always true that Although TBH I agree that if we were to start from scratch, having the |
They are equal today, but I doubt anyone relies on that property. What I (badly) described above is that a repo rule today must be prepared to receive both If you don't think that's doable, I'm also happy to go with the approach that's currently implemented by this PR. |
|
What I meant is that, technically, a repo rule could be relying on the semantics that With that said, I am struggling to think of a realistic example of such a repo rule... but IMO introducing an explicit API could avoid some headache in the future. Not a super strong opinion. |
|
We aren't locking us in, we could still change the behavior of |
|
@bazel-io fork 8.1.0 |
|
@fmeum can you please resolve the conflicts? Thanks |
This new attribute contains the original value of the `name` attribute at the instantiation site of the repo rule (e.g., `rctx.original_name` would be `foo` if `rctx.name` is `+ext+foo`). # Conflicts: # src/test/java/com/google/devtools/build/lib/bazel/bzlmod/ModuleExtensionResolutionTest.java
f992e42 to
6c65262
Compare
|
@iancha1992 Done! |
|
@fmeum could you please take a look at the presubmit failures? |
6c65262 to
a50b755
Compare
|
@satyanandak Fixed |
This new attribute contains the original value of the `name` attribute at the instantiation site of the repo rule (e.g., `rctx.original_name` would be `foo` if `rctx.name` is `+ext+foo`). Fixes bazelbuild#24467 Closes bazelbuild#25121. RELNOTES: Added `repository_ctx.original_name`, which contains the original value of the `name` attribute as specified at the repo rule call site. PiperOrigin-RevId: 722731393 Change-Id: I2f7dada0c44b6bd4c0d2622fa1e97223382a8547 (cherry picked from commit 8bcfb06)
This new attribute contains the original value of the `name` attribute at the instantiation site of the repo rule (e.g., `rctx.original_name` would be `foo` if `rctx.name` is `+ext+foo`). Fixes bazelbuild#24467 Closes bazelbuild#25121. RELNOTES: Added `repository_ctx.original_name`, which contains the original value of the `name` attribute as specified at the repo rule call site. PiperOrigin-RevId: 722731393 Change-Id: I2f7dada0c44b6bd4c0d2622fa1e97223382a8547 (cherry picked from commit 8bcfb06)
This new attribute contains the original value of the `name` attribute at the instantiation site of the repo rule (e.g., `rctx.original_name` would be `foo` if `rctx.name` is `+ext+foo`). Fixes bazelbuild#24467 Closes bazelbuild#25121. RELNOTES: Added `repository_ctx.original_name`, which contains the original value of the `name` attribute as specified at the repo rule call site. PiperOrigin-RevId: 722731393 Change-Id: I2f7dada0c44b6bd4c0d2622fa1e97223382a8547 (cherry picked from commit 8bcfb06)
This new attribute contains the original value of the `name` attribute at the instantiation site of the repo rule (e.g., `rctx.original_name` would be `foo` if `rctx.name` is `+ext+foo`). Fixes #24467 Closes #25121. RELNOTES: Added `repository_ctx.original_name`, which contains the original value of the `name` attribute as specified at the repo rule call site. PiperOrigin-RevId: 722731393 Change-Id: I2f7dada0c44b6bd4c0d2622fa1e97223382a8547 (cherry picked from commit 8bcfb06) Fixes #25147
|
@bazel-io fork 7.7.0 |
This new attribute contains the original value of the `name` attribute at the instantiation site of the repo rule (e.g., `rctx.original_name` would be `foo` if `rctx.name` is `+ext+foo`). Fixes bazelbuild#24467 Closes bazelbuild#25121. RELNOTES: Added `repository_ctx.original_name`, which contains the original value of the `name` attribute as specified at the repo rule call site. PiperOrigin-RevId: 722731393 Change-Id: I2f7dada0c44b6bd4c0d2622fa1e97223382a8547 (cherry picked from commit 8bcfb06) Fixes bazelbuild#25147
Fixes the breakage in `@rules_magic_leaflet` from the previous commit by using two mechanisms for generating a default target name in a repository rule. - Bazel 8.1.1 added `repository_ctx.original_name` to facilitate the generation of default repo target names. - For earlier Bazels, the wrapper macro and `default_target_name` attribute pass through the original repo name for when `repository_ctx.original_name` isn't available. Using both for now provides backwards and forward compatibility across Bazel versions while avoiding the need for parsing the canonical repo name format. The canonical repo name format has changed several times, making this a very practical concern. For more background, see: - bazelbuild/bazel#24467 - bazelbuild/bazel#25121 And as for why we recommend using Bazel 8.1.1 or later, instead of 8.1.0 when `repository_ctx.original_name` first appeared: - bazelbuild/bazel#25286
This new attribute contains the original value of the `name` attribute at the instantiation site of the repo rule (e.g., `rctx.original_name` would be `foo` if `rctx.name` is `+ext+foo`). Fixes #24467 Closes #25121. RELNOTES: Added `repository_ctx.original_name`, which contains the original value of the `name` attribute as specified at the repo rule call site. PiperOrigin-RevId: 722731393 Change-Id: I2f7dada0c44b6bd4c0d2622fa1e97223382a8547 (cherry picked from commit 8bcfb06) Fixes #27033 Context: this would help google-ml-infra/rules_ml_toolchain#84 --------- Co-authored-by: Fabian Meumertzheim <[email protected]>
Fixes the breakage in `@rules_magic_leaflet` from the previous commit by using two mechanisms for generating a default target name in a repository rule. - Bazel 8.1.1 added `repository_ctx.original_name` to facilitate the generation of default repo target names. - For earlier Bazels, the wrapper macro and `default_target_name` attribute pass through the original repo name for when `repository_ctx.original_name` isn't available. Using both for now provides backwards and forward compatibility across Bazel versions while avoiding the need for parsing the canonical repo name format. The canonical repo name format has changed several times, making this a very practical concern. For more background, see: - bazelbuild/bazel#24467 - bazelbuild/bazel#25121 And as for why we recommend using Bazel 8.1.1 or later, instead of 8.1.0 when `repository_ctx.original_name` first appeared: - bazelbuild/bazel#25286 --- However, the build now breaks with: ```txt ERROR: external/rules_magic+/toolchains/BUILD:17:22: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. and referenced by '@@rules_magic+//toolchains:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` This is because `native.bind` doesn't work under Bzlmod. We're not yet hitting the error indicating that `native.bind` is no longer available, but that the artifical `//external` package no longer exists.
Fixes the breakage in `@rules_magic_leaflet` from the previous commit by using two mechanisms for generating a default target name in a repository rule. - Bazel 8.1.1 added `repository_ctx.original_name` to facilitate the generation of default repo target names. - For earlier Bazels, the wrapper macro and `default_target_name` attribute pass through the original repo name for when `repository_ctx.original_name` isn't available. Using both for now provides backwards and forward compatibility across Bazel versions while avoiding the need for parsing the canonical repo name format. The canonical repo name format has changed several times, making this a very practical concern. For more background, see: - bazelbuild/bazel#24467 - bazelbuild/bazel#25121 And as for why we recommend using Bazel 8.1.1 or later, instead of 8.1.0 when `repository_ctx.original_name` first appeared: - bazelbuild/bazel#25286 --- However, the build now breaks with: ```txt ERROR: external/rules_magic+/toolchains/BUILD:17:22: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. and referenced by '@@rules_magic+//toolchains:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` This is because `native.bind` doesn't work under Bzlmod. We're not yet hitting the error indicating that `native.bind` is no longer available, but that the artifical `//external` package no longer exists.
Fixes the breakage in `@rules_magic_leaflet` from the previous commit by using two mechanisms for generating a default target name in a repository rule. - Bazel 8.1.1 added `repository_ctx.original_name` to facilitate the generation of default repo target names. - For earlier Bazels, the wrapper macro and `default_target_name` attribute pass through the original repo name for when `repository_ctx.original_name` isn't available. Using both for now provides backwards and forward compatibility across Bazel versions while avoiding the need for parsing the canonical repo name format. The canonical repo name format has changed several times, making this a very practical concern. For more background, see: - bazelbuild/bazel#24467 - bazelbuild/bazel#25121 And as for why we recommend using Bazel 8.1.1 or later, instead of 8.1.0 when `repository_ctx.original_name` first appeared: - bazelbuild/bazel#25286 --- However, the build now breaks with: ```txt ERROR: external/rules_magic+/toolchains/BUILD:17:22: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. and referenced by '@@rules_magic+//toolchains:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` This is because `native.bind` doesn't work under Bzlmod. We're not yet hitting the error indicating that `native.bind` is no longer available, but that the artifical `//external` package no longer exists.
Fixes the breakage in `@rules_magic_leaflet` from the previous commit by using two mechanisms for generating a default target name in a repository rule. - Bazel 7.7.0 and 8.1.1 provide `repository_ctx.original_name` to facilitate the generation of default repo target names. - For earlier Bazels, the wrapper macro and `default_target_name` attribute pass through the original repo name for when `repository_ctx.original_name` isn't available. Using both for now provides backwards and forward compatibility across Bazel versions while avoiding the need for parsing the canonical repo name format. The canonical repo name format has changed several times, making this a very practical concern. For more background, see: - bazelbuild/bazel#24467 - bazelbuild/bazel#25121 And as for why we recommend using Bazel 8.1.1 or later, instead of 8.1.0 when `repository_ctx.original_name` first appeared: - bazelbuild/bazel#25286 --- However, the build now breaks with: ```txt ERROR: external/rules_magic+/toolchains/BUILD:17:22: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. and referenced by '@@rules_magic+//toolchains:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` This is because `native.bind` doesn't work under Bzlmod. We're not yet hitting the error indicating that `native.bind` is no longer available, but that the artifical `//external` package no longer exists.
Fixes the breakage in `@rules_magic_leaflet` from the previous commit by using two mechanisms for generating a default target name in a repository rule. - Bazel 7.7.0 and 8.1.1 provide `repository_ctx.original_name` to facilitate the generation of default repo target names. - For earlier Bazels, the wrapper macro and `default_target_name` attribute pass through the original repo name for when `repository_ctx.original_name` isn't available. Using both for now provides backwards and forward compatibility across Bazel versions while avoiding the need for parsing the canonical repo name format. The canonical repo name format has changed several times, making this a very practical concern. For more background, see: - bazelbuild/bazel#24467 - bazelbuild/bazel#25121 And as for why we recommend using Bazel 8.1.1 or later, instead of 8.1.0 when `repository_ctx.original_name` first appeared: - bazelbuild/bazel#25286 --- However, the build now breaks with: ```txt ERROR: external/rules_magic+/toolchains/BUILD:17:22: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. and referenced by '@@rules_magic+//toolchains:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` This is because `native.bind` doesn't work under Bzlmod. We're not yet hitting the error indicating that `native.bind` is no longer available, but that the artifical `//external` package no longer exists.
Fixes the breakage in `@rules_magic_leaflet` from the previous commit by using two mechanisms for generating a default target name in a repository rule. - Bazel 7.7.0 and 8.1.1 provide `repository_ctx.original_name` to facilitate the generation of default repo target names. - For earlier Bazels, the wrapper macro and `default_target_name` attribute pass through the original repo name for when `repository_ctx.original_name` isn't available. Using both for now provides backwards and forward compatibility across Bazel versions while avoiding the need for parsing the canonical repo name format. The canonical repo name format has changed several times, making this a very practical concern. For more background, see: - bazelbuild/bazel#24467 - bazelbuild/bazel#25121 And as for why we recommend using Bazel 8.1.1 or later, instead of 8.1.0 when `repository_ctx.original_name` first appeared: - bazelbuild/bazel#25286 --- However, the build now breaks with: ```txt ERROR: external/rules_magic+/toolchains/BUILD:17:22: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. and referenced by '@@rules_magic+//toolchains:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` This is because `native.bind` doesn't work under Bzlmod. We're not yet hitting the error indicating that `native.bind` is no longer available, but that the artifical `//external` package no longer exists.
Fixes the breakage in `@rules_magic_leaflet` from the previous commit by using two mechanisms for generating a default target name in a repository rule. - Bazel 7.7.0 and 8.1.1 provide `repository_ctx.original_name` to facilitate the generation of default repo target names. - For earlier Bazels, the wrapper macro and `default_target_name` attribute pass through the original repo name for when `repository_ctx.original_name` isn't available. Using both for now provides backwards and forward compatibility across Bazel versions while avoiding the need for parsing the canonical repo name format. The canonical repo name format has changed several times, making this a very practical concern. For more background, see: - bazelbuild/bazel#24467 - bazelbuild/bazel#25121 And as for why we recommend using Bazel 8.1.1 or later, instead of 8.1.0 when `repository_ctx.original_name` first appeared: - bazelbuild/bazel#25286 --- However, the build now breaks with: ```txt ERROR: external/rules_magic+/toolchains/BUILD:17:22: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. and referenced by '@@rules_magic+//toolchains:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` This is because `native.bind` doesn't work under Bzlmod. We're not yet hitting the error indicating that `native.bind` is no longer available, but that the artifical `//external` package no longer exists.
Fixes the breakage in `@rules_magic_leaflet` from the previous commit by using two mechanisms for generating a default target name in a repository rule. - Bazel 8.1.1 added `repository_ctx.original_name` to facilitate the generation of default repo target names. - For earlier Bazels, the wrapper macro and `default_target_name` attribute pass through the original repo name for when `repository_ctx.original_name` isn't available. Using both for now provides backwards and forward compatibility across Bazel versions while avoiding the need for parsing the canonical repo name format. The canonical repo name format has changed several times, making this a very practical concern. For more background, see: - bazelbuild/bazel#24467 - bazelbuild/bazel#25121 And as for why we recommend using Bazel 8.1.1 or later, instead of 8.1.0 when `repository_ctx.original_name` first appeared: - bazelbuild/bazel#25286 --- However, the build now breaks with: ```txt ERROR: external/rules_magic+/toolchains/BUILD:17:22: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. and referenced by '@@rules_magic+//toolchains:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` This is because `native.bind` doesn't work under Bzlmod. We're not yet hitting the error indicating that `native.bind` is no longer available, but that the artifical `//external` package no longer exists.
Fixes the breakage in `@rules_magic_leaflet` from the previous commit by using two mechanisms for generating a default target name in a repository rule. - Bazel 7.7.0 and 8.1.1 provide `repository_ctx.original_name` to facilitate the generation of default repo target names. - For earlier Bazels, the wrapper macro and `default_target_name` attribute pass through the original repo name for when `repository_ctx.original_name` isn't available. Using both for now provides backwards and forward compatibility across Bazel versions while avoiding the need for parsing the canonical repo name format. The canonical repo name format has changed several times, making this a very practical concern. For more background, see: - bazelbuild/bazel#24467 - bazelbuild/bazel#25121 As for why we recommend using Bazel 8.1.1 or later, instead of 8.1.0 when `repository_ctx.original_name` first appeared: - bazelbuild/bazel#25286 And as for why `rules_kotlin` appears now in `MODULE.bazel.lock`, I have no idea. --- However, the build now breaks with the following errors. Bazel 7 reports: ```txt ERROR: no such package 'external': the WORKSPACE file is disabled via --noenable_workspace ERROR: external/rules_magic+/magic/BUILD:38:22: no such package 'external': the WORKSPACE file is disabled via --noenable_workspace and referenced by '@@rules_magic+//magic:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` Bazel 8 reports: ```txt ERROR: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. ERROR: .../external/rules_magic+/magic/BUILD:38:22: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. and referenced by '@@rules_magic+//magic:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` This is because `native.bind` doesn't work under Bzlmod. We're not yet hitting the error indicating that `native.bind` is no longer available, but that the artifical `//external` package no longer exists.
Fixes the breakage in `@rules_magic_leaflet` from the previous commit by using two mechanisms for generating a default target name in a repository rule. - Bazel 7.7.0 and 8.1.1 provide `repository_ctx.original_name` to facilitate the generation of default repo target names. - For earlier Bazels, the wrapper macro and `default_target_name` attribute pass through the original repo name for when `repository_ctx.original_name` isn't available. Using both for now provides backwards and forward compatibility across Bazel versions while avoiding the need for parsing the canonical repo name format. The canonical repo name format has changed several times, making this a very practical concern. For more background, see: - bazelbuild/bazel#24467 - bazelbuild/bazel#25121 As for why we recommend using Bazel 8.1.1 or later, instead of 8.1.0 when `repository_ctx.original_name` first appeared: - bazelbuild/bazel#25286 And as for why `rules_kotlin` appears now in `MODULE.bazel.lock`, I have no idea. --- However, the build now breaks with the following errors. Bazel 7 reports: ```txt ERROR: no such package 'external': the WORKSPACE file is disabled via --noenable_workspace ERROR: external/rules_magic+/magic/BUILD:38:22: no such package 'external': the WORKSPACE file is disabled via --noenable_workspace and referenced by '@@rules_magic+//magic:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` Bazel 8 reports: ```txt ERROR: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. ERROR: .../external/rules_magic+/magic/BUILD:38:22: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. and referenced by '@@rules_magic+//magic:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` This is because `native.bind` doesn't work under Bzlmod. We're not yet hitting the error indicating that `native.bind` is no longer available, but that the artifical `//external` package no longer exists.
Fixes the breakage in `@rules_magic_leaflet` from the previous commit by using two mechanisms for generating a default target name in a repository rule. - Bazel 8.1.1 added `repository_ctx.original_name` to facilitate the generation of default repo target names. - For earlier Bazels, the wrapper macro and `default_target_name` attribute pass through the original repo name for when `repository_ctx.original_name` isn't available. Using both for now provides backwards and forward compatibility across Bazel versions while avoiding the need for parsing the canonical repo name format. The canonical repo name format has changed several times, making this a very practical concern. For more background, see: - bazelbuild/bazel#24467 - bazelbuild/bazel#25121 And as for why we recommend using Bazel 8.1.1 or later, instead of 8.1.0 when `repository_ctx.original_name` first appeared: - bazelbuild/bazel#25286 --- However, the build now breaks with: ```txt ERROR: external/rules_magic+/toolchains/BUILD:17:22: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. and referenced by '@@rules_magic+//toolchains:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` This is because `native.bind` doesn't work under Bzlmod. We're not yet hitting the error indicating that `native.bind` is no longer available, but that the artifical `//external` package no longer exists.
Fixes the breakage in `@rules_magic_leaflet` from the previous commit by using two mechanisms for generating a default target name in a repository rule. - Bazel 8.1.1 added `repository_ctx.original_name` to facilitate the generation of default repo target names. - For earlier Bazels, the wrapper macro and `default_target_name` attribute pass through the original repo name for when `repository_ctx.original_name` isn't available. Using both for now provides backwards and forward compatibility across Bazel versions while avoiding the need for parsing the canonical repo name format. The canonical repo name format has changed several times, making this a very practical concern. For more background, see: - bazelbuild/bazel#24467 - bazelbuild/bazel#25121 And as for why we recommend using Bazel 8.1.1 or later, instead of 8.1.0 when `repository_ctx.original_name` first appeared: - bazelbuild/bazel#25286 --- However, the build now breaks with: ```txt ERROR: external/rules_magic+/toolchains/BUILD:17:22: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. and referenced by '@@rules_magic+//toolchains:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` This is because `native.bind` doesn't work under Bzlmod. We're not yet hitting the error indicating that `native.bind` is no longer available, but that the artifical `//external` package no longer exists.
Fixes the breakage in `@rules_magic_leaflet` from the previous commit by using two mechanisms for generating a default target name in a repository rule. - Bazel 7.7.0 and 8.1.1 provide `repository_ctx.original_name` to facilitate the generation of default repo target names. - For earlier Bazels, the wrapper macro and `default_target_name` attribute pass through the original repo name for when `repository_ctx.original_name` isn't available. Using both for now provides backwards and forward compatibility across Bazel versions while avoiding the need for parsing the canonical repo name format. The canonical repo name format has changed several times, making this a very practical concern. For more background, see: - bazelbuild/bazel#24467 - bazelbuild/bazel#25121 As for why we recommend using Bazel 8.1.1 or later, instead of 8.1.0 when `repository_ctx.original_name` first appeared: - bazelbuild/bazel#25286 And as for why `rules_kotlin` appears now in `MODULE.bazel.lock`, I have no idea. --- However, the build now breaks with the following errors. Bazel 7 reports: ```txt ERROR: no such package 'external': the WORKSPACE file is disabled via --noenable_workspace ERROR: external/rules_magic+/magic/BUILD:38:22: no such package 'external': the WORKSPACE file is disabled via --noenable_workspace and referenced by '@@rules_magic+//magic:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` Bazel 8 reports: ```txt ERROR: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. ERROR: .../external/rules_magic+/magic/BUILD:38:22: no such package '@@rules_magic+//external': BUILD file not found in directory 'external' of external repository @@rules_magic+. Add a BUILD file to a directory to mark it as a package. and referenced by '@@rules_magic+//magic:default_settings_toolchain_impl' ERROR: Analysis of target '//:default-values' failed; build aborted: Analysis failed ``` This is because `native.bind` doesn't work under Bzlmod. We're not yet hitting the error indicating that `native.bind` is no longer available, but that the artifical `//external` package no longer exists.
This new attribute contains the original value of the
nameattribute at the instantiation site of the repo rule (e.g.,rctx.original_namewould befooifrctx.nameis+ext+foo).Fixes #24467