Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cc/extensions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ CcSharedLibraryInfo = NativeCcSharedLibraryInfo
""",
)

if hasattr(rctx, "repo_metadata"):
return rctx.repo_metadata(reproducible = False)
return None

_compatibility_proxy_repo_rule = repository_rule(
_compatibility_proxy_repo_impl,
# force reruns on server restarts to use correct native.bazel_version
Expand Down
14 changes: 14 additions & 0 deletions cc/private/toolchain/cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def cc_autoconf_toolchains_impl(repository_ctx):

Args:
repository_ctx: repository context

Returns:
repo_metadata consumed by bazel
"""
if not _should_disable_toolchain(repository_ctx):
if repository_ctx.os.name.lower().find("windows") != -1:
Expand All @@ -51,6 +54,10 @@ def cc_autoconf_toolchains_impl(repository_ctx):
else:
repository_ctx.file("BUILD", "# C++ toolchain autoconfiguration was disabled by BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 or BAZEL_USE_LEGACY_MACOS_TOOLCHAIN=0.")

if hasattr(repository_ctx, "repo_metadata"):
return repository_ctx.repo_metadata(reproducible = True)
return None

cc_autoconf_toolchains = repository_rule(
environ = [
"BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN",
Expand All @@ -66,6 +73,9 @@ def cc_autoconf_impl(repository_ctx, overriden_tools = dict()):
Args:
repository_ctx: repository context
overriden_tools: dict of tool paths to use instead of autoconfigured tools

Returns:
repo_metadata consumed by bazel
"""
cpu_value = get_cpu_value(repository_ctx)
if _should_disable_toolchain(repository_ctx):
Expand Down Expand Up @@ -96,6 +106,10 @@ def cc_autoconf_impl(repository_ctx, overriden_tools = dict()):
else:
configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools)

if hasattr(repository_ctx, "repo_metadata"):
return repository_ctx.repo_metadata(reproducible = False)
return None

MSVC_ENVVARS = [
"BAZEL_VC",
"BAZEL_VC_FULL_VERSION",
Expand Down
4 changes: 4 additions & 0 deletions cc/system_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ alias(
),
)

if hasattr(repo_ctx, "repo_metadata"):
return repo_ctx.repo_metadata(reproducible = False)
return None

system_library = repository_rule(
implementation = _system_library_impl,
local = True,
Expand Down
4 changes: 4 additions & 0 deletions local_bazel.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ alias(
),
)

if hasattr(repository_ctx, "repo_metadata"):
return repository_ctx.repo_metadata(reproducible = False)
return None

local_bazel_import = repository_rule(
implementation = _local_bazel_import_impl,
environ = ["PATH"],
Expand Down