diff --git a/MODULE.bazel b/MODULE.bazel index 92b320fe..5c4657ee 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -19,6 +19,7 @@ module( compatibility_level = 0, ) +bazel_dep(name = "bazel_features", version = "1.36.0") bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "rules_cc", version = "0.2.2") bazel_dep(name = "platforms", version = "0.0.8") diff --git a/toolchain/extensions/llvm.bzl b/toolchain/extensions/llvm.bzl index 28148719..1cb01ec0 100644 --- a/toolchain/extensions/llvm.bzl +++ b/toolchain/extensions/llvm.bzl @@ -1,5 +1,6 @@ """LLVM extension for use with bzlmod""" +load("@bazel_features//:features.bzl", "bazel_features") load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain") load( "@toolchains_llvm//toolchain/internal:repo.bzl", @@ -84,6 +85,11 @@ def _llvm_impl_(module_ctx): if root.name not in toolchain_names: fail("sysroot '%s' does not have a corresponding toolchain" % root.name) + if bazel_features.external_deps.extension_metadata_has_reproducible: + return module_ctx.extension_metadata(reproducible = True) + else: + return None + _attrs = { "name": attr.string(doc = """\ Base name for the generated repositories, allowing more than one LLVM toolchain to be registered.