Open TvdW opened 1 month ago
Certainly not intended. @linzhp can you have a look?
adding dev_dependency=True
to the register_toolchains
should prevent the toolchains from being registered by consumers of this module.
it seam like --incompatible_enable_cc_toolchain_resolution
default to be true in bazel 7.0. I set this flag to false, and host default toolchains works again.
As of 8a1ca917888f32c4c3106a275d3611d2b3f1bbf6 / #135, the root MODULE.bazel contains a call to
register_toolchains
that causes every zig-cc toolchain to be registered if the module is loaded. This means that when loading hermetic_cc_toolchain using bzlmod, it's not possible to only build a single target using this toolchain, as they will be registered by default and picked up by bazel for all compilation.I believe this to be a bug, as the README specifically lists this as an option.
This could well be a Bazel bug in visibility: I don't think that just loading a module should ever create side-effects like this. Sadly, it still makes it problematic to load hermetic_cc_toolchain via bzlmod.