-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Workspace, repository, and label terms are still confusing, esp. w.r.t. repostiory_name #16210
Comments
Thanks for filing this. I'll definitely take some time to tackle this for 6.0.0, together with #15821 |
Sweet, thanks! If it helps at all, here was motivating application (or attempt haha): |
Taking this off the milestone for now since it doesn't block branch cut. Will have to finish this before 6.0 launch though. |
@bazel-io fork 7.1.0 |
@Wyverald Could we also backport this to 6.5.0? Otherwise we will have to wait for one more year before we can disable the old API and/or allow rulesets to drop the feature detection required to work with both. |
@bazel-io fork 6.5.0 |
Note -- there's another commit incoming that'll rename the new |
"local" is an incredibly overloaded term. Follow-up for #16210 RELNOTES: Label.local_target_label is renamed to Label.same_package_label. PiperOrigin-RevId: 591940544 Change-Id: Ic050234471dc7c729a014794de57590a145b1e34
Been a long time coming. * `native.repository_name()` is deprecated (has a spurious `@` prefix). A new method `native.repo_name()` is introduced instead. * `Label.workspace_name` is deprecated (misnomer). A new field `Label.repo_name` is introduced instead. * `Label.relative()` is deprecated (error-prone). A new method `Label.local_target_label()` is introduced with narrowed focus, alongside which `native.package_relative_label()` and `Label()` are recommended as replacements. And then a bunch of documentation cleanups, hopefully reducing any potential confusion. Fixes #16210. RELNOTES: Various methods and fields related to labels and repos are deprecated in favor of new options with clearer naming and intent. The deprecated APIs can be disabled by setting `--noincompatible_enable_deprecated_label_apis`. * `native.repository_name()` is deprecated in favor of the new `native.repo_name()`. * `Label.workspace_name` is deprecated in favor of the new `Label.repo_name`. * `Label.relative()` is deprecated in favor of the new `Label.local_target_label()` alongside the existing `native.package_relative_label()` and `Label()`. PiperOrigin-RevId: 590712228 Change-Id: I1724f3c4f3c21876a67f4a0291f6ebc0a1fa4b75
"local" is an incredibly overloaded term. Follow-up for #16210 RELNOTES: Label.local_target_label is renamed to Label.same_package_label. PiperOrigin-RevId: 591940544 Change-Id: Ic050234471dc7c729a014794de57590a145b1e34
@Wyverald I just wanted to follow up on this. Do you want us to cherry-pick 6cb2d86 now to 7.1.0 and 6.5.0? Or are you pushing more changes? |
A fix for this issue has been included in Bazel 6.5.0 RC1. Please test out the release candidate and report any issues as soon as possible. Thanks! |
Been a long time coming. * `native.repository_name()` is deprecated (has a spurious `@` prefix). A new method `native.repo_name()` is introduced instead. * `Label.workspace_name` is deprecated (misnomer). A new field `Label.repo_name` is introduced instead. * `Label.relative()` is deprecated (error-prone). A new method `Label.local_target_label()` is introduced with narrowed focus, alongside which `native.package_relative_label()` and `Label()` are recommended as replacements. And then a bunch of documentation cleanups, hopefully reducing any potential confusion. Fixes #16210. RELNOTES: Various methods and fields related to labels and repos are deprecated in favor of new options with clearer naming and intent. The deprecated APIs can be disabled by setting `--noincompatible_enable_deprecated_label_apis`. * `native.repository_name()` is deprecated in favor of the new `native.repo_name()`. * `Label.workspace_name` is deprecated in favor of the new `Label.repo_name`. * `Label.relative()` is deprecated in favor of the new `Label.local_target_label()` alongside the existing `native.package_relative_label()` and `Label()`. PiperOrigin-RevId: 590712228 Change-Id: I1724f3c4f3c21876a67f4a0291f6ebc0a1fa4b75
"local" is an incredibly overloaded term. Follow-up for #16210 RELNOTES: Label.local_target_label is renamed to Label.same_package_label. PiperOrigin-RevId: 591940544 Change-Id: Ic050234471dc7c729a014794de57590a145b1e34
Been a long time coming. * `native.repository_name()` is deprecated (has a spurious `@` prefix). A new method `native.repo_name()` is introduced instead. * `Label.workspace_name` is deprecated (misnomer). A new field `Label.repo_name` is introduced instead. * `Label.relative()` is deprecated (error-prone). A new method `Label.local_target_label()` is introduced with narrowed focus, alongside which `native.package_relative_label()` and `Label()` are recommended as replacements. And then a bunch of documentation cleanups, hopefully reducing any potential confusion. Fixes #16210. RELNOTES: Various methods and fields related to labels and repos are deprecated in favor of new options with clearer naming and intent. The deprecated APIs can be disabled by setting `--noincompatible_enable_deprecated_label_apis`. * `native.repository_name()` is deprecated in favor of the new `native.repo_name()`. * `Label.workspace_name` is deprecated in favor of the new `Label.repo_name`. * `Label.relative()` is deprecated in favor of the new `Label.same_package_label()` alongside the existing `native.package_relative_label()` and `Label()`.
Been a long time coming. * `native.repository_name()` is deprecated (has a spurious `@` prefix). A new method `native.repo_name()` is introduced instead. * `Label.workspace_name` is deprecated (misnomer). A new field `Label.repo_name` is introduced instead. * `Label.relative()` is deprecated (error-prone). A new method `Label.local_target_label()` is introduced with narrowed focus, alongside which `native.package_relative_label()` and `Label()` are recommended as replacements. And then a bunch of documentation cleanups, hopefully reducing any potential confusion. Fixes #16210. RELNOTES: Various methods and fields related to labels and repos are deprecated in favor of new options with clearer naming and intent. The deprecated APIs can be disabled by setting `--noincompatible_enable_deprecated_label_apis`. * `native.repository_name()` is deprecated in favor of the new `native.repo_name()`. * `Label.workspace_name` is deprecated in favor of the new `Label.repo_name`. * `Label.relative()` is deprecated in favor of the new `Label.same_package_label()` alongside the existing `native.package_relative_label()` and `Label()`.
A fix for this issue has been included in Bazel 7.1.0 RC1. Please test out the release candidate and report any issues as soon as possible. Thanks! |
Description of the feature request:
It is a bit confusing two grok the two differences:
Label.workspace_name
does not have@
in its name. However,native.repository_name()
does have@
in its name. Is this nuance documented? (both are stated as "names"){qualified_package}:{name}
). Is there guidance on this?The following docs are uber helpful:
But it'd still be nice to have something that denotes the minor difference, as well indicates some of term like "qualified package" to denote
@workspace//package
.What underlying problem are you trying to solve with this feature?
Making terminology and usages clear and consistent eventually, and sifting through workarounds to #16209 (if that issue is actually valid).
Which operating system are you running Bazel on?
Ubuntu 20.04
What is the output of
bazel info release
?release 5.1.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?Have you found anything relevant by searching the web?
see above
Any other information, logs, or outputs that you want to share?
If at all helpful, this is some dumb heuristics from the following code (uncommenting certain pieces of code)
https://github.com/EricCousineau-TRI/repro/blob/3c8f9afe4b0498b2920c262aebc5a756f75714bc/bazel/label_stuff/defs.bzl#L22-L95
The text was updated successfully, but these errors were encountered: