Skip to content

Commit dc94436

Browse files
committed
Remove toolchain_identifier
1 parent 2e5f7b7 commit dc94436

16 files changed

+2
-65
lines changed

cc/private/compile/compile_build_variables.bzl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,6 @@ def _compute_all_linkstamp_defines(
618618
code_coverage_enabled):
619619
"""Computes defines for linkstamp compilation."""
620620
defines = [
621-
'GPLATFORM="' + cc_toolchain.toolchain_id + '"',
622621
"BUILD_COVERAGE_ENABLED=" + ("1" if code_coverage_enabled else "0"),
623622
# G3_TARGET_NAME is a C string literal that normally contain the label of the target
624623
# being linked. However, they are set differently when using shared native deps. In

cc/private/rules_impl/cc_toolchain.bzl

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -186,18 +186,6 @@ cc_toolchain = rule(
186186
"licenses": attr.license() if hasattr(attr, "license") else attr.string_list(),
187187
# buildifier: disable=attr-license
188188
"output_licenses": attr.license() if hasattr(attr, "license") else attr.string_list(),
189-
"toolchain_identifier": attr.string(
190-
default = "",
191-
doc = """
192-
The identifier used to match this cc_toolchain with the corresponding
193-
crosstool_config.toolchain.
194-
195-
<p>
196-
Until issue <a href="https://github.com/bazelbuild/bazel/issues/5380">#5380</a> is fixed
197-
this is the recommended way of associating <code>cc_toolchain</code> with
198-
<code>CROSSTOOL.toolchain</code>. It will be replaced by the <code>toolchain_config</code>
199-
attribute (<a href="https://github.com/bazelbuild/bazel/issues/5380">#5380</a>).</p>""",
200-
),
201189
"all_files": attr.label(
202190
allow_files = True,
203191
mandatory = True,

cc/private/rules_impl/cc_toolchain_info.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ def _create_cc_toolchain_info(
105105
libc = toolchain_config_info.target_libc,
106106
cpu = toolchain_config_info.target_cpu,
107107
target_gnu_system_name = toolchain_config_info.target_system_name,
108-
toolchain_id = toolchain_config_info.toolchain_id,
109108
dynamic_runtime_solib_dir = dynamic_runtime_solib_dir,
110109
objcopy_executable = objcopy_executable,
111110
compiler_executable = compiler_executable,
@@ -192,7 +191,6 @@ CcToolchainInfo, _ = provider(
192191
"libc": "libc version string.",
193192
"cpu": "Target CPU of the C++ toolchain.",
194193
"target_gnu_system_name": "The GNU System Name.",
195-
"toolchain_id": "",
196194
"dynamic_runtime_solib_dir": "",
197195
"objcopy_executable": "The path to the objcopy binary.",
198196
"compiler_executable": "The path to the compiler binary.",

cc/private/toolchain/BUILD.empty.tpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ cc_toolchain(
5151
objcopy_files = ":empty",
5252
strip_files = ":empty",
5353
toolchain_config = ":local_config",
54-
toolchain_identifier = "local",
5554
)
5655

5756
cc_toolchain_config(name = "local_config")

cc/private/toolchain/BUILD.static.bsd

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ cc_toolchain(
7373
strip_files = ":empty",
7474
supports_param_files = 0,
7575
toolchain_config = ":local_freebsd",
76-
toolchain_identifier = "local_freebsd",
7776
)
7877

7978
cc_toolchain_config(
@@ -107,7 +106,6 @@ cc_toolchain(
107106
strip_files = ":empty",
108107
supports_param_files = 0,
109108
toolchain_config = ":local_openbsd",
110-
toolchain_identifier = "local_openbsd",
111109
)
112110

113111
cc_toolchain_config(
@@ -141,7 +139,6 @@ cc_toolchain(
141139
strip_files = ":empty",
142140
supports_param_files = 0,
143141
toolchain_config = ":stub_armeabi-v7a",
144-
toolchain_identifier = "stub_armeabi-v7a",
145142
)
146143

147144
cc_toolchain_config(

cc/private/toolchain/BUILD.tpl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ cc_toolchain_suite(
8585

8686
cc_toolchain(
8787
name = "cc-compiler-%{name}",
88-
toolchain_identifier = "%{cc_toolchain_identifier}",
89-
toolchain_config = ":%{cc_toolchain_identifier}",
88+
toolchain_config = ":cc-config-%{name}",
9089
all_files = ":compiler_deps",
9190
ar_files = ":compiler_deps",
9291
as_files = ":compiler_deps",
@@ -101,10 +100,9 @@ cc_toolchain(
101100
)
102101

103102
cc_toolchain_config(
104-
name = "%{cc_toolchain_identifier}",
103+
name = ":cc-config-%{name}",
105104
cpu = "%{target_cpu}",
106105
compiler = "%{compiler}",
107-
toolchain_identifier = "%{cc_toolchain_identifier}",
108106
host_system_name = "%{host_system_name}",
109107
target_system_name = "%{target_system_name}",
110108
target_libc = "%{target_libc}",
@@ -131,7 +129,6 @@ cc_toolchain_config(
131129
# Android tooling requires a default toolchain for the armeabi-v7a cpu.
132130
cc_toolchain(
133131
name = "cc-compiler-armeabi-v7a",
134-
toolchain_identifier = "stub_armeabi-v7a",
135132
toolchain_config = ":stub_armeabi-v7a",
136133
all_files = ":empty",
137134
ar_files = ":empty",

cc/private/toolchain/BUILD.windows.tpl

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ cc_toolchain_suite(
9999

100100
cc_toolchain(
101101
name = "cc-compiler-x64_windows_msys",
102-
toolchain_identifier = "msys_x64",
103102
toolchain_config = ":msys_x64",
104103
all_files = ":empty",
105104
ar_files = ":empty",
@@ -143,7 +142,6 @@ toolchain(
143142

144143
cc_toolchain(
145144
name = "cc-compiler-x64_x86_windows_msys",
146-
toolchain_identifier = "msys_x64_x86",
147145
toolchain_config = ":msys_x64_x86",
148146
all_files = ":empty",
149147
ar_files = ":empty",
@@ -189,7 +187,6 @@ toolchain(
189187

190188
cc_toolchain(
191189
name = "cc-compiler-x64_windows_mingw",
192-
toolchain_identifier = "msys_x64_mingw",
193190
toolchain_config = ":msys_x64_mingw",
194191
all_files = ":empty",
195192
ar_files = ":empty",
@@ -233,7 +230,6 @@ toolchain(
233230

234231
cc_toolchain(
235232
name = "cc-compiler-x64_x86_windows_mingw",
236-
toolchain_identifier = "msys_x64_x86_mingw",
237233
toolchain_config = ":msys_x64_x86_mingw",
238234
all_files = ":empty",
239235
ar_files = ":empty",
@@ -279,7 +275,6 @@ toolchain(
279275

280276
cc_toolchain(
281277
name = "cc-compiler-x64_windows",
282-
toolchain_identifier = "msvc_x64",
283278
toolchain_config = ":msvc_x64",
284279
all_files = ":empty",
285280
ar_files = ":empty",
@@ -301,7 +296,6 @@ cc_toolchain_config(
301296
target_libc = "msvcrt",
302297
abi_version = "local",
303298
abi_libc_version = "local",
304-
toolchain_identifier = "msvc_x64",
305299
msvc_env_tmp = "%{msvc_env_tmp_x64}",
306300
msvc_env_path = "%{msvc_env_path_x64}",
307301
msvc_env_include = "%{msvc_env_include_x64}",
@@ -349,7 +343,6 @@ toolchain(
349343

350344
cc_toolchain(
351345
name = "cc-compiler-x64_x86_windows",
352-
toolchain_identifier = "msvc_x64_x86",
353346
toolchain_config = ":msvc_x64_x86",
354347
all_files = ":empty",
355348
ar_files = ":empty",
@@ -371,7 +364,6 @@ cc_toolchain_config(
371364
target_libc = "msvcrt",
372365
abi_version = "local",
373366
abi_libc_version = "local",
374-
toolchain_identifier = "msvc_x64_x86",
375367
msvc_env_tmp = "%{msvc_env_tmp_x86}",
376368
msvc_env_path = "%{msvc_env_path_x86}",
377369
msvc_env_include = "%{msvc_env_include_x86}",
@@ -419,7 +411,6 @@ toolchain(
419411

420412
cc_toolchain(
421413
name = "cc-compiler-x64_arm_windows",
422-
toolchain_identifier = "msvc_x64_arm",
423414
toolchain_config = ":msvc_x64_arm",
424415
all_files = ":empty",
425416
ar_files = ":empty",
@@ -441,7 +432,6 @@ cc_toolchain_config(
441432
target_libc = "msvcrt",
442433
abi_version = "local",
443434
abi_libc_version = "local",
444-
toolchain_identifier = "msvc_x64_arm",
445435
msvc_env_tmp = "%{msvc_env_tmp_arm}",
446436
msvc_env_path = "%{msvc_env_path_arm}",
447437
msvc_env_include = "%{msvc_env_include_arm}",
@@ -489,7 +479,6 @@ toolchain(
489479

490480
cc_toolchain(
491481
name = "cc-compiler-arm64_windows",
492-
toolchain_identifier = "msvc_arm64",
493482
toolchain_config = ":msvc_arm64",
494483
all_files = ":empty",
495484
ar_files = ":empty",
@@ -511,7 +500,6 @@ cc_toolchain_config(
511500
target_libc = "msvcrt",
512501
abi_version = "local",
513502
abi_libc_version = "local",
514-
toolchain_identifier = "msvc_arm64",
515503
msvc_env_tmp = "%{msvc_env_tmp_arm64}",
516504
msvc_env_path = "%{msvc_env_path_arm64}",
517505
msvc_env_include = "%{msvc_env_include_arm64}",
@@ -559,7 +547,6 @@ toolchain(
559547

560548
cc_toolchain(
561549
name = "cc-compiler-x64_windows-clang-cl",
562-
toolchain_identifier = "clang_cl_x64",
563550
toolchain_config = ":clang_cl_x64",
564551
all_files = ":empty",
565552
ar_files = ":empty",
@@ -581,7 +568,6 @@ cc_toolchain_config(
581568
target_libc = "msvcrt",
582569
abi_version = "local",
583570
abi_libc_version = "local",
584-
toolchain_identifier = "clang_cl_x64",
585571
msvc_env_tmp = "%{clang_cl_env_tmp_x64}",
586572
msvc_env_path = "%{clang_cl_env_path_x64}",
587573
msvc_env_include = "%{clang_cl_env_include_x64}",
@@ -627,7 +613,6 @@ toolchain(
627613

628614
cc_toolchain(
629615
name = "cc-compiler-arm64_windows-clang-cl",
630-
toolchain_identifier = "clang_cl_arm64",
631616
toolchain_config = ":clang_cl_arm64",
632617
all_files = ":empty",
633618
ar_files = ":empty",
@@ -649,7 +634,6 @@ cc_toolchain_config(
649634
target_libc = "msvcrt",
650635
abi_version = "local",
651636
abi_libc_version = "local",
652-
toolchain_identifier = "clang_cl_arm64",
653637
msvc_env_tmp = "%{clang_cl_env_tmp_arm64}",
654638
msvc_env_path = "%{clang_cl_env_path_arm64}",
655639
msvc_env_include = "%{clang_cl_env_include_arm64}",
@@ -694,7 +678,6 @@ toolchain(
694678

695679
cc_toolchain(
696680
name = "cc-compiler-armeabi-v7a",
697-
toolchain_identifier = "stub_armeabi-v7a",
698681
toolchain_config = ":stub_armeabi-v7a",
699682
all_files = ":empty",
700683
ar_files = ":empty",

cc/private/toolchain/armeabi_cc_toolchain_config.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
2222
load("@rules_cc//cc/toolchains:cc_toolchain_config_info.bzl", "CcToolchainConfigInfo")
2323

2424
def _impl(ctx):
25-
toolchain_identifier = "stub_armeabi-v7a"
2625
host_system_name = "armeabi-v7a"
2726
target_system_name = "armeabi-v7a"
2827
target_cpu = "armeabi-v7a"
@@ -63,7 +62,6 @@ def _impl(ctx):
6362
action_configs = action_configs,
6463
artifact_name_patterns = artifact_name_patterns,
6564
cxx_builtin_include_directories = cxx_builtin_include_directories,
66-
toolchain_identifier = toolchain_identifier,
6765
host_system_name = host_system_name,
6866
target_system_name = target_system_name,
6967
target_cpu = target_cpu,

cc/private/toolchain/bsd_cc_toolchain_config.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def _impl(ctx):
5959
cpu = ctx.attr.cpu
6060
is_bsd = cpu == "freebsd" or cpu == "openbsd"
6161
compiler = "compiler"
62-
toolchain_identifier = "local_{}".format(cpu) if is_bsd else "stub_armeabi-v7a"
6362
host_system_name = "local" if is_bsd else "armeabi-v7a"
6463
target_system_name = "local" if is_bsd else "armeabi-v7a"
6564
target_libc = "local" if is_bsd else "armeabi-v7a"
@@ -284,7 +283,6 @@ def _impl(ctx):
284283
features = features,
285284
action_configs = action_configs,
286285
cxx_builtin_include_directories = cxx_builtin_include_directories,
287-
toolchain_identifier = toolchain_identifier,
288286
host_system_name = host_system_name,
289287
target_system_name = target_system_name,
290288
target_cpu = cpu,

cc/private/toolchain/empty_cc_toolchain_config.bzl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def _impl(ctx):
2222
return [
2323
cc_common.create_cc_toolchain_config_info(
2424
ctx = ctx,
25-
toolchain_identifier = "local_linux",
2625
host_system_name = "local",
2726
target_system_name = "local",
2827
target_cpu = "local",

0 commit comments

Comments
 (0)