diff options
author | Googler <msta@google.com> | 2024-04-18 15:46:31 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-04-18 15:47:16 -0700 |
commit | f88663dc502aacb6a6f377030d0652309412c8a9 (patch) | |
tree | 5e3af46c64e2e9da71dbad95a4cbfcf852ca6af1 | |
parent | 6e490f79ee52b97ab5da9315e3ff9bf3e80aa5f2 (diff) | |
download | bazelbuild-rules_cc-upstream-main.tar.gz |
Provide a default toolchain_identifier.upstream-main
BEGIN_PUBLIC
Provide a default toolchain_identifier.
END_PUBLIC
PiperOrigin-RevId: 626172528
Change-Id: I2d23d79b82f4268b462dac79edc4f69a7f865e00
-rw-r--r-- | cc/toolchains/impl/toolchain_config.bzl | 6 | ||||
-rw-r--r-- | tests/rule_based_toolchain/toolchain_config/BUILD | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/cc/toolchains/impl/toolchain_config.bzl b/cc/toolchains/impl/toolchain_config.bzl index 37e5959..dde94f2 100644 --- a/cc/toolchains/impl/toolchain_config.bzl +++ b/cc/toolchains/impl/toolchain_config.bzl @@ -71,7 +71,10 @@ def _cc_toolchain_config_impl(ctx): action_configs = legacy.action_configs, features = legacy.features, cxx_builtin_include_directories = ctx.attr.cxx_builtin_include_directories, - toolchain_identifier = ctx.attr.toolchain_identifier, + # toolchain_identifier is deprecated, but setting it to None results + # in an error that it expected a string, and for safety's sake, I'd + # prefer to provide something unique. + toolchain_identifier = str(ctx.label), target_system_name = ctx.attr.target_system_name, target_cpu = ctx.attr.target_cpu, target_libc = ctx.attr.target_libc, @@ -105,7 +108,6 @@ cc_toolchain_config = rule( # TODO: Consider making this into a label_list that takes a # cc_directory_marker rule as input. "cxx_builtin_include_directories": attr.string_list(), - "toolchain_identifier": attr.string(mandatory = True), "target_system_name": attr.string(mandatory = True), "target_cpu": attr.string(mandatory = True), "target_libc": attr.string(mandatory = True), diff --git a/tests/rule_based_toolchain/toolchain_config/BUILD b/tests/rule_based_toolchain/toolchain_config/BUILD index fbfdc42..0068963 100644 --- a/tests/rule_based_toolchain/toolchain_config/BUILD +++ b/tests/rule_based_toolchain/toolchain_config/BUILD @@ -52,7 +52,6 @@ util.helper_target( target_libc = "glibc-2.2.2", target_system_name = "local", toolchain_features = [":compile_feature"], - toolchain_identifier = "collects_files_toolchain", ) util.helper_target( |