Skip to content

Commit f88663d

Browse files
matts1copybara-github
authored andcommitted
Provide a default toolchain_identifier.
BEGIN_PUBLIC Provide a default toolchain_identifier. END_PUBLIC PiperOrigin-RevId: 626172528 Change-Id: I2d23d79b82f4268b462dac79edc4f69a7f865e00
1 parent 6e490f7 commit f88663d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

cc/toolchains/impl/toolchain_config.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ def _cc_toolchain_config_impl(ctx):
7171
action_configs = legacy.action_configs,
7272
features = legacy.features,
7373
cxx_builtin_include_directories = ctx.attr.cxx_builtin_include_directories,
74-
toolchain_identifier = ctx.attr.toolchain_identifier,
74+
# toolchain_identifier is deprecated, but setting it to None results
75+
# in an error that it expected a string, and for safety's sake, I'd
76+
# prefer to provide something unique.
77+
toolchain_identifier = str(ctx.label),
7578
target_system_name = ctx.attr.target_system_name,
7679
target_cpu = ctx.attr.target_cpu,
7780
target_libc = ctx.attr.target_libc,
@@ -105,7 +108,6 @@ cc_toolchain_config = rule(
105108
# TODO: Consider making this into a label_list that takes a
106109
# cc_directory_marker rule as input.
107110
"cxx_builtin_include_directories": attr.string_list(),
108-
"toolchain_identifier": attr.string(mandatory = True),
109111
"target_system_name": attr.string(mandatory = True),
110112
"target_cpu": attr.string(mandatory = True),
111113
"target_libc": attr.string(mandatory = True),

tests/rule_based_toolchain/toolchain_config/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ util.helper_target(
5252
target_libc = "glibc-2.2.2",
5353
target_system_name = "local",
5454
toolchain_features = [":compile_feature"],
55-
toolchain_identifier = "collects_files_toolchain",
5655
)
5756

5857
util.helper_target(

0 commit comments

Comments
 (0)