From 3b4f6f99c6de43d34caf498db50d2ba238f3f250 Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Fri, 31 Jul 2026 14:01:55 -0400 Subject: [PATCH 1/2] Replace the deprecated C++ compiler marker with None --- cc/private/cc_common.bzl | 2 +- tests/cc/common/cc_common_test.bzl | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/cc/private/cc_common.bzl b/cc/private/cc_common.bzl index d78312c6a..3f0616850 100644 --- a/cc/private/cc_common.bzl +++ b/cc/private/cc_common.bzl @@ -732,7 +732,7 @@ cc_common = struct( # Ideally we would like to get rid of this Java symbol and replace it with Starlark one. # And also deprecate this public API. CcToolchainInfo = CcToolchainInfo, - do_not_use_tools_cpp_compiler_present = _cc_common_internal.do_not_use_tools_cpp_compiler_present, + do_not_use_tools_cpp_compiler_present = None, configure_features = configure_features, get_tool_for_action = _get_tool_for_action, get_execution_requirements = _get_execution_requirements, diff --git a/tests/cc/common/cc_common_test.bzl b/tests/cc/common/cc_common_test.bzl index 21399a574..77ea9e15b 100644 --- a/tests/cc/common/cc_common_test.bzl +++ b/tests/cc/common/cc_common_test.bzl @@ -6,10 +6,27 @@ load("@rules_testing//lib:truth.bzl", "matching") load("@rules_testing//lib:util.bzl", "TestingAspectInfo", "util") load("//cc:cc_binary.bzl", "cc_binary") load("//cc:cc_library.bzl", "cc_library") +load("//cc/common:cc_common.bzl", "cc_common") load("//cc/common:cc_info.bzl", "CcInfo") load("//tests/cc/testutil:cc_analysis_test.bzl", "cc_analysis_test") load("//tests/cc/testutil:cc_info_subject.bzl", "cc_info_subject") +def _test_compiler_presence_marker(name): + util.helper_target( + cc_library, + name = name + "/lib", + ) + + cc_analysis_test( + name = name, + impl = _test_compiler_presence_marker_impl, + target = name + "/lib", + ) + +def _test_compiler_presence_marker_impl(env, _target): + env.expect.that_bool(hasattr(cc_common, "do_not_use_tools_cpp_compiler_present")).equals(True) + env.expect.that_bool(cc_common.do_not_use_tools_cpp_compiler_present == None).equals(True) + def _test_same_cc_file_twice(name): util.helper_target( native.filegroup, @@ -661,6 +678,7 @@ def _test_alwayslink_yields_lo_impl(env, target): def cc_common_tests(name): tests = [ + _test_compiler_presence_marker, _test_same_cc_file_twice, _test_same_header_file_twice, _test_isolated_includes, From 56865fdaf446fde183d9a04df2b814de7aa885d6 Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Fri, 31 Jul 2026 20:28:11 -0400 Subject: [PATCH 2/2] Remove unnecessary compiler marker test --- tests/cc/common/cc_common_test.bzl | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/cc/common/cc_common_test.bzl b/tests/cc/common/cc_common_test.bzl index 77ea9e15b..21399a574 100644 --- a/tests/cc/common/cc_common_test.bzl +++ b/tests/cc/common/cc_common_test.bzl @@ -6,27 +6,10 @@ load("@rules_testing//lib:truth.bzl", "matching") load("@rules_testing//lib:util.bzl", "TestingAspectInfo", "util") load("//cc:cc_binary.bzl", "cc_binary") load("//cc:cc_library.bzl", "cc_library") -load("//cc/common:cc_common.bzl", "cc_common") load("//cc/common:cc_info.bzl", "CcInfo") load("//tests/cc/testutil:cc_analysis_test.bzl", "cc_analysis_test") load("//tests/cc/testutil:cc_info_subject.bzl", "cc_info_subject") -def _test_compiler_presence_marker(name): - util.helper_target( - cc_library, - name = name + "/lib", - ) - - cc_analysis_test( - name = name, - impl = _test_compiler_presence_marker_impl, - target = name + "/lib", - ) - -def _test_compiler_presence_marker_impl(env, _target): - env.expect.that_bool(hasattr(cc_common, "do_not_use_tools_cpp_compiler_present")).equals(True) - env.expect.that_bool(cc_common.do_not_use_tools_cpp_compiler_present == None).equals(True) - def _test_same_cc_file_twice(name): util.helper_target( native.filegroup, @@ -678,7 +661,6 @@ def _test_alwayslink_yields_lo_impl(env, target): def cc_common_tests(name): tests = [ - _test_compiler_presence_marker, _test_same_cc_file_twice, _test_same_header_file_twice, _test_isolated_includes,