Skip to content

Commit d879b18

Browse files
authored
Remove references to @bazel_tools//tools/cpp (#2885)
Signed-off-by: Aaron Sky <asky@dropbox.com>
1 parent c17a03d commit d879b18

15 files changed

Lines changed: 54 additions & 54 deletions

apple/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ bzl_library(
9696
"//apple/internal:platform_support",
9797
"//apple/internal:providers",
9898
"@bazel_skylib//lib:dicts",
99-
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
10099
"@build_bazel_apple_support//lib:apple_support",
100+
"@rules_cc//cc:find_cc_toolchain_bzl",
101101
],
102102
)
103103

apple/cc_toolchain_forwarder.bzl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ load(
2020
"@bazel_skylib//lib:dicts.bzl",
2121
"dicts",
2222
)
23-
load(
24-
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
25-
"find_cpp_toolchain",
26-
"use_cpp_toolchain",
27-
)
2823
load(
2924
"@build_bazel_apple_support//lib:apple_support.bzl",
3025
"apple_support",
3126
)
27+
load(
28+
"@rules_cc//cc:find_cc_toolchain.bzl",
29+
"find_cc_toolchain",
30+
"use_cc_toolchain",
31+
)
3232
load(
3333
"//apple/internal:platform_support.bzl",
3434
"platform_support",
@@ -38,7 +38,7 @@ visibility("public")
3838

3939
def _cc_toolchain_forwarder_impl(ctx):
4040
return [
41-
find_cpp_toolchain(ctx),
41+
find_cc_toolchain(ctx),
4242
platform_support.apple_platform_info_from_rule_ctx(ctx),
4343
]
4444

@@ -49,7 +49,7 @@ cc_toolchain_forwarder = rule(
4949
{
5050
# Legacy style toolchain assignment.
5151
"_cc_toolchain": attr.label(
52-
default = Label("@bazel_tools//tools/cpp:current_cc_toolchain"),
52+
default = Label("@rules_cc//cc:current_cc_toolchain"),
5353
),
5454
},
5555
),
@@ -60,5 +60,5 @@ for the purposes of understanding what constraints the results of each Apple spl
6060
resolve to from the perspective of any bundling and binary rules that generate "fat" Apple binaries.
6161
""",
6262
# Anticipated "new" toolchain assignment.
63-
toolchains = use_cpp_toolchain(),
63+
toolchains = use_cc_toolchain(),
6464
)

apple/internal/BUILD

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ bzl_library(
7171
"@bazel_skylib//lib:partial",
7272
"@bazel_skylib//lib:paths",
7373
"@bazel_skylib//lib:sets",
74-
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
7574
"@build_bazel_rules_swift//swift",
75+
"@rules_cc//cc:find_cc_toolchain_bzl",
7676
],
7777
)
7878

@@ -125,9 +125,9 @@ bzl_library(
125125
"//apple/internal/aspects:swift_usage_aspect",
126126
"@bazel_skylib//lib:dicts",
127127
"@bazel_skylib//lib:paths",
128-
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
129128
"@build_bazel_apple_support//lib:apple_support",
130129
"@build_bazel_rules_swift//swift",
130+
"@rules_cc//cc:find_cc_toolchain_bzl",
131131
],
132132
)
133133

@@ -324,10 +324,10 @@ bzl_library(
324324
"//apple/internal/utils:clang_rt_dylibs",
325325
"//apple/internal/utils:main_thread_checker_dylibs",
326326
"@bazel_skylib//lib:collections",
327-
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
328327
"@build_bazel_apple_support//lib:apple_support",
329328
"@build_bazel_rules_swift//swift",
330329
"@build_bazel_rules_swift//swift:providers",
330+
"@rules_cc//cc:find_cc_toolchain_bzl",
331331
],
332332
)
333333

@@ -594,8 +594,8 @@ bzl_library(
594594
"//apple/internal/testing:apple_test_bundle_support",
595595
"//apple/internal/testing:apple_test_rule_support",
596596
"@bazel_skylib//lib:dicts",
597-
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
598597
"@build_bazel_apple_support//lib:apple_support",
598+
"@rules_cc//cc:find_cc_toolchain_bzl",
599599
],
600600
)
601601

@@ -703,10 +703,10 @@ bzl_library(
703703
"//apple/internal/aspects:resource_aspect_hint",
704704
"//apple/internal/utils:clang_rt_dylibs",
705705
"//apple/internal/utils:main_thread_checker_dylibs",
706-
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
707706
"@build_bazel_apple_support//lib:apple_support",
708707
"@build_bazel_rules_swift//swift",
709708
"@build_bazel_rules_swift//swift:providers",
709+
"@rules_cc//cc:find_cc_toolchain_bzl",
710710
],
711711
)
712712

@@ -743,8 +743,8 @@ bzl_library(
743743
"//apple/internal/utils:clang_rt_dylibs",
744744
"//apple/internal/utils:main_thread_checker_dylibs",
745745
"@bazel_skylib//lib:sets",
746-
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
747746
"@build_bazel_apple_support//lib:apple_support",
747+
"@rules_cc//cc:find_cc_toolchain_bzl",
748748
],
749749
)
750750

@@ -780,8 +780,8 @@ bzl_library(
780780
"//apple/internal/utils:clang_rt_dylibs",
781781
"//apple/internal/utils:main_thread_checker_dylibs",
782782
"@bazel_skylib//lib:sets",
783-
"@bazel_tools//tools/cpp:toolchain_utils.bzl",
784783
"@build_bazel_apple_support//lib:apple_support",
784+
"@rules_cc//cc:find_cc_toolchain_bzl",
785785
],
786786
)
787787

apple/internal/apple_framework_import.bzl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ load(
3030
"@bazel_skylib//lib:sets.bzl",
3131
"sets",
3232
)
33-
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain")
3433
load(
3534
"@build_bazel_rules_swift//swift:swift.bzl",
3635
"swift_clang_module_aspect",
3736
"swift_common",
3837
)
38+
load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cc_toolchain", "use_cc_toolchain")
3939
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
4040
load(
4141
"//apple:providers.bzl",
@@ -172,7 +172,7 @@ def _apple_dynamic_framework_import_impl(ctx):
172172
"""Implementation for the apple_dynamic_framework_import rule."""
173173
actions = ctx.actions
174174
apple_xplat_toolchain_info = ctx.attr._xplat_toolchain[AppleXPlatToolsToolchainInfo]
175-
cc_toolchain = find_cpp_toolchain(ctx)
175+
cc_toolchain = find_cc_toolchain(ctx)
176176
deps = ctx.attr.deps
177177
disabled_features = ctx.disabled_features
178178
features = ctx.features
@@ -288,7 +288,7 @@ def _apple_static_framework_import_impl(ctx):
288288
"""Implementation for the apple_static_framework_import rule."""
289289
actions = ctx.actions
290290
alwayslink = ctx.attr.alwayslink or getattr(ctx.fragments.objc, "alwayslink_by_default", False)
291-
cc_toolchain = find_cpp_toolchain(ctx)
291+
cc_toolchain = find_cc_toolchain(ctx)
292292
compilation_mode = ctx.var["COMPILATION_MODE"]
293293
deps = ctx.attr.deps
294294
disabled_features = ctx.disabled_features
@@ -467,7 +467,7 @@ to manually dlopen the framework at runtime.
467467
""",
468468
),
469469
"_cc_toolchain": attr.label(
470-
default = "@bazel_tools//tools/cpp:current_cc_toolchain",
470+
default = "@rules_cc//cc:current_cc_toolchain",
471471
doc = "The C++ toolchain to use.",
472472
),
473473
},
@@ -493,7 +493,7 @@ objc_library(
493493
)
494494
```
495495
""",
496-
toolchains = swift_common.use_toolchain() + use_cpp_toolchain(),
496+
toolchains = swift_common.use_toolchain() + use_cc_toolchain(),
497497
)
498498

499499
apple_static_framework_import = rule(
@@ -572,12 +572,12 @@ not include Swift interface or Swift module files.
572572
default = False,
573573
),
574574
"_cc_toolchain": attr.label(
575-
default = "@bazel_tools//tools/cpp:current_cc_toolchain",
575+
default = "@rules_cc//cc:current_cc_toolchain",
576576
doc = "The C++ toolchain to use.",
577577
),
578578
},
579579
),
580-
toolchains = swift_common.use_toolchain() + use_cpp_toolchain(),
580+
toolchains = swift_common.use_toolchain() + use_cc_toolchain(),
581581
doc = """
582582
This rule encapsulates an already-built static framework. It is defined by a list of
583583
files in exactly one `.framework` directory. `apple_static_framework_import` targets

apple/internal/apple_xcframework_import.bzl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
load("@bazel_skylib//lib:dicts.bzl", "dicts")
1818
load("@bazel_skylib//lib:paths.bzl", "paths")
19-
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain")
2019
load("@build_bazel_apple_support//lib:apple_support.bzl", "apple_support")
2120
load(
2221
"@build_bazel_rules_swift//swift:swift.bzl",
2322
"swift_clang_module_aspect",
2423
"swift_common",
2524
)
25+
load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cc_toolchain", "use_cc_toolchain")
2626
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
2727
load("//apple:providers.bzl", "AppleFrameworkImportInfo")
2828
load(
@@ -482,7 +482,7 @@ def _apple_dynamic_xcframework_import_impl(ctx):
482482
apple_fragment = ctx.fragments.apple
483483
apple_mac_toolchain_info = ctx.attr._mac_toolchain[AppleMacToolsToolchainInfo]
484484
apple_xplat_toolchain_info = ctx.attr._xplat_toolchain[AppleXPlatToolsToolchainInfo]
485-
cc_toolchain = find_cpp_toolchain(ctx)
485+
cc_toolchain = find_cc_toolchain(ctx)
486486
deps = ctx.attr.deps
487487
disabled_features = ctx.disabled_features
488488
features = ctx.features
@@ -594,7 +594,7 @@ def _apple_static_xcframework_import_impl(ctx):
594594
apple_fragment = ctx.fragments.apple
595595
apple_mac_toolchain_info = ctx.attr._mac_toolchain[AppleMacToolsToolchainInfo]
596596
apple_xplat_toolchain_info = ctx.attr._xplat_toolchain[AppleXPlatToolsToolchainInfo]
597-
cc_toolchain = find_cpp_toolchain(ctx)
597+
cc_toolchain = find_cc_toolchain(ctx)
598598
deps = ctx.attr.deps
599599
disabled_features = ctx.disabled_features
600600
features = ctx.features
@@ -786,7 +786,7 @@ Unnecssary and ignored, will be removed in the future.
786786
""",
787787
),
788788
"_cc_toolchain": attr.label(
789-
default = "@bazel_tools//tools/cpp:current_cc_toolchain",
789+
default = "@rules_cc//cc:current_cc_toolchain",
790790
doc = "The C++ toolchain to use.",
791791
),
792792
},
@@ -797,7 +797,7 @@ Unnecssary and ignored, will be removed in the future.
797797
CcInfo,
798798
AppleDynamicFrameworkInfo,
799799
],
800-
toolchains = swift_common.use_toolchain() + use_cpp_toolchain(),
800+
toolchains = swift_common.use_toolchain() + use_cc_toolchain(),
801801
)
802802

803803
apple_static_xcframework_import = rule(
@@ -921,11 +921,11 @@ Unnecssary and ignored, will be removed in the future.
921921
""",
922922
),
923923
"_cc_toolchain": attr.label(
924-
default = "@bazel_tools//tools/cpp:current_cc_toolchain",
924+
default = "@rules_cc//cc:current_cc_toolchain",
925925
doc = "The C++ toolchain to use.",
926926
),
927927
},
928928
),
929929
fragments = ["apple", "cpp", "objc"],
930-
toolchains = swift_common.use_toolchain() + use_cpp_toolchain(),
930+
toolchains = swift_common.use_toolchain() + use_cc_toolchain(),
931931
)

apple/internal/ios_rules.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
"""Implementation of iOS rules."""
1616

1717
load("@bazel_skylib//lib:collections.bzl", "collections")
18-
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
1918
load(
2019
"@build_bazel_apple_support//lib:apple_support.bzl",
2120
"apple_support",
2221
)
2322
load("@build_bazel_rules_swift//swift:swift.bzl", "SwiftInfo")
23+
load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cc_toolchain")
2424
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
2525
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
2626
load(
@@ -894,7 +894,7 @@ def _ios_framework_impl(ctx):
894894
bundle_name = bundle_name,
895895
suffix_default = ctx.attr._bundle_id_suffix_default,
896896
)
897-
cc_toolchain = find_cpp_toolchain(ctx)
897+
cc_toolchain = find_cc_toolchain(ctx)
898898
cc_toolchain_forwarder = ctx.split_attr._cc_toolchain_forwarder
899899
cc_features = cc_common.configure_features(
900900
ctx = ctx,
@@ -1480,7 +1480,7 @@ def _ios_dynamic_framework_impl(ctx):
14801480
rule_descriptor = rule_descriptor,
14811481
)
14821482
executable_name = ctx.attr.executable_name
1483-
cc_toolchain = find_cpp_toolchain(ctx)
1483+
cc_toolchain = find_cc_toolchain(ctx)
14841484
cc_toolchain_forwarder = ctx.split_attr._cc_toolchain_forwarder
14851485
cc_features = cc_common.configure_features(
14861486
ctx = ctx,

apple/internal/macos_rules.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
"""Implementation of macOS rules."""
1616

17-
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
1817
load(
1918
"@build_bazel_apple_support//lib:apple_support.bzl",
2019
"apple_support",
@@ -23,6 +22,7 @@ load(
2322
"@build_bazel_rules_swift//swift:swift.bzl",
2423
"SwiftInfo",
2524
)
25+
load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cc_toolchain")
2626
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
2727
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
2828
load(
@@ -2792,7 +2792,7 @@ def _macos_framework_impl(ctx):
27922792
rule_descriptor = rule_descriptor,
27932793
)
27942794
executable_name = ctx.attr.executable_name
2795-
cc_toolchain = find_cpp_toolchain(ctx)
2795+
cc_toolchain = find_cc_toolchain(ctx)
27962796
cc_toolchain_forwarder = ctx.split_attr._cc_toolchain_forwarder
27972797
cc_features = cc_common.configure_features(
27982798
ctx = ctx,
@@ -3068,7 +3068,7 @@ def _macos_dynamic_framework_impl(ctx):
30683068
rule_descriptor = rule_descriptor,
30693069
)
30703070
executable_name = ctx.attr.executable_name
3071-
cc_toolchain = find_cpp_toolchain(ctx)
3071+
cc_toolchain = find_cc_toolchain(ctx)
30723072
cc_toolchain_forwarder = ctx.split_attr._cc_toolchain_forwarder
30733073
cc_features = cc_common.configure_features(
30743074
ctx = ctx,

apple/internal/rule_attrs.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def _binary_linking_attrs(
179179
# See utils/clang_rt_dylibs.bzl and partials/clang_rt_dylibs.bzl
180180
extra_attrs = dicts.add(extra_attrs, {
181181
"_cc_toolchain": attr.label(
182-
default = Label("@bazel_tools//tools/cpp:current_cc_toolchain"),
182+
default = Label("@rules_cc//cc:current_cc_toolchain"),
183183
),
184184
})
185185

apple/internal/rule_factory.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ load(
1818
"@bazel_skylib//lib:dicts.bzl",
1919
"dicts",
2020
)
21-
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "use_cpp_toolchain")
21+
load("@rules_cc//cc:find_cc_toolchain.bzl", "use_cc_toolchain")
2222
load(
2323
"//apple:providers.bzl",
2424
"AppleBundleInfo",
@@ -115,7 +115,7 @@ def _create_apple_rule(
115115
implementation,
116116
is_executable = False,
117117
predeclared_outputs = {},
118-
toolchains = use_cpp_toolchain(),
118+
toolchains = use_cc_toolchain(),
119119
attrs):
120120
"""Creates an Apple bundling rule with additional control of the set of rule attributes.
121121

apple/internal/tvos_rules.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
"""Implementation of tvOS rules."""
1616

17-
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
1817
load(
1918
"@build_bazel_apple_support//lib:apple_support.bzl",
2019
"apple_support",
@@ -23,6 +22,7 @@ load(
2322
"@build_bazel_rules_swift//swift:swift.bzl",
2423
"SwiftInfo",
2524
)
25+
load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cc_toolchain")
2626
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
2727
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
2828
load(
@@ -501,7 +501,7 @@ def _tvos_dynamic_framework_impl(ctx):
501501
rule_descriptor = rule_descriptor,
502502
)
503503
executable_name = ctx.attr.executable_name
504-
cc_toolchain = find_cpp_toolchain(ctx)
504+
cc_toolchain = find_cc_toolchain(ctx)
505505
cc_toolchain_forwarder = ctx.split_attr._cc_toolchain_forwarder
506506
cc_features = cc_common.configure_features(
507507
ctx = ctx,
@@ -793,7 +793,7 @@ def _tvos_framework_impl(ctx):
793793
bundle_name = bundle_name,
794794
suffix_default = ctx.attr._bundle_id_suffix_default,
795795
)
796-
cc_toolchain = find_cpp_toolchain(ctx)
796+
cc_toolchain = find_cc_toolchain(ctx)
797797
cc_toolchain_forwarder = ctx.split_attr._cc_toolchain_forwarder
798798
cc_features = cc_common.configure_features(
799799
ctx = ctx,

0 commit comments

Comments
 (0)