Skip to content

Commit 72a722d

Browse files
authored
Mark extension as reproducible (#15)
1 parent d14343c commit 72a722d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

MODULE.bazel

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module(
66
compatibility_level = 1,
77
)
88

9+
bazel_dep(name = "bazel_features", version = "1.9.0")
910
bazel_dep(name = "bazel_skylib", version = "1.4.1")
1011
bazel_dep(name = "rules_proto", version = "6.0.0")
1112
bazel_dep(name = "platforms", version = "0.0.8")

protoc/extensions.bzl

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"Module extensions for use under bzlmod"
22

3+
load("@bazel_features//:features.bzl", "bazel_features")
34
load(":toolchain.bzl", "protoc_toolchains")
45

56
DEFAULT_REPOSITORY = "toolchains_protoc_hub"
@@ -25,6 +26,11 @@ def _proto_extension_impl(module_ctx):
2526
if name != root_name:
2627
protoc_toolchains(name, register = False, google_protobuf = toolchain.google_protobuf, version = toolchain.version)
2728

29+
if bazel_features.external_deps.extension_metadata_has_reproducible:
30+
return module_ctx.extension_metadata(reproducible = True)
31+
else:
32+
return None
33+
2834
protoc = module_extension(
2935
implementation = _proto_extension_impl,
3036
tag_classes = {

0 commit comments

Comments
 (0)