| # Copied from https://github.com/bazelbuild/bazel/blob/a0760f1a08aca117912b39b7ba0eda2be50d17ce/src/test/java/com/google/devtools/build/lib/analysis/mock/cc_toolchain_config.bzl. |
| |
| """ A rule that mocks cc_toolchain configuration.""" |
| |
| load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo") |
| load( |
| "@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", |
| "action_config", |
| "artifact_name_pattern", |
| "env_entry", |
| "env_set", |
| "feature", |
| "feature_set", |
| "flag_group", |
| "flag_set", |
| "make_variable", |
| "tool", |
| "tool_path", |
| "variable_with_value", |
| "with_feature_set", |
| ) |
| load("//cc:action_names.bzl", "ACTION_NAMES") |
| load("//cc/common:cc_common.bzl", "cc_common") |
| load("//cc/toolchains:cc_toolchain_config_info.bzl", "CcToolchainConfigInfo") |
| load("//tests/cc/testutil/toolchains:features.bzl", "FEATURE_NAMES") |
| |
| _cpp_modules_feature = feature( |
| name = FEATURE_NAMES.cpp_modules, |
| enabled = False, |
| ) |
| |
| _no_copts_tokenization_feature = feature(name = FEATURE_NAMES.no_copts_tokenization) |
| |
| _disable_pbh_feature = feature(name = FEATURE_NAMES.disable_pbh) |
| |
| _no_legacy_features_feature = feature(name = FEATURE_NAMES.no_legacy_features) |
| |
| _do_not_split_linking_cmdline_feature = feature(name = FEATURE_NAMES.do_not_split_linking_cmdline) |
| |
| _supports_dynamic_linker_feature = feature( |
| name = FEATURE_NAMES.supports_dynamic_linker, |
| enabled = True, |
| ) |
| |
| _shorten_virtual_includes_feature = feature( |
| name = FEATURE_NAMES.shorten_virtual_includes, |
| enabled = True, |
| ) |
| |
| _skip_virtual_includes_feature = feature( |
| name = FEATURE_NAMES.skip_virtual_includes, |
| ) |
| |
| _supports_interface_shared_libraries_feature = feature( |
| name = FEATURE_NAMES.supports_interface_shared_libraries, |
| enabled = True, |
| ) |
| |
| _define_with_space = feature( |
| name = "default", |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.linkstamp_compile, |
| ACTION_NAMES.cpp_header_parsing, |
| ACTION_NAMES.cpp_module_compile, |
| ACTION_NAMES.cpp_module_codegen, |
| ACTION_NAMES.clif_match, |
| ACTION_NAMES.objcpp_compile, |
| ], |
| flag_groups = [flag_group(flags = ["-Dfoo=bar bam"])], |
| ), |
| ], |
| ) |
| |
| _pic_feature = feature( |
| name = FEATURE_NAMES.pic, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.assemble, |
| ACTION_NAMES.preprocess_assemble, |
| ACTION_NAMES.linkstamp_compile, |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.cpp_module_codegen, |
| ACTION_NAMES.cpp_module_compile, |
| ], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "pic", |
| flags = ["-fPIC"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _parse_headers_feature = feature( |
| name = FEATURE_NAMES.parse_headers, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_header_parsing], |
| flag_groups = [ |
| flag_group( |
| flags = ["<c++-header-parsing>"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _layering_check_feature = feature( |
| name = FEATURE_NAMES.layering_check, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.cpp_header_parsing, |
| ACTION_NAMES.cpp_module_compile, |
| ], |
| flag_groups = [ |
| flag_group( |
| iterate_over = "dependent_module_map_files", |
| flags = [ |
| "dependent_module_map_file:%{dependent_module_map_files}", |
| ], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _simple_layering_check_feature = feature( |
| name = FEATURE_NAMES.layering_check, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_compile], |
| flag_groups = [flag_group(flags = ["<flag>"])], |
| ), |
| ], |
| ) |
| |
| _simple_header_modules_feature = feature( |
| name = FEATURE_NAMES.header_modules, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_module_compile], |
| flag_groups = [flag_group(flags = ["<flag>"])], |
| ), |
| ], |
| ) |
| |
| _header_modules_feature = feature( |
| name = FEATURE_NAMES.header_modules, |
| implies = ["use_header_modules", "header_module_compile"], |
| ) |
| |
| _header_module_compile_feature = feature( |
| name = FEATURE_NAMES.header_module_compile, |
| enabled = True, |
| implies = ["module_maps"], |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_module_compile], |
| flag_groups = [ |
| flag_group( |
| flags = ["--woohoo_modules"], |
| ), |
| ], |
| ), |
| flag_set( |
| actions = [ACTION_NAMES.cpp_module_codegen], |
| flag_groups = [ |
| flag_group( |
| flags = ["--this_is_modules_codegen"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _cpp_compile_with_requirements = feature(name = FEATURE_NAMES.cpp_compile_with_requirements) |
| |
| _header_module_codegen_feature = feature( |
| name = FEATURE_NAMES.header_module_codegen, |
| implies = ["header_modules"], |
| ) |
| |
| _module_maps_feature = feature( |
| name = FEATURE_NAMES.module_maps, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.cpp_header_parsing, |
| ACTION_NAMES.cpp_module_compile, |
| ], |
| flag_groups = [ |
| flag_group( |
| flags = [ |
| "module_name:%{module_name}", |
| "module_map_file:%{module_map_file}", |
| ], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _use_header_modules_feature = feature( |
| name = FEATURE_NAMES.use_header_modules, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.cpp_header_parsing, |
| ACTION_NAMES.cpp_module_compile, |
| ], |
| flag_groups = [ |
| flag_group( |
| iterate_over = "module_files", |
| flags = ["module_file:%{module_files}"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _header_modules_feature_configuration = [ |
| _header_modules_feature, |
| _header_module_compile_feature, |
| _header_module_codegen_feature, |
| _module_maps_feature, |
| _use_header_modules_feature, |
| ] |
| |
| _module_map_home_cwd_feature = feature( |
| name = FEATURE_NAMES.module_map_home_cwd, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.cpp_header_parsing, |
| ACTION_NAMES.cpp_module_compile, |
| ACTION_NAMES.cpp_header_parsing, |
| ACTION_NAMES.preprocess_assemble, |
| ], |
| flag_groups = [ |
| flag_group( |
| flags = ["<flag>"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _env_feature = feature( |
| name = FEATURE_NAMES.env_feature, |
| implies = ["static_env_feature", "module_maps"], |
| ) |
| |
| _static_env_feature = feature( |
| name = FEATURE_NAMES.static_env_feature, |
| env_sets = [ |
| env_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.cpp_header_parsing, |
| ACTION_NAMES.cpp_module_compile, |
| ACTION_NAMES.lto_backend, |
| ], |
| env_entries = [ |
| env_entry( |
| key = "cat", |
| value = "meow", |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _module_maps_env_var_feature = feature( |
| name = FEATURE_NAMES.module_maps, |
| enabled = True, |
| env_sets = [ |
| env_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.cpp_header_parsing, |
| ACTION_NAMES.cpp_module_compile, |
| ], |
| env_entries = [ |
| env_entry( |
| key = "module", |
| value = "module_name:%{module_name}", |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _simple_module_maps_feature = feature( |
| name = FEATURE_NAMES.module_maps, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.cpp_compile, |
| ], |
| flag_groups = [ |
| flag_group( |
| flags = ["<flag>"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _extra_implies_module_maps_feature = feature( |
| name = "extra", |
| implies = ["module_maps"], |
| ) |
| |
| _env_var_feature_configuration = [ |
| _env_feature, |
| _static_env_feature, |
| _module_maps_env_var_feature, |
| ] |
| |
| _host_feature = feature( |
| name = FEATURE_NAMES.host, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], |
| flag_groups = [flag_group(flags = ["-host"])], |
| ), |
| ], |
| ) |
| |
| _nonhost_feature = feature( |
| name = FEATURE_NAMES.nonhost, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], |
| flag_groups = [flag_group(flags = ["-nonhost"])], |
| ), |
| ], |
| ) |
| |
| _host_and_nonhost_configuration = [ |
| _host_feature, |
| _nonhost_feature, |
| ] |
| |
| _user_compile_flags_feature = feature( |
| name = FEATURE_NAMES.user_compile_flags, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.assemble, |
| ACTION_NAMES.preprocess_assemble, |
| ACTION_NAMES.linkstamp_compile, |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.cpp_header_parsing, |
| ACTION_NAMES.cpp_module_compile, |
| ACTION_NAMES.cpp_module_codegen, |
| ACTION_NAMES.lto_backend, |
| ACTION_NAMES.clif_match, |
| ], |
| flag_groups = [ |
| flag_group( |
| flags = ["%{user_compile_flags}"], |
| iterate_over = "user_compile_flags", |
| expand_if_available = "user_compile_flags", |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _preprocessor_defines_feature = feature( |
| name = FEATURE_NAMES.preprocessor_defines, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.preprocess_assemble, |
| ACTION_NAMES.linkstamp_compile, |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.cpp_header_parsing, |
| ACTION_NAMES.cpp_module_compile, |
| ACTION_NAMES.objc_compile, |
| ACTION_NAMES.objcpp_compile, |
| ACTION_NAMES.clif_match, |
| ], |
| flag_groups = [ |
| flag_group( |
| flags = ["-D%{preprocessor_defines}"], |
| iterate_over = "preprocessor_defines", |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _no_use_lto_indexing_bitcode_file_feature = feature( |
| name = FEATURE_NAMES.no_use_lto_indexing_bitcode_file, |
| ) |
| |
| _use_lto_native_object_directory_feature = feature( |
| name = FEATURE_NAMES.use_lto_native_object_directory, |
| ) |
| _thin_lto_feature = feature( |
| name = FEATURE_NAMES.thin_lto, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.cpp_link_executable, |
| ACTION_NAMES.cpp_link_dynamic_library, |
| ACTION_NAMES.cpp_link_nodeps_dynamic_library, |
| ACTION_NAMES.cpp_link_static_library, |
| ], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "thinlto_param_file", |
| flags = ["thinlto_param_file=%{thinlto_param_file}"], |
| ), |
| ], |
| ), |
| flag_set( |
| actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group(flags = ["-flto=thin"]), |
| flag_group( |
| flags = ["lto_indexing_bitcode=%{lto_indexing_bitcode_file}"], |
| expand_if_available = "lto_indexing_bitcode_file", |
| ), |
| ], |
| ), |
| flag_set( |
| actions = [ |
| ACTION_NAMES.lto_index_for_executable, |
| ACTION_NAMES.lto_index_for_dynamic_library, |
| ACTION_NAMES.lto_index_for_nodeps_dynamic_library, |
| ], |
| flag_groups = [ |
| flag_group( |
| flags = ["--i_come_from_standalone_lto_index=%{user_link_flags}"], |
| iterate_over = "user_link_flags", |
| expand_if_available = "user_link_flags", |
| ), |
| ], |
| ), |
| flag_set( |
| actions = [ACTION_NAMES.lto_indexing], |
| flag_groups = [ |
| flag_group( |
| flags = [ |
| "param_file=%{thinlto_indexing_param_file}", |
| "prefix_replace=%{thinlto_prefix_replace}", |
| ], |
| ), |
| flag_group( |
| flags = ["object_suffix_replace=%{thinlto_object_suffix_replace}"], |
| expand_if_available = "thinlto_object_suffix_replace", |
| ), |
| flag_group( |
| flags = ["thinlto_merged_object_file=%{thinlto_merged_object_file}"], |
| expand_if_available = "thinlto_merged_object_file", |
| ), |
| ], |
| ), |
| flag_set( |
| actions = [ACTION_NAMES.lto_backend], |
| flag_groups = [ |
| flag_group( |
| flags = [ |
| "thinlto_index=%{thinlto_index}", |
| "thinlto_output_object_file=%{thinlto_output_object_file}", |
| "thinlto_input_bitcode_file=%{thinlto_input_bitcode_file}", |
| ], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _simple_thin_lto_feature = feature( |
| name = FEATURE_NAMES.thin_lto, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group( |
| flags = ["<thin_lto>"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _thin_lto_linkstatic_tests_use_shared_nonlto_backends_feature = feature( |
| name = FEATURE_NAMES.thin_lto_linkstatic_tests_use_shared_nonlto_backends, |
| ) |
| |
| _thin_lto_all_linkstatic_use_shared_nonlto_backends_feature = feature( |
| name = FEATURE_NAMES.thin_lto_all_linkstatic_use_shared_nonlto_backends, |
| ) |
| |
| _enable_afdo_thinlto_feature = feature( |
| name = FEATURE_NAMES.enable_afdo_thinlto, |
| requires = [feature_set(features = ["autofdo_implicit_thinlto"])], |
| implies = ["thin_lto"], |
| ) |
| |
| _autofdo_implicit_thinlto_feature = feature(name = FEATURE_NAMES.autofdo_implicit_thinlto) |
| |
| _enable_fdo_thin_lto_feature = feature( |
| name = FEATURE_NAMES.enable_fdo_thinlto, |
| requires = [feature_set(features = ["fdo_implicit_thinlto"])], |
| implies = ["thin_lto"], |
| ) |
| |
| _fdo_implicit_thinlto_feature = feature(name = FEATURE_NAMES.fdo_implicit_thinlto) |
| |
| _enable_xbinaryfdo_thinlto_feature = feature( |
| name = FEATURE_NAMES.enable_xbinaryfdo_thinlto, |
| requires = [feature_set(features = ["xbinaryfdo_implicit_thinlto"])], |
| implies = ["thin_lto"], |
| ) |
| |
| _xbinaryfdo_implicit_thinlto_feature = feature(name = FEATURE_NAMES.xbinaryfdo_implicit_thinlto) |
| |
| # Use a minimal feature so that we can check the right flags are expanded. |
| _memprof_optimize_feature = feature( |
| name = FEATURE_NAMES.memprof_optimize, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.cpp_module_codegen, |
| ], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "memprof_profile_path", |
| flags = [ |
| "-memory-profile-file=%{memprof_profile_path}", |
| ], |
| ), |
| ], |
| ), |
| flag_set( |
| actions = [ |
| ACTION_NAMES.linkstamp_compile, |
| ], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "is_using_memprof", |
| flags = ["-DBUILD_PGHO_TYPE=\"opt\""], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _enable_fdo_memprof_optimize_feature = feature( |
| name = FEATURE_NAMES.enable_fdo_memprof_optimize, |
| requires = [feature_set(features = ["fdo_implicit_memprof_optimize"])], |
| implies = ["memprof_optimize"], |
| ) |
| |
| _fdo_implicit_memprof_optimize_feature = feature( |
| name = FEATURE_NAMES.fdo_implicit_memprof_optimize, |
| ) |
| |
| _enable_autofdo_memprof_optimize_feature = feature( |
| name = FEATURE_NAMES.enable_autofdo_memprof_optimize, |
| requires = [feature_set(features = ["autofdo_implicit_memprof_optimize"])], |
| implies = ["memprof_optimize"], |
| ) |
| |
| _autofdo_implicit_memprof_optimize_feature = feature( |
| name = FEATURE_NAMES.autofdo_implicit_memprof_optimize, |
| ) |
| |
| _split_functions_feature = feature( |
| name = FEATURE_NAMES.split_functions, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.cpp_module_codegen, |
| ACTION_NAMES.lto_backend, |
| ], |
| flag_groups = [ |
| flag_group( |
| flags = [ |
| "-fsplit-machine-functions", |
| "-DBUILD_MFS_ENABLED=1", |
| ], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _enable_fdo_split_functions_feature = feature( |
| name = FEATURE_NAMES.enable_fdo_split_functions, |
| requires = [feature_set(features = ["fdo_split_functions"])], |
| implies = ["split_functions"], |
| ) |
| |
| _fdo_split_functions_feature = feature(name = FEATURE_NAMES.fdo_split_functions) |
| |
| _enable_fsafdo_feature = feature( |
| name = FEATURE_NAMES.enable_fsafdo, |
| requires = [feature_set(features = ["implicit_fsafdo"])], |
| implies = ["fsafdo"], |
| ) |
| |
| _implicit_fsafdo_feature = feature(name = FEATURE_NAMES.implicit_fsafdo) |
| |
| _fsafdo_feature = feature( |
| name = FEATURE_NAMES.fsafdo, |
| requires = [feature_set(features = ["autofdo"])], |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.cpp_module_codegen, |
| ACTION_NAMES.lto_backend, |
| ], |
| flag_groups = [ |
| flag_group( |
| flags = [ |
| "-fsafdo", |
| ], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _native_deps_link_feature = feature( |
| name = FEATURE_NAMES.native_deps_link, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_link_dynamic_library], |
| flag_groups = [flag_group(flags = ["native_deps_link"])], |
| ), |
| ], |
| ) |
| |
| _java_launcher_link_feature = feature( |
| name = FEATURE_NAMES.java_launcher_link, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_link_executable], |
| flag_groups = [flag_group(flags = ["java_launcher_link"])], |
| ), |
| ], |
| ) |
| |
| _py_launcher_link_feature = feature( |
| name = FEATURE_NAMES.py_launcher_link, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_link_executable], |
| flag_groups = [flag_group(flags = ["py_launcher_link"])], |
| ), |
| ], |
| ) |
| |
| _autofdo_feature = feature( |
| name = FEATURE_NAMES.autofdo, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.lto_backend, |
| ], |
| flag_groups = [ |
| flag_group( |
| flags = [ |
| "-fauto-profile=%{fdo_profile_path}", |
| "-fprofile-correction", |
| ], |
| expand_if_available = "fdo_profile_path", |
| ), |
| ], |
| ), |
| ], |
| provides = ["profile"], |
| ) |
| |
| _is_cc_fake_binary_feature = feature(name = FEATURE_NAMES.is_cc_fake_binary) |
| |
| _xbinaryfdo_feature = feature( |
| name = FEATURE_NAMES.xbinaryfdo, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.lto_backend, |
| ], |
| flag_groups = [ |
| flag_group( |
| flags = [ |
| "-fauto-profile=%{fdo_profile_path}", |
| "-fprofile-correction", |
| ], |
| ), |
| ], |
| with_features = [ |
| with_feature_set(not_features = ["is_cc_fake_binary"]), |
| ], |
| ), |
| ], |
| provides = ["profile"], |
| ) |
| |
| _fdo_optimize_feature = feature( |
| name = FEATURE_NAMES.fdo_optimize, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group( |
| flags = [ |
| "-fprofile-use=%{fdo_profile_path}", |
| "-Wno-profile-instr-unprofiled", |
| "-Wno-profile-instr-out-of-date", |
| "-Wno-backend-plugin", |
| "-fprofile-correction", |
| ], |
| expand_if_available = "fdo_profile_path", |
| ), |
| ], |
| ), |
| ], |
| provides = ["profile"], |
| ) |
| |
| _fdo_instrument_feature = feature( |
| name = FEATURE_NAMES.fdo_instrument, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.cpp_link_dynamic_library, |
| ACTION_NAMES.cpp_link_nodeps_dynamic_library, |
| ACTION_NAMES.cpp_link_executable, |
| ], |
| flag_groups = [ |
| flag_group( |
| flags = ["fdo_instrument_option", "path=%{fdo_instrument_path}"], |
| ), |
| ], |
| ), |
| ], |
| provides = ["profile"], |
| ) |
| |
| _per_object_debug_info_feature = feature( |
| name = FEATURE_NAMES.per_object_debug_info, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.assemble, |
| ACTION_NAMES.preprocess_assemble, |
| ACTION_NAMES.cpp_module_codegen, |
| ACTION_NAMES.lto_backend, |
| ], |
| flag_groups = [ |
| flag_group( |
| flags = ["per_object_debug_info_option"], |
| expand_if_available = "per_object_debug_info_file", |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _copy_dynamic_libraries_to_binary_feature = feature( |
| name = FEATURE_NAMES.copy_dynamic_libraries_to_binary, |
| ) |
| |
| _generate_pdb_file_feature = feature( |
| name = FEATURE_NAMES.generate_pdb_file, |
| ) |
| |
| _supports_start_end_lib_feature = feature( |
| name = FEATURE_NAMES.supports_start_end_lib, |
| enabled = True, |
| ) |
| |
| _supports_pic_feature = feature(name = FEATURE_NAMES.supports_pic, enabled = True) |
| |
| _prefer_pic_for_opt_binaries_feature = feature( |
| name = FEATURE_NAMES.prefer_pic_for_opt_binaries, |
| enabled = True, |
| ) |
| |
| _targets_windows_feature = feature( |
| name = FEATURE_NAMES.targets_windows, |
| enabled = True, |
| implies = ["copy_dynamic_libraries_to_binary"], |
| ) |
| |
| _windows_export_all_symbols_feature = feature( |
| name = FEATURE_NAMES.windows_export_all_symbols, |
| ) |
| |
| _archive_param_file_feature = feature( |
| name = FEATURE_NAMES.archive_param_file, |
| ) |
| |
| _compiler_param_file_feature = feature( |
| name = FEATURE_NAMES.compiler_param_file, |
| enabled = True, |
| ) |
| |
| _gcc_quoting_for_param_files_feature = feature( |
| name = FEATURE_NAMES.gcc_quoting_for_param_files, |
| enabled = True, |
| ) |
| |
| _static_link_cpp_runtimes_feature = feature( |
| name = FEATURE_NAMES.static_link_cpp_runtimes, |
| enabled = True, |
| ) |
| |
| _simple_compile_feature = feature( |
| name = FEATURE_NAMES.simple_compile_feature, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group(flags = ["<flag>"]), |
| ], |
| ), |
| ], |
| ) |
| |
| _simple_link_feature = feature( |
| name = FEATURE_NAMES.simple_link_feature, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_link_executable], |
| flag_groups = [ |
| flag_group(flags = ["testlinkopt"]), |
| ], |
| ), |
| ], |
| ) |
| |
| _llvm_profdata_env_feature = feature( |
| name = FEATURE_NAMES.llvm_profdata_env, |
| enabled = True, |
| env_sets = [ |
| env_set( |
| actions = [ACTION_NAMES.llvm_profdata], |
| env_entries = [ |
| env_entry( |
| key = "LLVM_PROFDATA_ENV_KEY", |
| value = "LLVM_PROFDATA_ENV_VALUE", |
| ), |
| ], |
| ), |
| ], |
| ) |
| _dwp_env_feature = feature( |
| name = FEATURE_NAMES.dwp_env, |
| enabled = True, |
| env_sets = [ |
| env_set( |
| actions = [ACTION_NAMES.dwp], |
| env_entries = [ |
| env_entry( |
| key = "DWP_ENV_KEY", |
| value = "DWP_ENV_VALUE", |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _link_env_feature = feature( |
| name = FEATURE_NAMES.link_env, |
| env_sets = [ |
| env_set( |
| actions = [ |
| ACTION_NAMES.cpp_link_static_library, |
| ACTION_NAMES.cpp_link_dynamic_library, |
| ACTION_NAMES.cpp_link_executable, |
| ], |
| env_entries = [ |
| env_entry( |
| key = "foo", |
| value = "bar", |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _static_linking_mode_feature = feature( |
| name = FEATURE_NAMES.static_linking_mode, |
| env_sets = [ |
| env_set( |
| actions = [ACTION_NAMES.cpp_link_executable], |
| env_entries = [ |
| env_entry( |
| key = "linking_mode", |
| value = "static", |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _dynamic_linking_mode_feature = feature( |
| name = FEATURE_NAMES.dynamic_linking_mode, |
| env_sets = [ |
| env_set( |
| actions = [ACTION_NAMES.cpp_link_executable], |
| env_entries = [ |
| env_entry( |
| key = "linking_mode", |
| value = "dynamic", |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _objcopy_embed_flags_feature = feature( |
| name = FEATURE_NAMES.objcopy_embed_flags, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = ["objcopy_embed_data"], |
| flag_groups = [ |
| flag_group(flags = ["-objcopy-flag-1", "foo"]), |
| ], |
| ), |
| ], |
| ) |
| |
| _ld_embed_flags_feature = feature( |
| name = FEATURE_NAMES.ld_embed_flags, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = ["ld_embed_data"], |
| flag_groups = [ |
| flag_group(flags = ["-ld-flag-1", "bar"]), |
| ], |
| ), |
| ], |
| ) |
| |
| _dbg_compilation_feature = feature( |
| name = FEATURE_NAMES.dbg, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group(flags = ["-dbg"]), |
| ], |
| ), |
| ], |
| ) |
| |
| _fastbuild_compilation_feature = feature( |
| name = FEATURE_NAMES.fastbuild, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group(flags = ["-fastbuild"]), |
| ], |
| ), |
| ], |
| ) |
| |
| _opt_compilation_feature = feature( |
| name = FEATURE_NAMES.opt, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group(flags = ["-opt"]), |
| ], |
| ), |
| ], |
| ) |
| |
| _compilation_mode_features = [ |
| _dbg_compilation_feature, |
| _fastbuild_compilation_feature, |
| _opt_compilation_feature, |
| ] |
| |
| _compile_header_modules_feature_configuration = [ |
| _supports_pic_feature, |
| feature(name = "header_modules", implies = ["use_header_modules"]), |
| _module_maps_feature, |
| feature(name = "use_header_modules"), |
| ] |
| |
| _debug_variables_feature = feature( |
| name = FEATURE_NAMES.debug_variables, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.assemble, |
| ACTION_NAMES.preprocess_assemble, |
| ACTION_NAMES.cpp_module_codegen, |
| ACTION_NAMES.lto_backend, |
| ], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "source_file", |
| flags = ["--debug-var:source_file=%{source_file}"], |
| ), |
| flag_group( |
| expand_if_available = "output_file", |
| flags = ["--debug-var:output_file=%{output_file}"], |
| ), |
| flag_group( |
| expand_if_available = "minimum_os_version", |
| flags = ["--debug-var:minimum_os_version=%{minimum_os_version}"], |
| ), |
| flag_group( |
| expand_if_available = "sysroot", |
| flags = ["--debug-var:sysroot=%{sysroot}"], |
| ), |
| flag_group( |
| expand_if_available = "is_using_fission", |
| flags = ["--debug-var:is_using_fission=%{is_using_fission}"], |
| ), |
| flag_group( |
| expand_if_available = "per_object_debug_info_file", |
| flags = ["--debug-var:per_object_debug_info_file=%{per_object_debug_info_file}"], |
| ), |
| flag_group( |
| iterate_over = "user_compile_flags", |
| expand_if_available = "user_compile_flags", |
| flags = ["--debug-var:user_compile_flags=%{user_compile_flags}"], |
| ), |
| flag_group( |
| iterate_over = "legacy_compile_flags", |
| expand_if_available = "legacy_compile_flags", |
| flags = ["--debug-var:legacy_compile_flags=%{legacy_compile_flags}"], |
| ), |
| flag_group( |
| iterate_over = "external_include_paths", |
| expand_if_available = "external_include_paths", |
| flags = ["--debug-var:external_include_paths=%{external_include_paths}"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _fission_flags_for_lto_backend_feature = feature( |
| name = FEATURE_NAMES.fission_flags_for_lto_backend, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.lto_backend], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "is_using_fission", |
| flags = ["-<IS_USING_FISSION>"], |
| ), |
| flag_group( |
| expand_if_available = "per_object_debug_info_file", |
| flags = ["-<PER_OBJECT_DEBUG_INFO_FILE>"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _min_os_version_flag_feature = feature( |
| name = FEATURE_NAMES.min_os_version_flag, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "min_os_version_flag", |
| flags = ["-DMIN_OS=%{minimum_os_version}"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _include_directories_feature = feature( |
| name = FEATURE_NAMES.include_directories, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group( |
| flags = [ |
| "-isysteminclude_1", |
| "-isystem", |
| "-include_2", |
| "-iquoteinclude_2", |
| "-Iinclude_3", |
| ], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _external_include_paths_feature = feature( |
| name = FEATURE_NAMES.external_include_paths, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "external_include_paths", |
| flags = [ |
| "-isystem", |
| "%{external_include_paths}", |
| ], |
| iterate_over = "external_include_paths", |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _from_package_feature = feature( |
| name = FEATURE_NAMES.from_package, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.c_compile], |
| flag_groups = [ |
| flag_group(flags = ["<flag>"]), |
| ], |
| ), |
| ], |
| ) |
| |
| _absolute_path_directories_feature = feature( |
| name = FEATURE_NAMES.absolute_path_directories, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group( |
| flags = [ |
| "-isystem", |
| "/some/absolute/path/subdir", |
| ], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _change_tool_feature = feature( |
| name = FEATURE_NAMES.change_tool, |
| ) |
| |
| _module_map_without_extern_module_feature = feature( |
| name = FEATURE_NAMES.module_map_without_extern_module, |
| ) |
| |
| _generate_submodules_feature = feature( |
| name = FEATURE_NAMES.generate_submodules, |
| ) |
| |
| _multiple_tools_action_config = action_config( |
| action_name = ACTION_NAMES.cpp_compile, |
| tools = [ |
| tool( |
| path = "SPECIAL_TOOL", |
| with_features = [ |
| with_feature_set(features = [FEATURE_NAMES.change_tool]), |
| ], |
| ), |
| tool(path = "DEFAULT_TOOL"), |
| ], |
| ) |
| |
| _cpp_compile_with_requirements_action_config = action_config( |
| action_name = "yolo_action_with_requirements", |
| tools = [ |
| tool( |
| path = "yolo_tool", |
| execution_requirements = ["requires-yolo"], |
| ), |
| ], |
| ) |
| |
| _foo_feature = feature( |
| name = FEATURE_NAMES.foo, |
| ) |
| |
| _check_additional_variables_feature = feature( |
| name = FEATURE_NAMES.check_additional_variables, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "string_variable", |
| flags = ["--my_string=%{string_variable}"], |
| ), |
| flag_group( |
| expand_if_available = "list_variable", |
| iterate_over = "list_variable", |
| flags = ["--my_list_element=%{list_variable}"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _library_search_directories_feature = feature( |
| name = FEATURE_NAMES.library_search_directories, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_link_executable], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "library_search_directories", |
| iterate_over = "library_search_directories", |
| flags = ["--library=%{library_search_directories}"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _runtime_library_search_directories_feature = feature( |
| name = FEATURE_NAMES.runtime_library_search_directories, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_link_executable], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "runtime_library_search_directories", |
| iterate_over = "runtime_library_search_directories", |
| flags = ["--runtime_library=%{runtime_library_search_directories}"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _uses_ifso_variables_feature = feature( |
| name = FEATURE_NAMES.uses_ifso_variables, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.cpp_link_dynamic_library, |
| ACTION_NAMES.cpp_link_nodeps_dynamic_library, |
| ACTION_NAMES.cpp_link_static_library, |
| "lto-index-for-executable", |
| "lto-index-for-dynamic-library", |
| "lto-index-for-nodeps-dynamic-library", |
| ], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "generate_interface_library", |
| flags = ["--generate-interface-library=%{generate_interface_library}"], |
| ), |
| flag_group( |
| expand_if_available = "interface_library_builder_path", |
| flags = ["--interface-library-builder=%{interface_library_builder_path}"], |
| ), |
| flag_group( |
| expand_if_available = "interface_library_input_path", |
| flags = ["--interface-library-input=%{interface_library_input_path}"], |
| ), |
| flag_group( |
| expand_if_available = "interface_library_output_path", |
| flags = ["--interface-library-output=%{interface_library_output_path}"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _uses_output_execpath_feature = feature( |
| name = FEATURE_NAMES.uses_output_execpath, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.cpp_link_dynamic_library, |
| ACTION_NAMES.cpp_link_nodeps_dynamic_library, |
| ACTION_NAMES.cpp_link_executable, |
| "lto-index-for-executable", |
| "lto-index-for-dynamic-library", |
| "lto-index-for-nodeps-dynamic-library", |
| ], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "output_execpath", |
| flags = ["--output-execpath=%{output_execpath}"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _uses_is_cc_test_feature = feature( |
| name = FEATURE_NAMES.uses_is_cc_test, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.cpp_link_executable, |
| ], |
| flag_groups = [ |
| flag_group( |
| expand_if_true = "is_cc_test", |
| flags = ["--linkopt-is-cc-test"], |
| ), |
| flag_group( |
| expand_if_false = "is_cc_test", |
| flags = ["--linkopt-is-not-cc-test"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _uses_strip_debug_symbols_feature = feature( |
| name = FEATURE_NAMES.uses_strip_debug_symbols, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.cpp_link_executable, |
| ], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "strip_debug_symbols", |
| flags = ["--strip-debug-symbols"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _uses_is_using_fission_feature = feature( |
| name = FEATURE_NAMES.uses_is_using_fission, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.cpp_link_executable, |
| ], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "is_using_fission", |
| flags = ["--is-using-fission"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _uses_sysroot_feature = feature( |
| name = FEATURE_NAMES.uses_sysroot, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.cpp_link_executable, |
| ], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "sysroot", |
| flags = ["--sysroot=%{sysroot}"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _uses_user_link_flags_feature = feature( |
| name = FEATURE_NAMES.uses_user_link_flags, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.cpp_link_executable, |
| ], |
| flag_groups = [ |
| flag_group( |
| iterate_over = "user_link_flags", |
| expand_if_available = "user_link_flags", |
| flags = ["%{user_link_flags}"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _uses_whole_archive_feature = feature( |
| name = FEATURE_NAMES.uses_whole_archive, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.cpp_link_executable, |
| ACTION_NAMES.cpp_link_dynamic_library, |
| ACTION_NAMES.cpp_link_nodeps_dynamic_library, |
| ], |
| flag_groups = [ |
| flag_group( |
| flag_groups = [ |
| flag_group( |
| expand_if_true = "libraries_to_link.is_whole_archive", |
| flags = ["-Wl,-whole-archive"], |
| ), |
| flag_group( |
| flags = ["%{libraries_to_link.object_files}"], |
| iterate_over = "libraries_to_link.object_files", |
| expand_if_equal = variable_with_value( |
| name = "libraries_to_link.type", |
| value = "static_library", |
| ), |
| ), |
| flag_group( |
| expand_if_true = "libraries_to_link.is_whole_archive", |
| flags = ["-Wl,-nowhole-archive"], |
| ), |
| ], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _def_feature = feature( |
| name = FEATURE_NAMES.def_feature, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_link_executable], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "def_file_path", |
| flags = ["-qux_%{def_file_path}"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _strip_debug_symbols_feature = feature( |
| name = FEATURE_NAMES.strip_debug_symbols, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_link_executable], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "strip_debug_symbols", |
| flags = ["-strip_stuff"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _proto_disable_services_feature = feature(name = "proto_disable_services") |
| _proto_force_lite_runtime_feature = feature(name = "proto_force_lite_runtime", implies = ["proto_disable_services"]) |
| _proto_one_output_per_message_feature = feature(name = "proto_one_output_per_message", implies = ["proto_force_lite_runtime"]) |
| |
| _portable_overrides_configuration = [ |
| _proto_force_lite_runtime_feature, |
| _proto_disable_services_feature, |
| _proto_one_output_per_message_feature, |
| feature( |
| name = "proto_enable_portable_overrides", |
| implies = [ |
| "proto_force_lite_runtime", |
| "proto_disable_services", |
| "proto_one_output_per_message", |
| ], |
| ), |
| ] |
| |
| _disable_whole_archive_for_static_lib_configuration = [ |
| feature(name = "disable_whole_archive_for_static_lib"), |
| ] |
| |
| _same_symbol_provided_configuration = [ |
| feature(name = "a1", provides = ["a"]), |
| feature(name = "a2", provides = ["a"]), |
| ] |
| |
| _optional_cc_flags_feature = feature( |
| name = FEATURE_NAMES.optional_cc_flags_feature, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cc_flags_make_variable], |
| flag_groups = [ |
| flag_group(flags = ["optional_feature_flag"]), |
| ], |
| ), |
| ], |
| ) |
| |
| _layering_check_module_maps_header_modules_simple_features = [ |
| feature( |
| name = FEATURE_NAMES.module_maps, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group(flags = ["<maps>"]), |
| ], |
| ), |
| ], |
| ), |
| feature( |
| name = FEATURE_NAMES.layering_check, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group(flags = ["<layering>"]), |
| ], |
| ), |
| ], |
| ), |
| feature( |
| name = FEATURE_NAMES.header_modules, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_compile], |
| flag_groups = [ |
| flag_group(flags = ["<modules>"]), |
| ], |
| ), |
| ], |
| ), |
| ] |
| |
| _generate_linkmap_feature = feature( |
| name = FEATURE_NAMES.generate_linkmap, |
| flag_sets = [ |
| flag_set( |
| actions = [ACTION_NAMES.cpp_link_executable], |
| flag_groups = [ |
| flag_group( |
| flags = ["-linkmap=%{output_execpath}.map"], |
| expand_if_available = "output_execpath", |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _no_dotd_file_feature = feature(name = FEATURE_NAMES.no_dotd_file) |
| |
| _force_pic_flags_feature = feature( |
| name = FEATURE_NAMES.force_pic_flags, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.cpp_link_executable, |
| ACTION_NAMES.cpp_link_dynamic_library, |
| ACTION_NAMES.cpp_link_nodeps_dynamic_library, |
| ], |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "force_pic", |
| flags = ["--force-pic-flag"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _libraries_to_link_feature = feature( |
| name = FEATURE_NAMES.libraries_to_link, |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.cpp_link_executable, |
| ACTION_NAMES.cpp_link_dynamic_library, |
| ACTION_NAMES.cpp_link_nodeps_dynamic_library, |
| ], |
| flag_groups = [ |
| flag_group( |
| iterate_over = "libraries_to_link", |
| flag_groups = [ |
| flag_group( |
| expand_if_equal = variable_with_value( |
| name = "libraries_to_link.type", |
| value = "object_file", |
| ), |
| flags = ["--library-to-link=%{libraries_to_link.name}"], |
| ), |
| flag_group( |
| expand_if_equal = variable_with_value( |
| name = "libraries_to_link.type", |
| value = "dynamic_library", |
| ), |
| flags = ["--library-to-link=%{libraries_to_link.name}"], |
| ), |
| flag_group( |
| expand_if_equal = variable_with_value( |
| name = "libraries_to_link.type", |
| value = "versioned_dynamic_library", |
| ), |
| flags = ["--library-to-link=%{libraries_to_link.name}"], |
| ), |
| flag_group( |
| expand_if_equal = variable_with_value( |
| name = "libraries_to_link.type", |
| value = "static_library", |
| ), |
| flags = ["--library-to-link=%{libraries_to_link.name}"], |
| ), |
| flag_group( |
| expand_if_equal = variable_with_value( |
| name = "libraries_to_link.type", |
| value = "object_file_group", |
| ), |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "libraries_to_link.object_files", |
| iterate_over = "libraries_to_link.object_files", |
| flags = ["--object-file-to-link=%{libraries_to_link.object_files}"], |
| ), |
| ], |
| ), |
| ], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _disable_cpp_link_path_mapping_feature = feature( |
| name = FEATURE_NAMES.disable_cpp_link_path_mapping, |
| enabled = False, |
| ) |
| |
| _propeller_optimize_feature = feature( |
| name = FEATURE_NAMES.propeller_optimize, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.lto_backend, |
| ], |
| flag_groups = [flag_group( |
| expand_if_available = "propeller_optimize_cc_path", |
| flags = [ |
| "-fbasic-block-sections=list=%{propeller_optimize_cc_path}", |
| "-DBUILD_PROPELLER_ENABLED=1", |
| ], |
| )], |
| ), |
| flag_set( |
| actions = [ACTION_NAMES.cpp_link_executable], |
| flag_groups = [flag_group( |
| expand_if_true = "propeller_optimize_ld_path", |
| flags = ["-Wl,--symbol-ordering-file=%{propeller_optimize_ld_path}"], |
| )], |
| ), |
| ], |
| ) |
| |
| _propeller_optimize_thinlto_compile_actions_feature = feature( |
| name = FEATURE_NAMES.propeller_optimize_thinlto_compile_actions, |
| ) |
| _fdo_prefetch_hints_feature = feature( |
| name = FEATURE_NAMES.fdo_prefetch_hints, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.c_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.lto_backend, |
| ], |
| flag_groups = [ |
| flag_group( |
| flags = [ |
| "-mllvm", |
| "-prefetch-hints-file=%{fdo_prefetch_hints_path}", |
| ], |
| expand_if_available = "fdo_prefetch_hints_path", |
| ), |
| ], |
| ), |
| ], |
| ) |
| _feature_name_to_feature = { |
| FEATURE_NAMES.force_pic_flags: _force_pic_flags_feature, |
| FEATURE_NAMES.libraries_to_link: _libraries_to_link_feature, |
| FEATURE_NAMES.fdo_prefetch_hints: _fdo_prefetch_hints_feature, |
| FEATURE_NAMES.propeller_optimize: _propeller_optimize_feature, |
| FEATURE_NAMES.propeller_optimize_thinlto_compile_actions: _propeller_optimize_thinlto_compile_actions_feature, |
| FEATURE_NAMES.cpp_modules: _cpp_modules_feature, |
| FEATURE_NAMES.no_legacy_features: _no_legacy_features_feature, |
| FEATURE_NAMES.do_not_split_linking_cmdline: _do_not_split_linking_cmdline_feature, |
| FEATURE_NAMES.supports_dynamic_linker: _supports_dynamic_linker_feature, |
| FEATURE_NAMES.supports_interface_shared_libraries: _supports_interface_shared_libraries_feature, |
| FEATURE_NAMES.pic: _pic_feature, |
| FEATURE_NAMES.define_with_space: _define_with_space, |
| FEATURE_NAMES.parse_headers: _parse_headers_feature, |
| FEATURE_NAMES.layering_check: _layering_check_feature, |
| FEATURE_NAMES.module_map_home_cwd: _module_map_home_cwd_feature, |
| FEATURE_NAMES.user_compile_flags: _user_compile_flags_feature, |
| FEATURE_NAMES.thin_lto: _thin_lto_feature, |
| FEATURE_NAMES.no_use_lto_indexing_bitcode_file: _no_use_lto_indexing_bitcode_file_feature, |
| FEATURE_NAMES.use_lto_native_object_directory: _use_lto_native_object_directory_feature, |
| FEATURE_NAMES.thin_lto_linkstatic_tests_use_shared_nonlto_backends: _thin_lto_linkstatic_tests_use_shared_nonlto_backends_feature, |
| FEATURE_NAMES.thin_lto_all_linkstatic_use_shared_nonlto_backends: _thin_lto_all_linkstatic_use_shared_nonlto_backends_feature, |
| FEATURE_NAMES.enable_afdo_thinlto: _enable_afdo_thinlto_feature, |
| FEATURE_NAMES.autofdo_implicit_thinlto: _autofdo_implicit_thinlto_feature, |
| FEATURE_NAMES.enable_fdo_thinlto: _enable_fdo_thin_lto_feature, |
| FEATURE_NAMES.fdo_implicit_thinlto: _fdo_implicit_thinlto_feature, |
| FEATURE_NAMES.split_functions: _split_functions_feature, |
| FEATURE_NAMES.enable_fdo_split_functions: _enable_fdo_split_functions_feature, |
| FEATURE_NAMES.fdo_split_functions: _fdo_split_functions_feature, |
| FEATURE_NAMES.enable_xbinaryfdo_thinlto: _enable_xbinaryfdo_thinlto_feature, |
| FEATURE_NAMES.xbinaryfdo_implicit_thinlto: _xbinaryfdo_implicit_thinlto_feature, |
| FEATURE_NAMES.memprof_optimize: _memprof_optimize_feature, |
| FEATURE_NAMES.enable_fdo_memprof_optimize: _enable_fdo_memprof_optimize_feature, |
| FEATURE_NAMES.fdo_implicit_memprof_optimize: _fdo_implicit_memprof_optimize_feature, |
| FEATURE_NAMES.enable_autofdo_memprof_optimize: _enable_autofdo_memprof_optimize_feature, |
| FEATURE_NAMES.autofdo_implicit_memprof_optimize: _autofdo_implicit_memprof_optimize_feature, |
| FEATURE_NAMES.fsafdo: _fsafdo_feature, |
| FEATURE_NAMES.implicit_fsafdo: _implicit_fsafdo_feature, |
| FEATURE_NAMES.enable_fsafdo: _enable_fsafdo_feature, |
| FEATURE_NAMES.native_deps_link: _native_deps_link_feature, |
| FEATURE_NAMES.java_launcher_link: _java_launcher_link_feature, |
| FEATURE_NAMES.py_launcher_link: _py_launcher_link_feature, |
| FEATURE_NAMES.autofdo: _autofdo_feature, |
| FEATURE_NAMES.is_cc_fake_binary: _is_cc_fake_binary_feature, |
| FEATURE_NAMES.xbinaryfdo: _xbinaryfdo_feature, |
| FEATURE_NAMES.fdo_optimize: _fdo_optimize_feature, |
| FEATURE_NAMES.fdo_instrument: _fdo_instrument_feature, |
| FEATURE_NAMES.per_object_debug_info: _per_object_debug_info_feature, |
| FEATURE_NAMES.copy_dynamic_libraries_to_binary: _copy_dynamic_libraries_to_binary_feature, |
| FEATURE_NAMES.supports_start_end_lib: _supports_start_end_lib_feature, |
| FEATURE_NAMES.supports_pic: _supports_pic_feature, |
| FEATURE_NAMES.prefer_pic_for_opt_binaries: _prefer_pic_for_opt_binaries_feature, |
| FEATURE_NAMES.targets_windows: _targets_windows_feature, |
| FEATURE_NAMES.windows_export_all_symbols: _windows_export_all_symbols_feature, |
| FEATURE_NAMES.archive_param_file: _archive_param_file_feature, |
| FEATURE_NAMES.compiler_param_file: _compiler_param_file_feature, |
| FEATURE_NAMES.gcc_quoting_for_param_files: _gcc_quoting_for_param_files_feature, |
| FEATURE_NAMES.module_maps: _module_maps_feature, |
| FEATURE_NAMES.static_link_cpp_runtimes: _static_link_cpp_runtimes_feature, |
| FEATURE_NAMES.simple_compile_feature: _simple_compile_feature, |
| FEATURE_NAMES.simple_link_feature: _simple_link_feature, |
| FEATURE_NAMES.link_env: _link_env_feature, |
| FEATURE_NAMES.llvm_profdata_env: _llvm_profdata_env_feature, |
| FEATURE_NAMES.dwp_env: _dwp_env_feature, |
| FEATURE_NAMES.static_linking_mode: _static_linking_mode_feature, |
| FEATURE_NAMES.dynamic_linking_mode: _dynamic_linking_mode_feature, |
| FEATURE_NAMES.objcopy_embed_flags: _objcopy_embed_flags_feature, |
| FEATURE_NAMES.ld_embed_flags: _ld_embed_flags_feature, |
| FEATURE_NAMES.fission_flags_for_lto_backend: _fission_flags_for_lto_backend_feature, |
| FEATURE_NAMES.min_os_version_flag: _min_os_version_flag_feature, |
| FEATURE_NAMES.include_directories: _include_directories_feature, |
| FEATURE_NAMES.external_include_paths: _external_include_paths_feature, |
| FEATURE_NAMES.from_package: _from_package_feature, |
| FEATURE_NAMES.absolute_path_directories: _absolute_path_directories_feature, |
| FEATURE_NAMES.change_tool: _change_tool_feature, |
| FEATURE_NAMES.module_map_without_extern_module: _module_map_without_extern_module_feature, |
| FEATURE_NAMES.foo: _foo_feature, |
| FEATURE_NAMES.check_additional_variables: _check_additional_variables_feature, |
| FEATURE_NAMES.library_search_directories: _library_search_directories_feature, |
| FEATURE_NAMES.runtime_library_search_directories: _runtime_library_search_directories_feature, |
| FEATURE_NAMES.generate_submodules: _generate_submodules_feature, |
| FEATURE_NAMES.uses_ifso_variables: _uses_ifso_variables_feature, |
| FEATURE_NAMES.uses_output_execpath: _uses_output_execpath_feature, |
| FEATURE_NAMES.uses_is_cc_test: _uses_is_cc_test_feature, |
| FEATURE_NAMES.uses_strip_debug_symbols: _uses_strip_debug_symbols_feature, |
| FEATURE_NAMES.uses_is_using_fission: _uses_is_using_fission_feature, |
| FEATURE_NAMES.uses_sysroot: _uses_sysroot_feature, |
| FEATURE_NAMES.uses_user_link_flags: _uses_user_link_flags_feature, |
| FEATURE_NAMES.uses_whole_archive: _uses_whole_archive_feature, |
| FEATURE_NAMES.def_feature: _def_feature, |
| FEATURE_NAMES.strip_debug_symbols: _strip_debug_symbols_feature, |
| FEATURE_NAMES.disable_pbh: _disable_pbh_feature, |
| FEATURE_NAMES.no_copts_tokenization: _no_copts_tokenization_feature, |
| FEATURE_NAMES.optional_cc_flags_feature: _optional_cc_flags_feature, |
| FEATURE_NAMES.cpp_compile_with_requirements: _cpp_compile_with_requirements, |
| FEATURE_NAMES.generate_pdb_file: _generate_pdb_file_feature, |
| FEATURE_NAMES.generate_linkmap: _generate_linkmap_feature, |
| FEATURE_NAMES.shorten_virtual_includes: _shorten_virtual_includes_feature, |
| FEATURE_NAMES.preprocessor_defines: _preprocessor_defines_feature, |
| FEATURE_NAMES.skip_virtual_includes: _skip_virtual_includes_feature, |
| FEATURE_NAMES.no_dotd_file: _no_dotd_file_feature, |
| "header_modules_feature_configuration": _header_modules_feature_configuration, |
| "env_var_feature_configuration": _env_var_feature_configuration, |
| "host_and_nonhost_configuration": _host_and_nonhost_configuration, |
| "simple_layering_check": _simple_layering_check_feature, |
| "compilation_mode_features": _compilation_mode_features, |
| "compile_header_modules": _compile_header_modules_feature_configuration, |
| "simple_module_maps": _simple_module_maps_feature, |
| "simple_header_modules": _simple_header_modules_feature, |
| "portable_overrides_configuration": _portable_overrides_configuration, |
| "proto_force_lite_runtime": _proto_force_lite_runtime_feature, |
| "proto_disable_services": _proto_disable_services_feature, |
| "proto_one_output_per_message": _proto_one_output_per_message_feature, |
| "disable_whole_archive_for_static_lib_configuration": _disable_whole_archive_for_static_lib_configuration, |
| "same_symbol_provided_configuration": _same_symbol_provided_configuration, |
| "simple_thin_lto": _simple_thin_lto_feature, |
| "extra_implies_module_maps": _extra_implies_module_maps_feature, |
| "layering_check_module_maps_header_modules_simple_features": _layering_check_module_maps_header_modules_simple_features, |
| FEATURE_NAMES.env_feature: _env_feature, |
| FEATURE_NAMES.static_env_feature: _static_env_feature, |
| FEATURE_NAMES.debug_variables: _debug_variables_feature, |
| FEATURE_NAMES.disable_cpp_link_path_mapping: _disable_cpp_link_path_mapping_feature, |
| } |
| |
| _cc_flags_action_config_foo_bar_baz_config = action_config( |
| action_name = "cc-flags-make-variable", |
| flag_sets = [ |
| flag_set( |
| flag_groups = [ |
| flag_group( |
| flags = ["foo", "bar", "baz"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _sysroot_in_action_config = action_config( |
| action_name = "cc-flags-make-variable", |
| flag_sets = [ |
| flag_set( |
| flag_groups = [ |
| flag_group( |
| expand_if_available = "sysroot", |
| flags = ["fc-start", "--sysroot=%{sysroot}-from-feature", "fc-end"], |
| ), |
| ], |
| ), |
| ], |
| ) |
| |
| _action_name_to_action = { |
| "cc_flags_action_config_foo_bar_baz": _cc_flags_action_config_foo_bar_baz_config, |
| "sysroot_in_action_config": _sysroot_in_action_config, |
| } |
| |
| _tool_for_action_config = { |
| "generate-def-file": "def_parser_tool", |
| "objcopy_embed_data": "objcopy_embed_data_tool", |
| "ld_embed_data": "ld_embed_data_tool", |
| } |
| |
| def _get_features_for_configuration(name): |
| f = _feature_name_to_feature[name] |
| if f == None: |
| fail("Feature not defined: " + name) |
| if type(f) == type([]): |
| return f |
| else: |
| return [f] |
| |
| def _flatten_nested_lists(elements): |
| # Sometimes a feature list may contain lists of features. |
| # Use this to flatten it into a single list of features. |
| result = [] |
| for element in elements: |
| if type(element) == type([]): |
| result.extend(element) |
| else: |
| result.append(element) |
| return result |
| |
| def _get_action_config(name, path): |
| return action_config( |
| action_name = name, |
| enabled = True, |
| tools = [tool(path = path)], |
| ) |
| |
| def _get_artifact_name_pattern(category, prefix, extension): |
| return artifact_name_pattern( |
| category_name = category, |
| prefix = prefix, |
| extension = extension, |
| ) |
| |
| def _get_tool_path(name, path): |
| return tool_path(name = name, path = path) |
| |
| def _impl(ctx): |
| toolchain_identifier = ctx.attr.toolchain_identifier |
| host_system_name = ctx.attr.host_system_name |
| target_system_name = ctx.attr.target_system_name |
| target_cpu = ctx.attr.cpu |
| target_libc = ctx.attr.target_libc |
| compiler = ctx.attr.compiler |
| abi_version = ctx.attr.abi_version |
| abi_libc_version = ctx.attr.abi_libc_version |
| cc_target_os = ctx.attr.cc_target_os if ctx.attr.cc_target_os != "" else None |
| builtin_sysroot = ctx.attr.builtin_sysroot if ctx.attr.builtin_sysroot != "" else None |
| |
| all_link_actions = [ |
| ACTION_NAMES.cpp_link_executable, |
| ACTION_NAMES.cpp_link_dynamic_library, |
| ACTION_NAMES.cpp_link_nodeps_dynamic_library, |
| ] |
| |
| default_compile_flags_feature = feature( |
| name = "default_compile_flags", |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = [ |
| ACTION_NAMES.linkstamp_compile, |
| ACTION_NAMES.cpp_compile, |
| ACTION_NAMES.cpp_header_parsing, |
| ACTION_NAMES.cpp_module_compile, |
| ACTION_NAMES.cpp_module_codegen, |
| ACTION_NAMES.lto_backend, |
| ACTION_NAMES.clif_match, |
| ], |
| flag_groups = [flag_group(flags = ["--default-compile-flag"])], |
| ), |
| ], |
| ) |
| |
| default_link_flags_feature = feature( |
| name = "default_link_flags", |
| enabled = True, |
| flag_sets = [ |
| flag_set( |
| actions = all_link_actions, |
| flag_groups = [flag_group(flags = ["-ldefault-link-flag"])], |
| ), |
| ], |
| ) |
| |
| sanitize_pwd_feature = feature( |
| name = "sanitize_pwd", |
| enabled = True, |
| env_sets = [env_set( |
| actions = [ |
| ACTION_NAMES.cpp_link_executable, |
| ACTION_NAMES.cpp_link_dynamic_library, |
| ACTION_NAMES.cpp_link_nodeps_dynamic_library, |
| ACTION_NAMES.cpp_link_static_library, |
| ACTION_NAMES.lto_index_for_executable, |
| ACTION_NAMES.lto_index_for_dynamic_library, |
| ACTION_NAMES.lto_index_for_nodeps_dynamic_library, |
| ACTION_NAMES.objc_executable, |
| ACTION_NAMES.objc_fully_link, |
| ACTION_NAMES.objcpp_executable, |
| ], |
| env_entries = [env_entry( |
| key = "PWD", |
| value = "/proc/self/cwd", |
| )], |
| )] if ctx.attr.target_libc != "macosx" else [], |
| ) |
| |
| hard_coded_default_features = [ |
| default_compile_flags_feature, |
| default_link_flags_feature, |
| sanitize_pwd_feature, |
| ] |
| cmdline_registered_features = [] |
| for f in ctx.attr._with_features[BuildSettingInfo].value: |
| feature_or_list = _feature_name_to_feature[f] |
| if type(feature_or_list) == type([]): |
| cmdline_registered_features.extend(feature_or_list) |
| else: |
| cmdline_registered_features.append(feature_or_list) |
| features = hard_coded_default_features + cmdline_registered_features |
| |
| should_add_multiple_tools_action_config = False |
| should_add_requirements = False |
| |
| for name in ctx.attr.feature_names: |
| if name == FEATURE_NAMES.change_tool: |
| should_add_multiple_tools_action_config = True |
| if name == FEATURE_NAMES.cpp_compile_with_requirements: |
| should_add_requirements = True |
| |
| features.extend(_get_features_for_configuration(name)) |
| |
| unique_features = [] |
| for f in features: |
| if f not in unique_features: |
| unique_features.append(f) |
| features = unique_features |
| |
| cxx_builtin_include_directories = ["/usr/lib/gcc/", "/usr/local/include", "/usr/include"] |
| |
| for directory in ctx.attr.cxx_builtin_include_directories: |
| cxx_builtin_include_directories.append(directory) |
| |
| artifact_name_patterns = [] |
| |
| for category, values in ctx.attr.artifact_name_patterns.items(): |
| artifact_name_patterns.append(_get_artifact_name_pattern(category, values[0], values[1])) |
| |
| action_configs = [] |
| |
| for name in ctx.attr.action_configs + ctx.attr._with_action_configs[BuildSettingInfo].value: |
| custom_config = _action_name_to_action.get(name, None) |
| if custom_config != None: |
| action_configs.append(custom_config) |
| else: |
| action_configs.append( |
| _get_action_config(name, _tool_for_action_config.get(name, "DUMMY_TOOL")), |
| ) |
| if should_add_multiple_tools_action_config: |
| action_configs.append(_multiple_tools_action_config) |
| |
| if should_add_requirements: |
| action_configs.append(_cpp_compile_with_requirements_action_config) |
| |
| make_variables = [ |
| make_variable(name = name, value = value) |
| for name, value in ctx.attr.make_variables.items() |
| ] |
| |
| if ctx.attr.tool_paths == {}: |
| tool_paths = [ |
| tool_path(name = "ar", path = "/usr/bin/mock-ar"), |
| tool_path(name = "cpp", path = "/usr/bin/mock-cpp"), |
| tool_path(name = "dwp", path = "/usr/bin/mock-dwp"), |
| tool_path(name = "gcc", path = "/usr/bin/mock-gcc"), |
| tool_path(name = "gcov", path = "/usr/bin/mock-gcov"), |
| tool_path(name = "llvm-cov", path = "/usr/bin/mock-llvm-cov"), |
| tool_path(name = "ld", path = "/usr/bin/mock-ld"), |
| tool_path(name = "nm", path = "/usr/bin/mock-nm"), |
| tool_path(name = "objcopy", path = "/usr/bin/mock-objcopy"), |
| tool_path(name = "objdump", path = "/usr/bin/mock-objdump"), |
| tool_path(name = "strip", path = "/usr/bin/mock-strip"), |
| tool_path( |
| name = "llvm-profdata", |
| path = "/usr/bin/mock-llvm-profdata", |
| ), |
| ] |
| else: |
| tool_paths = [_get_tool_path(name, path) for name, path in ctx.attr.tool_paths.items()] |
| |
| out = ctx.actions.declare_file(ctx.label.name) |
| ctx.actions.write(out, "Fake executable") |
| features = _flatten_nested_lists(features) |
| return [ |
| cc_common.create_cc_toolchain_config_info( |
| ctx = ctx, |
| features = features, |
| action_configs = action_configs, |
| artifact_name_patterns = artifact_name_patterns, |
| cxx_builtin_include_directories = cxx_builtin_include_directories, |
| toolchain_identifier = toolchain_identifier, |
| host_system_name = host_system_name, |
| target_system_name = target_system_name, |
| target_cpu = target_cpu, |
| target_libc = target_libc, |
| compiler = compiler, |
| abi_version = abi_version, |
| abi_libc_version = abi_libc_version, |
| tool_paths = tool_paths, |
| make_variables = make_variables, |
| builtin_sysroot = builtin_sysroot, |
| cc_target_os = cc_target_os, |
| ), |
| DefaultInfo( |
| executable = out, |
| ), |
| ] |
| |
| cc_toolchain_config = rule( |
| implementation = _impl, |
| attrs = { |
| "cpu": attr.string(default = "k8"), |
| "compiler": attr.string(default = "compiler"), |
| "toolchain_identifier": attr.string(default = "mock-llvm-toolchain-k8"), |
| "host_system_name": attr.string(default = "local"), |
| "target_system_name": attr.string(default = "local"), |
| "target_libc": attr.string(default = "local"), |
| "abi_version": attr.string(default = "local"), |
| "abi_libc_version": attr.string(default = "local"), |
| "feature_names": attr.string_list(), |
| "action_configs": attr.string_list(), |
| "artifact_name_patterns": attr.string_list_dict(), |
| "cc_target_os": attr.string(), |
| "builtin_sysroot": attr.string(default = "/usr/grte/v1"), |
| "tool_paths": attr.string_dict(), |
| "cxx_builtin_include_directories": attr.string_list(), |
| "make_variables": attr.string_dict(), |
| "_with_features": attr.label(default = Label("//tests/cc/testutil/toolchains:with_features")), |
| "_with_action_configs": attr.label(default = Label("//tests/cc/testutil/toolchains:with_action_configs")), |
| }, |
| provides = [CcToolchainConfigInfo], |
| executable = True, |
| ) |