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
in MODULE.bazel of both module "A" and "B", then I get the following error when compiling module "B" which depends on module "A":
ERROR: Traceback (most recent call last):
File "/home/USER/.cache/bazel/_bazel_builder/395eea75460def8a11dd35795d615210/external/toolchains_llvm~override/toolchain/extensions/llvm.bzl", line 13, column 17, in _llvm_impl_
fail("Only the root module can use the 'llvm' extension")
Error in fail: Only the root module can use the 'llvm' extension
But if I remove it from module "A", I can no longer build module "A" correctly standalone.
How can I define the llvm_toolchain such that I can use it in both modules "A" and "B"?
Would it be possible to just ignore non-root tool chain calls and print a warning instead of the fail()? This is what the Python tool chain is doing as well.
You can add dev_dependency = True to your use_extension and register_toolchains calls. Then the toolchain definition in A will be ignored when building from B. If needed, B can define its own toolchain in this way.
I have a Bzlmod module "A" which I want to be able to build standalone but also be depended on by module "B".
If I define
in
MODULE.bazel
of both module "A" and "B", then I get the following error when compiling module "B" which depends on module "A":But if I remove it from module "A", I can no longer build module "A" correctly standalone.
How can I define the llvm_toolchain such that I can use it in both modules "A" and "B"?
Based on #235.
The text was updated successfully, but these errors were encountered: