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

incompatible_unambiguous_label_stringification #16196

Closed
Wyverald opened this issue Aug 31, 2022 · 3 comments
Closed

incompatible_unambiguous_label_stringification #16196

Wyverald opened this issue Aug 31, 2022 · 3 comments
Labels
breaking-change-6.0 Incompatible flags to be flipped in Bazel 6.0 incompatible-change Incompatible/breaking change migration-ready Incompatible flag is ready for migration with Bazel rolling releases or Bazel@last_green

Comments

@Wyverald
Copy link
Member

To fix #15916, we'll be setting the flag --incompatible_unambiguous_label_stringification to true in Bazel 6.0. This means that labels in the main repo will have an @ prepended to them when stringified, i.e. str(Label("@//foo:bar")) will be "@//foo:bar", instead of "//foo:bar".

Note that if --enable_bzlmod is specified, then the string will contain an extra @ ("@@//foo:bar"), using the canonical label literal syntax (see https://docs.google.com/document/d/1N81qfCa8oskCk5LqTW-LNthy6EBrDot7bdUsjz6JFC4/edit?usp=sharing).

@Wyverald Wyverald added incompatible-change Incompatible/breaking change migration-ready Incompatible flag is ready for migration with Bazel rolling releases or Bazel@last_green labels Aug 31, 2022
@Wyverald
Copy link
Member Author

cc @meteorcloudy

Wyverald added a commit that referenced this issue Sep 2, 2022
Fixes #15916

Fixes #16196

PiperOrigin-RevId: 470939938
Change-Id: I38caf7879fb82c72e07ef11a96be20ade5ac5401
Wyverald added a commit to bazelbuild/rules_rust that referenced this issue Sep 6, 2022
Currently the list in the said file only works if the rules_rust repo is named exactly "rules_rust". This commit fixes it so that the list contains Label objects which would work regardless of what the repo is called.

Also fixes the generation script to allow leading '@'s in the label stringification result (see bazelbuild/bazel#16196).
Wyverald added a commit to bazelbuild/rules_rust that referenced this issue Sep 6, 2022
Currently the list in the said file only works if the rules_rust repo is named exactly "rules_rust". This commit fixes it so that the list contains Label objects which would work regardless of what the repo is called.

Also fixes the generation script to allow leading '@'s in the label stringification result (see bazelbuild/bazel#16196).
Wyverald added a commit to bazelbuild/rules_rust that referenced this issue Sep 6, 2022
Currently the list in the said file only works if the rules_rust repo is named exactly "rules_rust". This commit fixes it so that the list contains Label objects which would work regardless of what the repo is called.

Also fixes the generation script to allow leading '@'s in the label stringification result (see bazelbuild/bazel#16196).
Wyverald added a commit to bazel-contrib/rules_go that referenced this issue Sep 6, 2022
fmeum pushed a commit to bazel-contrib/rules_go that referenced this issue Sep 6, 2022
@Wyverald Wyverald added the breaking-change-6.0 Incompatible flags to be flipped in Bazel 6.0 label Sep 6, 2022
Wyverald added a commit to bazelbuild/rules_scala that referenced this issue Sep 6, 2022
illicitonion pushed a commit to bazelbuild/rules_rust that referenced this issue Sep 6, 2022
Currently the list in the said file only works if the rules_rust repo is named exactly "rules_rust". This commit fixes it so that the list contains Label objects which would work regardless of what the repo is called.

Also fixes the generation script to allow leading '@'s in the label stringification result (see bazelbuild/bazel#16196).
Wyverald added a commit to bazelbuild/rules_scala that referenced this issue Sep 7, 2022
Wyverald added a commit that referenced this issue Sep 8, 2022
Fixes #15916

Fixes #16196

PiperOrigin-RevId: 470939938
Change-Id: I38caf7879fb82c72e07ef11a96be20ade5ac5401
Wyverald added a commit to bazelbuild/rules_scala that referenced this issue Sep 8, 2022
Wyverald added a commit to bazelbuild/rules_scala that referenced this issue Sep 9, 2022
Wyverald added a commit to bazel-contrib/rules_nodejs that referenced this issue Sep 9, 2022
With bazelbuild/bazel#16196 flipped, labels in the main repo will have an extra '@' prepended when stringified. This breaks stuff like https://github.com/bazelbuild/rules_nodejs/blob/a461224651a2802a53a163bef23d6a3fe2597d4d/internal/runfiles/index.cjs#L72 . This commit fixes the issue by removing leading '@'s in main-repo labels before setting BAZEL_TARGET
copybara-service bot pushed a commit to bazelbuild/intellij that referenced this issue Sep 9, 2022
…in-repo labels

Both "@//foo:bar" and "//foo:bar" mean the same thing in the main repo, but the latter can be ambiguous in a non-main repo, so Bazel 6.0 is going to flip bazelbuild/bazel#16196 (i.e. produce "@//foo:bar" instead of "//foo:bar" when `str(label)` is called). This means that for certain intellij tests (such as those deriving from IntellijAspectTest) to keep working, we need to strip the leading '@'s from any such labels.

PiperOrigin-RevId: 472728591
copybara-service bot pushed a commit to bazelbuild/intellij that referenced this issue Sep 9, 2022
…in-repo labels

Both "@//foo:bar" and "//foo:bar" mean the same thing in the main repo, but the latter can be ambiguous in a non-main repo, so Bazel 6.0 is going to flip bazelbuild/bazel#16196 (i.e. produce "@//foo:bar" instead of "//foo:bar" when `str(label)` is called). This means that for certain intellij tests (such as those deriving from IntellijAspectTest) to keep working, we need to strip the leading '@'s from any such labels.

PiperOrigin-RevId: 472728591
copybara-service bot pushed a commit to bazelbuild/intellij that referenced this issue Sep 9, 2022
…in-repo labels

Both "@//foo:bar" and "//foo:bar" mean the same thing in the main repo, but the latter can be ambiguous in a non-main repo, so Bazel 6.0 is going to flip bazelbuild/bazel#16196 (i.e. produce "@//foo:bar" instead of "//foo:bar" when `str(label)` is called). This means that for certain intellij tests (such as those deriving from IntellijAspectTest) to keep working, we need to strip the leading '@'s from any such labels.

PiperOrigin-RevId: 473258584
Wyverald pushed a commit to bazelbuild/intellij that referenced this issue Sep 9, 2022
…in-repo labels

Both "@//foo:bar" and "//foo:bar" mean the same thing in the main repo, but the latter can be ambiguous in a non-main repo, so Bazel 6.0 is going to flip bazelbuild/bazel#16196 (i.e. produce "@//foo:bar" instead of "//foo:bar" when `str(label)` is called). This means that for certain intellij tests (such as those deriving from IntellijAspectTest) to keep working, we need to strip the leading '@'s from any such labels.

PiperOrigin-RevId: 473258584
mai93 pushed a commit to bazelbuild/intellij that referenced this issue Sep 9, 2022
…in-repo labels (#3913)

Both "@//foo:bar" and "//foo:bar" mean the same thing in the main repo, but the latter can be ambiguous in a non-main repo, so Bazel 6.0 is going to flip bazelbuild/bazel#16196 (i.e. produce "@//foo:bar" instead of "//foo:bar" when `str(label)` is called). This means that for certain intellij tests (such as those deriving from IntellijAspectTest) to keep working, we need to strip the leading '@'s from any such labels.
Wyverald added a commit to bazel-contrib/rules_nodejs that referenced this issue Sep 9, 2022
With bazelbuild/bazel#16196 flipped, labels in the main repo will have an extra '@' prepended when stringified. This breaks stuff like https://github.com/bazelbuild/rules_nodejs/blob/a461224651a2802a53a163bef23d6a3fe2597d4d/internal/runfiles/index.cjs#L72 . This commit fixes the issue by removing leading '@'s in main-repo labels before setting BAZEL_TARGET
cpsauer pushed a commit to hedronvision/bazelbuild-intellij that referenced this issue Sep 9, 2022
…in-repo labels (bazelbuild#3913)

Both "@//foo:bar" and "//foo:bar" mean the same thing in the main repo, but the latter can be ambiguous in a non-main repo, so Bazel 6.0 is going to flip bazelbuild/bazel#16196 (i.e. produce "@//foo:bar" instead of "//foo:bar" when `str(label)` is called). This means that for certain intellij tests (such as those deriving from IntellijAspectTest) to keep working, we need to strip the leading '@'s from any such labels.
Wyverald added a commit to bazelbuild/continuous-integration that referenced this issue Sep 15, 2022
fweikert pushed a commit to bazelbuild/continuous-integration that referenced this issue Sep 15, 2022
aiuto pushed a commit to aiuto/bazel that referenced this issue Oct 12, 2022
Fixes bazelbuild#15916

Fixes bazelbuild#16196

PiperOrigin-RevId: 474520825
Change-Id: I38caf7879fb82c72e07ef11a96be20ade5ac5401
ittaiz pushed a commit to wix-playground/intellij that referenced this issue Oct 24, 2022
…in-repo labels (bazelbuild#3913)

Both "@//foo:bar" and "//foo:bar" mean the same thing in the main repo, but the latter can be ambiguous in a non-main repo, so Bazel 6.0 is going to flip bazelbuild/bazel#16196 (i.e. produce "@//foo:bar" instead of "//foo:bar" when `str(label)` is called). This means that for certain intellij tests (such as those deriving from IntellijAspectTest) to keep working, we need to strip the leading '@'s from any such labels.
@brentleyjones
Copy link
Contributor

@Wyverald Is 7.0 or 8.0 the right time to no-op this?

@Wyverald
Copy link
Member Author

Wyverald commented Apr 5, 2023

Unfortunately this is still used in Google (a monorepo where '@' is never used), so I don't think we could remove/no-op this anytime soon.

fmeum pushed a commit to fmeum/continuous-integration that referenced this issue Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change-6.0 Incompatible flags to be flipped in Bazel 6.0 incompatible-change Incompatible/breaking change migration-ready Incompatible flag is ready for migration with Bazel rolling releases or Bazel@last_green
Projects
None yet
Development

No branches or pull requests

2 participants