Skip to content

Commit cebf1ed

Browse files
authored
Mark extension as reproducible (#570)
Avoids an unnecessary lockfile entry.
1 parent 96b08ff commit cebf1ed

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module(
1919
compatibility_level = 0,
2020
)
2121

22+
bazel_dep(name = "bazel_features", version = "1.36.0")
2223
bazel_dep(name = "bazel_skylib", version = "1.5.0")
2324
bazel_dep(name = "rules_cc", version = "0.2.2")
2425
bazel_dep(name = "platforms", version = "0.0.8")

toolchain/extensions/llvm.bzl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""LLVM extension for use with bzlmod"""
22

3+
load("@bazel_features//:features.bzl", "bazel_features")
34
load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")
45
load(
56
"@toolchains_llvm//toolchain/internal:repo.bzl",
@@ -84,6 +85,11 @@ def _llvm_impl_(module_ctx):
8485
if root.name not in toolchain_names:
8586
fail("sysroot '%s' does not have a corresponding toolchain" % root.name)
8687

88+
if bazel_features.external_deps.extension_metadata_has_reproducible:
89+
return module_ctx.extension_metadata(reproducible = True)
90+
else:
91+
return None
92+
8793
_attrs = {
8894
"name": attr.string(doc = """\
8995
Base name for the generated repositories, allowing more than one LLVM toolchain to be registered.

0 commit comments

Comments
 (0)