From fe7ca631abefced2830a4b18e5d29eb3f1d82013 Mon Sep 17 00:00:00 2001 From: Googler Date: Mon, 11 Nov 2024 05:49:23 -0800 Subject: [PATCH] Automated rollback of commit 06402610936cb62858ef757ebdf70dbd5a183e25. *** Reason for rollback *** Breaks cc_builtin_tests *** Original change description *** Copybara Merge: https://github.com/bazelbuild/rules_cc/pull/257 BEGIN_PUBLIC Copybara import of the project: -- 12a8bd59af6f9de9697cb2080c167feb0edc305e by Fabian Meumertzheim : 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`. END_PUBLIC *** PiperOrigin-RevId: 695300596 Change-Id: If10c95c1867716c82a09ad3acdfd479beedcc6c5 --- .bazelci/presubmit.yml | 5 +++++ cc/private/toolchain/BUILD.tpl | 5 ----- cc/private/toolchain/unix_cc_configure.bzl | 5 +++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 9e663358..5d8f4a4f 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -5,12 +5,14 @@ build_targets: &build_targets - "//examples/..." - "//tests/..." - "-//examples/custom_toolchain:legacy_selector" # Example only works on Linux + - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. test_targets: &test_targets - "//:all" - "//cc/..." - "//examples/..." - "//tests/..." - "-//examples/custom_toolchain:legacy_selector" # Example only works on Linux + - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. build_targets_bazel_6: &build_targets_bazel_6 - "//:all" @@ -20,6 +22,7 @@ build_targets_bazel_6: &build_targets_bazel_6 - "-//examples/custom_toolchain:legacy_selector" # Example only works on Linux - "-//tests/rule_based_toolchain/..." # proto.encode_text doesn't support None - "-//cc:optional_current_cc_toolchain" # Not supported in Bazel 6 + - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. test_targets_bazel_6: &test_targets_bazel_6 - "//:all" - "//cc:all" @@ -28,6 +31,7 @@ test_targets_bazel_6: &test_targets_bazel_6 - "-//examples/custom_toolchain:legacy_selector" # Example only works on Linux - "-//tests/rule_based_toolchain/..." # proto.encode_text doesn't support None - "-//cc:optional_current_cc_toolchain" # Not supported in Bazel 6 + - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. buildifier: version: latest @@ -75,6 +79,7 @@ tasks: - "//tests/..." - "-//examples/custom_toolchain:legacy_selector" # Example only works on Linux - "-//tests/system_library:system_library_test" # Fails because of repo setup + - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. macos_head: name: MacOS (Bazel HEAD) bazel: last_green diff --git a/cc/private/toolchain/BUILD.tpl b/cc/private/toolchain/BUILD.tpl index 2f97707c..522d67e4 100644 --- a/cc/private/toolchain/BUILD.tpl +++ b/cc/private/toolchain/BUILD.tpl @@ -69,11 +69,6 @@ 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 935fa58b..6a6f38a3 100644 --- a/cc/private/toolchain/unix_cc_configure.bzl +++ b/cc/private/toolchain/unix_cc_configure.bzl @@ -629,8 +629,9 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overridden_tools): ":builtin_include_directory_paths", ":cc_wrapper", ":deps_scanner_wrapper", - ]), - "%{ar_deps}": get_starlark_list([":validate_static_library"] if "validate_static_library" in tool_paths else []), + ] + ( + [":validate_static_library"] if "validate_static_library" in tool_paths else [] + )), "%{cc_toolchain_identifier}": cc_toolchain_identifier, "%{compile_flags}": get_starlark_list( [