Remove unused test constants
Can't use them if they're not there
RELNOTES: None.
PiperOrigin-RevId: 240515577
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java
index 6561085..bfdd6a0 100644
--- a/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java
+++ b/src/test/java/com/google/devtools/build/lib/packages/util/MockCcSupport.java
@@ -23,7 +23,6 @@
import com.google.devtools.build.lib.cmdline.PackageIdentifier;
import com.google.devtools.build.lib.cmdline.RepositoryName;
import com.google.devtools.build.lib.packages.util.Crosstool.CcToolchainConfig;
-import com.google.devtools.build.lib.rules.cpp.CppActionNames;
import com.google.devtools.build.lib.rules.cpp.CppRuleClasses;
import com.google.devtools.build.lib.rules.cpp.Link.LinkTargetType;
import com.google.devtools.build.lib.testutil.TestConstants;
@@ -58,329 +57,39 @@
/** This feature will prevent bazel from patching the crosstool. */
public static final String NO_LEGACY_FEATURES_FEATURE = "feature { name: 'no_legacy_features' }";
- public static final String DYNAMIC_LINKING_MODE_FEATURE =
- "feature { name: '" + CppRuleClasses.DYNAMIC_LINKING_MODE + "'}";
-
- public static final String DO_NOT_SPLIT_LINKING_CMDLINE_FEATURE =
- "feature { name: '" + CppRuleClasses.DO_NOT_SPLIT_LINKING_CMDLINE + "' enabled: true}";
-
public static final String SUPPORTS_DYNAMIC_LINKER_FEATURE =
"feature { name: '" + CppRuleClasses.SUPPORTS_DYNAMIC_LINKER + "' enabled: true}";
public static final String SUPPORTS_INTERFACE_SHARED_LIBRARIES_FEATURE =
"feature { name: '" + CppRuleClasses.SUPPORTS_INTERFACE_SHARED_LIBRARIES + "' enabled: true}";
- /** Feature expected by the C++ rules when pic build is requested */
- public static final String PIC_FEATURE =
- "feature {"
- + " name: 'pic'"
- + " enabled: true"
- + " flag_set {"
- + " action: 'assemble'"
- + " action: 'preprocess-assemble'"
- + " action: 'linkstamp-compile'"
- + " action: 'c-compile'"
- + " action: 'c++-compile'"
- + " action: 'c++-module-codegen'"
- + " action: 'c++-module-compile'"
- + " flag_group {"
- + " expand_if_all_available: 'pic'"
- + " flag: '-fPIC'"
- + " }"
- + " }"
- + "}";
-
- /** A feature configuration snippet useful for testing header processing. */
- public static final String PARSE_HEADERS_FEATURE_CONFIGURATION =
- "feature {"
- + " name: 'parse_headers'"
- + " flag_set {"
- + " action: 'c++-header-parsing'"
- + " flag_group {"
- + " flag: '<c++-header-parsing>'"
- + " }"
- + " }"
- + "}";
-
- /** A feature configuration snippet useful for testing the layering check. */
- public static final String LAYERING_CHECK_FEATURE_CONFIGURATION =
- "feature {"
- + " name: 'layering_check'"
- + " flag_set {"
- + " action: 'c-compile'"
- + " action: 'c++-compile'"
- + " action: 'c++-header-parsing'"
- + " action: 'c++-module-compile'"
- + " flag_group {"
- + " iterate_over: 'dependent_module_map_files'"
- + " flag: 'dependent_module_map_file:%{dependent_module_map_files}'"
- + " }"
- + " }"
- + "}";
-
public static final String SIMPLE_LAYERING_CHECK_FEATURE_CONFIGURATION = "simple_layering_check";
public static final String HEADER_MODULES_FEATURES = "header_modules_feature_configuration";
- /** A feature configuration snippet useful for testing header modules. */
- public static final String HEADER_MODULES_FEATURE_CONFIGURATION =
- "feature {"
- + " name: 'header_modules'"
- + " implies: 'use_header_modules'"
- + " implies: 'header_module_compile'"
- + "}"
- + "feature {"
- + " name: 'header_module_compile'"
- + " enabled: true"
- + " implies: 'module_maps'"
- + " flag_set {"
- + " action: 'c++-module-compile'"
- + " flag_group {"
- + " flag: '--woohoo_modules'"
- + " }"
- + " }"
- + " flag_set {"
- + " action: 'c++-module-codegen'"
- + " flag_group {"
- + " flag: '--this_is_modules_codegen'"
- + " }"
- + " }"
- + "}"
- + "feature {"
- + " name: 'header_module_codegen'"
- + " implies: 'header_modules'"
- + "}"
- + "feature {"
- + " name: 'module_maps'"
- + " enabled: true"
- + " flag_set {"
- + " action: 'c-compile'"
- + " action: 'c++-compile'"
- + " action: 'c++-header-parsing'"
- + " action: 'c++-module-compile'"
- + " flag_group {"
- + " flag: 'module_name:%{module_name}'"
- + " flag: 'module_map_file:%{module_map_file}'"
- + " }"
- + " }"
- + "}"
- + "feature {"
- + " name: 'use_header_modules'"
- + " flag_set {"
- + " action: 'c-compile'"
- + " action: 'c++-compile'"
- + " action: 'c++-header-parsing'"
- + " action: 'c++-modules-compile'"
- + " flag_group {"
- + " iterate_over: 'module_files'"
- + " flag: 'module_file:%{module_files}'"
- + " }"
- + " }"
- + "}";
-
- public static final String MODULE_MAP_HOME_CWD_FEATURE =
- "feature {"
- + " name: 'module_map_home_cwd'"
- + " enabled: true"
- + " flag_set {"
- + " action: 'c-compile'"
- + " action: 'c++-compile'"
- + " action: 'c++-header-parsing'"
- + " action: 'c++-module-compile'"
- + " action: 'preprocess-assemble'"
- + " flag_group {"
- + " flag: '<flag>'"
- + " }"
- + " }"
- + "}";
-
/** A feature configuration snippet useful for testing environment variables. */
public static final String ENV_VAR_FEATURES = "env_var_feature_configuration";
- public static final String HOST_AND_NONHOST_CONFIGURATION =
- "feature { "
- + " name: 'host'"
- + " flag_set {"
- + " action: 'c-compile'"
- + " action: 'c++-compile'"
- + " flag_group {"
- + " flag: '-host'"
- + " }"
- + " }"
- + "}"
- + "feature { "
- + " name: 'nonhost'"
- + " flag_set {"
- + " action: 'c-compile'"
- + " action: 'c++-compile'"
- + " flag_group {"
- + " flag: '-nonhost'"
- + " }"
- + " }"
- + "}";
-
public static final String HOST_AND_NONHOST_CONFIGURATION_FEATURES =
"host_and_nonhost_configuration";
public static final String USER_COMPILE_FLAGS = "user_compile_flags";
- public static final String LEGACY_COMPILE_FLAGS_CONFIGURATION =
- "feature {"
- + " name: 'legacy_compile_flags'"
- + " enabled: true"
- + " flag_set {"
- + " action: 'assemble'"
- + " action: 'preprocess-assemble'"
- + " action: 'linkstamp-compile'"
- + " action: 'c-compile'"
- + " action: 'c++-compile'"
- + " action: 'c++-header-parsing'"
- + " action: 'c++-module-compile'"
- + " action: 'c++-module-codegen'"
- + " action: 'lto-backend'"
- + " action: 'clif-match'"
- + " flag_group {"
- + " flag: '%{legacy_compile_flags}'"
- + " iterate_over: 'legacy_compile_flags'"
- + " expand_if_all_available: 'legacy_compile_flags'"
- + " }"
- + " }"
- + "}"
- + "compiler_flag: 'legacy_compile_flag'";
-
- public static final String THIN_LTO_CONFIGURATION =
- "feature { "
- + " name: 'thin_lto'"
- + " requires { feature: 'nonhost' }"
- + " flag_set {"
- + " action: 'c++-link-executable'"
- + " action: 'c++-link-dynamic-library'"
- + " action: 'c++-link-nodeps-dynamic-library'"
- + " action: 'c++-link-static-library'"
- + " flag_group {"
- + " expand_if_all_available: 'thinlto_param_file'"
- + " flag: 'thinlto_param_file=%{thinlto_param_file}'"
- + " }"
- + " }"
- + " flag_set {"
- + " action: 'c-compile'"
- + " action: 'c++-compile'"
- + " flag_group {"
- + " flag: '-flto=thin'"
- + " }"
- + " flag_group {"
- + " expand_if_all_available: 'lto_indexing_bitcode_file'"
- + " flag: 'lto_indexing_bitcode=%{lto_indexing_bitcode_file}'"
- + " }"
- + " }"
- + " flag_set {"
- + " action: 'lto-indexing'"
- + " flag_group {"
- + " flag: 'param_file=%{thinlto_indexing_param_file}'"
- + " flag: 'prefix_replace=%{thinlto_prefix_replace}'"
- + " }"
- + " flag_group {"
- + " expand_if_all_available: 'thinlto_object_suffix_replace'"
- + " flag: 'object_suffix_replace=%{thinlto_object_suffix_replace}'"
- + " }"
- + " flag_group {"
- + " expand_if_all_available: 'thinlto_merged_object_file'"
- + " flag: 'thinlto_merged_object_file=%{thinlto_merged_object_file}'"
- + " }"
- + " }"
- + " flag_set {"
- + " action: 'lto-backend'"
- + " flag_group {"
- + " flag: 'thinlto_index=%{thinlto_index}'"
- + " flag: 'thinlto_output_object_file=%{thinlto_output_object_file}'"
- + " flag: 'thinlto_input_bitcode_file=%{thinlto_input_bitcode_file}'"
- + " }"
- + " }"
- + "}";
-
public static final String AUTOFDO_IMPLICIT_THINLTO = "autofdo_implicit_thinlto";
public static final String FDO_IMPLICIT_THINLTO = "fdo_implicit_thinlto";
public static final String XFDO_IMPLICIT_THINLTO = "xbinaryfdo_implicit_thinlto";
- public static final String PER_OBJECT_DEBUG_INFO_CONFIGURATION =
- "feature { "
- + " name: 'per_object_debug_info'"
- + " enabled: true"
- + " flag_set {"
- + " action: 'c-compile'"
- + " action: 'c++-compile'"
- + " action: 'assemble'"
- + " action: 'preprocess-assemble'"
- + " action: 'c++-module-codegen'"
- + " action: 'lto-backend'"
- + " flag_group {"
- + " expand_if_all_available: 'per_object_debug_info_file'"
- + " flag: 'per_object_debug_info_option'"
- + " }"
- + " }"
- + "}";
-
- public static final String COPY_DYNAMIC_LIBRARIES_TO_BINARY_CONFIGURATION =
- "feature { name: 'copy_dynamic_libraries_to_binary' }";
-
- public static final String SUPPORTS_START_END_LIB_FEATURE =
- "feature { name: 'supports_start_end_lib' enabled: true }";
-
- public static final String SUPPORTS_PIC_FEATURE =
- "feature { name: 'supports_pic' enabled: true }";
-
- public static final String TARGETS_WINDOWS_CONFIGURATION =
- "feature {"
- + " name: 'targets_windows'"
- + " implies: 'copy_dynamic_libraries_to_binary'"
- + " enabled: true"
- + "}";
-
public static final ImmutableList<String> STATIC_LINK_TWEAKED_ARTIFACT_NAME_PATTERN =
ImmutableList.of("static_library", "lib", ".lib");
public static final ImmutableList<String> STATIC_LINK_AS_DOT_A_ARTIFACT_NAME_PATTERN =
ImmutableList.of("static_library", "lib", ".a");
- public static final String MODULE_MAPS_FEATURE =
- "feature {"
- + " name: 'module_maps'"
- + " enabled: true"
- + " flag_set {"
- + " action: 'c-compile'"
- + " action: 'c++-compile'"
- + " action: 'c++-header-parsing'"
- + " action: 'c++-module-compile'"
- + " flag_group {"
- + " flag: 'module_name:%{module_name}'"
- + " flag: 'module_map_file:%{module_map_file}'"
- + " }"
- + " }"
- + "}";
-
- public static final String COMPILER_PARAM_FILE =
- "feature { name: 'compiler_param_file' enabled: true }";
-
- public static final String EMPTY_COMPILE_ACTION_CONFIG =
- emptyActionConfigFor(CppActionNames.CPP_COMPILE);
-
-
public static final String EMPTY_EXECUTABLE_ACTION_CONFIG =
emptyActionConfigFor(LinkTargetType.EXECUTABLE.getActionName());
- public static final String EMPTY_DYNAMIC_LIBRARY_ACTION_CONFIG =
- emptyActionConfigFor(LinkTargetType.NODEPS_DYNAMIC_LIBRARY.getActionName());
-
- public static final String EMPTY_STATIC_LIBRARY_ACTION_CONFIG =
- emptyActionConfigFor(LinkTargetType.STATIC_LIBRARY.getActionName());
-
- public static final String EMPTY_CLIF_MATCH_ACTION_CONFIG =
- emptyActionConfigFor(CppActionNames.CLIF_MATCH);
-
- public static final String EMPTY_STRIP_ACTION_CONFIG = emptyActionConfigFor(CppActionNames.STRIP);
-
public static final String STATIC_LINK_CPP_RUNTIMES_FEATURE =
"feature { name: 'static_link_cpp_runtimes' enabled: true }";