-
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
[7.0 regression] Unable to load workspace "@myworkspace" where new_local_repository.build_file
refers to BUILD file w/ label "@myworkspace//path/to:BUILD.bazel"
#19963
Comments
Cc @Wyverald |
Thanks for the repro. This bug is specific to The proper fix would be to change the attribute type to a label, which is potentially backwards-incompatible but well, we are allowed to do that. |
@bazel-io fork 7.0.0 |
The attribute is string-typed to support a legacy use case where a path instead of a label could be passed. This causes us to parse a passed label as a canonical label, forgoing repo mapping altogether. Fixes #19963. RELNOTES[INC]: The attribute `new_local_repository.build_file` no longer accepts a path; a label must be passed instead.
The attribute is string-typed to support a legacy use case where a path instead of a label could be passed. This causes us to parse a passed label as a canonical label, forgoing repo mapping altogether. Fixes bazelbuild#19963. RELNOTES[INC]: The attribute `new_local_repository.build_file` no longer accepts a path; a label must be passed instead. Closes bazelbuild#19992. PiperOrigin-RevId: 579188677 Change-Id: I2e2ef7c6423d5dbba1022ab4b3a2537202a9e724
…`new_local_repository.build_file` refers to BUILD file w/ label "@myworkspace//path/to:BUILD.bazel" (#20046) The attribute is string-typed to support a legacy use case where a path instead of a label could be passed. This causes us to parse a passed label as a canonical label, forgoing repo mapping altogether. Fixes #19963. RELNOTES[INC]: The attribute `new_local_repository.build_file` no longer accepts a path; a label must be passed instead. Closes #19992. Commit 76d71d9 PiperOrigin-RevId: 579188677 Change-Id: I2e2ef7c6423d5dbba1022ab4b3a2537202a9e724 Co-authored-by: Xdng Yng <wyverald@gmail.com>
A fix for this issue has been included in Bazel 7.0.0 RC5. Please test out the release candidate and report any issues as soon as possible. Thanks! |
Confirmed resolution w/ RC5. Thanks! |
I think this still happens with Mac. Should I open a new issue? |
Please do! |
Well I made an example but it actually succeeded so never mind :) https://github.com/andrewkatson/bazel_mac_new_local_repo |
Description of the bug:
Bazel 7.0.0rc2 fails to load my project's main workspace, where I have a
new_local_repository
whosebuild_file
argument contains a fully qualified label inside the workspace itself. Thebuild_file
label is fully qualified because it appears in a macro which is shared among multiple repositories.Which category does this issue belong to?
Loading API
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Please see repro repo at https://github.com/beasleyr-vmw/repro-bazel7-new_local_repository .
The main repository is named "canon", and I try to instantiate a
new_local_repository
withbuild_file = "@canon//:BUILD.shared.bazel"
.Which operating system are you running Bazel on?
Linux
What is the output of
bazel info release
?release 7.0.0rc2
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
?No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
Yes.
bazelisk --bisect 7.0.0-pre.20230917.3..2cb3159aed
points to 9be1be9.Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
See #1248 for other use cases of this feature.
The text was updated successfully, but these errors were encountered: