-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
bzlmod sysroot example test not working #234
Comments
Hitting the same issue |
We are also hitting this. For now, you can work around this by specifying a canonical label:
|
How can I find out the canonical label of a transitive non-module dependency (made visible via |
You can |
Thanks for the hint. I got it working by using |
the full command the below snippet worked well for me
|
#235) Currently the repo rule and tag class accept string-form labels for toolchain root packages and sysroots. Under `bzlmod` this is problematic because users may pass us labels that point at repos that are not in this module's repo mapping. To support such labels, they need to be passed to us as actual `Label`s (not strings). This necessitates some (**breaking**) changes to interface for the module extension tags. The repo rule interface remains the same. For the "llvm" module extension, two new tags have been introduced: - `toolchain_root`, and - `sysroot` Alternatives considered: 1. Using a `label_keyed_string_dict` would not work if we still want to support absolute paths in these attributes. 2. Using string aliases instead of string labels, and then a separate attribute for a side table that maps labels to their aliases could also work. This would have to be done only for the module extension and not the repo rule, because specifying labels in repo rules eagerly fetches them. I've also enabled bzlmod-enabled tests for the system paths, absolute paths, and cross tests in CI. Fixes #234. cc: @steve-261370 --------- Co-authored-by: Siddhartha Bagaria <[email protected]>
I cloned the repo and went into the
tests
directory.The following command, which uses the llvm sysroot toolchain, with bzlmod disabled, works:
bazel test --enable_bzlmod=false --extra_toolchains=@llvm_toolchain_with_sysroot//:cc-toolchain-x86_64-linux //:all
But when bzlmod is enabled, the build fails
bazel test --enable_bzlmod=true --extra_toolchains=@llvm_toolchain_with_sysroot//:cc-toolchain-x86_64-linux //:all
The error returned is:
ERROR: An error occurred during the fetch of repository 'toolchains_llvm~override~llvm~llvm_toolchain_with_sysroot': Traceback (most recent call last): File "/home/steve-261370/.cache/bazel/_bazel_steve-261370/fe79d53e53f1045ef52b7f75d9f074d8/external/toolchains_llvm~override/toolchain/internal/configure.bzl", line 87, column 57, in llvm_config_impl llvm_dist_path_prefix = _pkg_path_from_label(llvm_dist_label) File "/home/steve-261370/.cache/bazel/_bazel_steve-261370/fe79d53e53f1045ef52b7f75d9f074d8/external/toolchains_llvm~override/toolchain/internal/common.bzl", line 144, column 13, in pkg_path_from_label if label.workspace_root: Error: 'workspace_root' is not allowed on invalid Label @[unknown repo 'llvm_toolchain_llvm' requested from @toolchains_llvm~override]//:BUILD.bazel
It looks like the github tests only run through the sysroot tests with bzlmod=false. I am running bazel 6.4.0 on a debian-based system.
The text was updated successfully, but these errors were encountered: