You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generating a crates universe using crates_vendor a defs.bzl file is created to define all of the downloaded http_archive targets. Here's an example target that's generated.
This works fine as long as the path @//third-party/bazel is correct. This path becomes incorrect, however, if the module that makes use of this crates_vendor target happens to get included via bzlmod. Now, the absolute path @// is unknown from within the included module.
In the top-level module, this leads to the creation of an unparseable MODULE.bazel.lock file which includes labels like
The fix is simple, if manual, we can replace those labels in the defs.bzl file with ones that reference the local top-level repo, i.e. replace the @// with // instead. However, it's unclear if this is correct. Why are these @// paths being generated? Is it valid to make this substitution?
@UebelAndre would simply updating that line be enough? Label() should give the absolute path to the object as seen from crates_vendor.bzl, so @ doesn't seem like it should be there?
Addresses #2661
If the workspace name is empty, the crate_module_template will use a
label like `Label(//<stuff>)` instead of `Label(@//<stuff>)`
Most of the changes in this are just regenerating the vendor'ed crates
in the examples. I ran the tests in all the relevant examples to ensure
they still worked.
When generating a crates universe using crates_vendor a defs.bzl file is created to define all of the downloaded http_archive targets. Here's an example target that's generated.
This works fine as long as the path
@//third-party/bazel
is correct. This path becomes incorrect, however, if the module that makes use of this crates_vendor target happens to get included via bzlmod. Now, the absolute path@//
is unknown from within the included module.In the top-level module, this leads to the creation of an unparseable
MODULE.bazel.lock
file which includes labels likeThe fix is simple, if manual, we can replace those labels in the
defs.bzl
file with ones that reference the local top-level repo, i.e. replace the@//
with//
instead. However, it's unclear if this is correct. Why are these@//
paths being generated? Is it valid to make this substitution?Here's a quick reproduction of the error.
https://github.com/tel/cxx_bzlmod_repro
The text was updated successfully, but these errors were encountered: