Skip to content

Commit 43947a5

Browse files
committed
Switch to a toolchain
1 parent d1c28ed commit 43947a5

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

src/conditions/BUILD.tools

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,13 @@ config_setting(
145145

146146
config_setting(
147147
name = "host_windows_x64_constraint",
148+
deprecation = "No longer used by Bazel and will be removed in the future. Migrate to toolchains or define your own version of this setting.",
148149
values = {"host_cpu": "x64_windows"},
149150
)
150151

151152
config_setting(
152153
name = "host_windows_arm64_constraint",
154+
deprecation = "No longer used by Bazel and will be removed in the future. Migrate to toolchains or define your own version of this setting.",
153155
values = {"host_cpu": "arm64_windows"},
154156
)
155157

@@ -159,6 +161,7 @@ alias(
159161
":host_windows_arm64_constraint": ":host_windows_arm64_constraint",
160162
"//conditions:default": ":host_windows_x64_constraint",
161163
}),
164+
deprecation = "No longer used by Bazel and will be removed in the future. Migrate to toolchains or define your own version of this setting.",
162165
visibility = ["//visibility:public"],
163166
)
164167

tools/build_defs.bzl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,3 @@ def _make_current_toolchain_rule(toolchain_type):
114114
)
115115

116116
current_launcher_binary = _make_current_toolchain_rule("//tools/launcher:launcher_toolchain_type")
117-
current_launcher_maker_binary = _make_current_toolchain_rule("//tools/launcher:launcher_maker_toolchain_type")

tools/launcher/BUILD.tools

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,38 @@ load(
33
"//tools:build_defs.bzl",
44
"IS_HOST_WINDOWS",
55
"current_launcher_binary",
6-
"current_launcher_maker_binary",
76
"single_binary_toolchain",
87
)
98

109
package(default_visibility = ["//visibility:public"])
1110

12-
current_launcher_binary(name = "launcher")
13-
14-
current_launcher_maker_binary(name = "launcher_maker")
11+
# WARNING: These targets and toolchain types only exist for the purposes of
12+
# rulesets formerly included in Bazel itself and may change or be removed at any
13+
# time.
1514

16-
# WARNING: These toolchain types and their associated toolchains only exist for
17-
# the purposes of rulesets formerly included in Bazel itself and may change or
18-
# be removed at any time.
15+
current_launcher_binary(name = "launcher")
1916

20-
toolchain_type(
21-
name = "launcher_toolchain_type",
22-
visibility = ["//visibility:private"],
17+
# DEPRECATED: Use the `:launcher_maker_toolchain_type` toolchain instead to
18+
# avoid an unnecessary dependency on a C++ toolchain when building for a
19+
# non-Windows platform.
20+
filegroup(
21+
name = "launcher_maker",
22+
srcs = select({
23+
":is_host": ["launcher_maker.exe" if IS_HOST_WINDOWS else "//src/tools/launcher:launcher_maker"],
24+
"//conditions:default": ["//src/tools/launcher:launcher_maker"],
25+
}),
2326
)
2427

25-
toolchain_type(
26-
name = "launcher_maker_toolchain_type",
28+
config_setting(
29+
name = "is_host",
30+
constraint_values = HOST_CONSTRAINTS,
2731
visibility = ["//visibility:private"],
2832
)
2933

34+
toolchain_type(name = "launcher_toolchain_type")
35+
36+
toolchain_type(name = "launcher_maker_toolchain_type")
37+
3038
# Toolchains are prefixed with a number to ensure that their order of definition
3139
# matches their precedence in the toolchain resolution process when registered
3240
# with a wildcard pattern (which sorts by name).

0 commit comments

Comments
 (0)