Skip to content

Commit

Permalink
Also mark python extension as reproducible
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed May 16, 2024
1 parent 186029c commit d341fce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/private/bzlmod/python.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

"Python toolchain module extensions for use with bzlmod"

load("@bazel_features//:features.bzl", "bazel_features")
load("//python:repositories.bzl", "python_register_toolchains")
load("//python/private:toolchains_repo.bzl", "multi_toolchain_aliases")
load("//python/private:util.bzl", "IS_BAZEL_6_4_OR_HIGHER")
Expand Down Expand Up @@ -230,6 +231,11 @@ def _python_impl(module_ctx):
debug_info = json.encode_indent(debug_info),
)

if bazel_features.external_deps.extension_metadata_has_reproducible:
return module_ctx.extension_metadata(reproducible = True)
else:
return None

def _fail_duplicate_module_toolchain_version(version, module):
fail(("Duplicate module toolchain version: module '{module}' attempted " +
"to use version '{version}' multiple times in itself").format(
Expand Down

0 comments on commit d341fce

Please sign in to comment.