From 12a8bd59af6f9de9697cb2080c167feb0edc305e Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Tue, 15 Oct 2024 14:28:22 +0200 Subject: [PATCH] Move static library validation helper to `ar_files` It doesn't need to be staged for every compile or link action. The action that uses it stages `all_files`. --- cc/private/toolchain/BUILD.tpl | 5 +++++ cc/private/toolchain/unix_cc_configure.bzl | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cc/private/toolchain/BUILD.tpl b/cc/private/toolchain/BUILD.tpl index 99896dc..da3c06e 100644 --- a/cc/private/toolchain/BUILD.tpl +++ b/cc/private/toolchain/BUILD.tpl @@ -68,6 +68,11 @@ filegroup( srcs = glob(["extra_tools/**"], allow_empty = True) + [%{cc_compiler_deps}], ) +filegroup( + name = "ar_files", + srcs = [":compiler_deps"] + [%{ar_deps}], +) + # This is the entry point for --crosstool_top. Toolchains are found # by lopping off the name of --crosstool_top and searching for # the "${CPU}" entry in the toolchains attribute. diff --git a/cc/private/toolchain/unix_cc_configure.bzl b/cc/private/toolchain/unix_cc_configure.bzl index 0629a50..ac0e0e1 100644 --- a/cc/private/toolchain/unix_cc_configure.bzl +++ b/cc/private/toolchain/unix_cc_configure.bzl @@ -628,9 +628,8 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overridden_tools): ":builtin_include_directory_paths", ":cc_wrapper", ":deps_scanner_wrapper", - ] + ( - [":validate_static_library"] if "validate_static_library" in tool_paths else [] - )), + ]), + "%{ar_deps}": get_starlark_list([":validate_static_library"] if "validate_static_library" in tool_paths else []), "%{cc_toolchain_identifier}": cc_toolchain_identifier, "%{compile_flags}": get_starlark_list( [