feat(bzlmod): mark toolchains extension as reproducible

This commit is contained in:
Corentin Kerisit 2024-10-22 00:05:26 +02:00
parent 1e45f06e06
commit 8557ef43b7
2 changed files with 7 additions and 1 deletions

View File

@ -8,6 +8,7 @@ module(
)
# Lower-bounds (minimum) versions for direct runtime dependencies
bazel_dep(name = "bazel_features", version = "1.9.0")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "platforms", version = "0.0.10")
@ -79,4 +80,3 @@ use_repo(host_platform, "host_platform")
bazel_dep(name = "aspect_rules_lint", version = "1.0.0-rc10", dev_dependency = True)
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.5.0", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
bazel_dep(name = "bazel_features", version = "0.2.0", dev_dependency = True)

View File

@ -25,6 +25,7 @@ load(
"register_yq_toolchains",
"register_zstd_toolchains",
)
load("@bazel_features//:features.bzl", "bazel_features")
load("//lib/private:extension_utils.bzl", "extension_utils")
load("//lib/private:host_repo.bzl", "host_repo")
@ -117,6 +118,11 @@ def _toolchains_extension_impl(mctx):
get_version_fn = lambda attr: attr.core_version,
)
if bazel_features.external_deps.extension_metadata_has_reproducible:
return mctx.extension_metadata(reproducible = True)
return mctx.extension_metadata()
toolchains = module_extension(
implementation = _toolchains_extension_impl,
tag_classes = {