Skip to content

Commit d31b775

Browse files
authored
Exposed supported platform triples lists (#797)
* Exposed supported systems list and other such information. * Don't expose these to avoid confusion * Remove android fixes
1 parent 72c591d commit d31b775

File tree

2 files changed

+38
-35
lines changed

2 files changed

+38
-35
lines changed

rust/platform/platform.bzl

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,12 @@
33
load("@bazel_skylib//lib:selects.bzl", "selects")
44
load(
55
":triple_mappings.bzl",
6+
"SUPPORTED_PLATFORM_TRIPLES",
67
"cpu_arch_to_constraints",
78
"system_to_constraints",
89
"triple_to_constraint_set",
910
)
1011

11-
# All T1 Platforms should be supported, but aren't, see inline notes.
12-
_SUPPORTED_T1_PLATFORM_TRIPLES = [
13-
"i686-apple-darwin",
14-
"i686-pc-windows-msvc",
15-
"i686-unknown-linux-gnu",
16-
"x86_64-apple-darwin",
17-
"x86_64-pc-windows-msvc",
18-
"x86_64-unknown-linux-gnu",
19-
# N.B. These "alternative" envs are not supported, as bazel cannot distinguish between them
20-
# and others using existing @platforms// config_values
21-
#
22-
#"i686-pc-windows-gnu",
23-
#"x86_64-pc-windows-gnu",
24-
]
25-
26-
# Some T2 Platforms are supported, provided we have mappings to @platforms// entries.
27-
# See @rules_rust//rust/platform:triple_mappings.bzl for the complete list.
28-
_SUPPORTED_T2_PLATFORM_TRIPLES = [
29-
"aarch64-apple-darwin",
30-
"aarch64-apple-ios",
31-
"aarch64-linux-android",
32-
"aarch64-unknown-linux-gnu",
33-
"arm-unknown-linux-gnueabi",
34-
"i686-linux-android",
35-
"i686-unknown-freebsd",
36-
"powerpc-unknown-linux-gnu",
37-
"s390x-unknown-linux-gnu",
38-
"wasm32-unknown-unknown",
39-
"wasm32-wasi",
40-
"x86_64-apple-ios",
41-
"x86_64-linux-android",
42-
"x86_64-unknown-freebsd",
43-
]
44-
4512
_SUPPORTED_CPU_ARCH = [
4613
"aarch64",
4714
"arm",
@@ -88,7 +55,7 @@ def declare_config_settings():
8855
actual = ":darwin",
8956
)
9057

91-
all_supported_triples = _SUPPORTED_T1_PLATFORM_TRIPLES + _SUPPORTED_T2_PLATFORM_TRIPLES
58+
all_supported_triples = SUPPORTED_PLATFORM_TRIPLES
9259
for triple in all_supported_triples:
9360
native.config_setting(
9461
name = triple,

rust/platform/triple_mappings.bzl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
"""Helpers for constructing supported Rust platform triples"""
22

3+
# All T1 Platforms should be supported, but aren't, see inline notes.
4+
SUPPORTED_T1_PLATFORM_TRIPLES = [
5+
"i686-apple-darwin",
6+
"i686-pc-windows-msvc",
7+
"i686-unknown-linux-gnu",
8+
"x86_64-apple-darwin",
9+
"x86_64-pc-windows-msvc",
10+
"x86_64-unknown-linux-gnu",
11+
# N.B. These "alternative" envs are not supported, as bazel cannot distinguish between them
12+
# and others using existing @platforms// config_values
13+
#
14+
#"i686-pc-windows-gnu",
15+
#"x86_64-pc-windows-gnu",
16+
]
17+
18+
# Some T2 Platforms are supported, provided we have mappings to @platforms// entries.
19+
# See @rules_rust//rust/platform:triple_mappings.bzl for the complete list.
20+
SUPPORTED_T2_PLATFORM_TRIPLES = [
21+
"aarch64-apple-darwin",
22+
"aarch64-apple-ios",
23+
"aarch64-linux-android",
24+
"aarch64-unknown-linux-gnu",
25+
"arm-unknown-linux-gnueabi",
26+
"i686-linux-android",
27+
"i686-unknown-freebsd",
28+
"powerpc-unknown-linux-gnu",
29+
"s390x-unknown-linux-gnu",
30+
"wasm32-unknown-unknown",
31+
"wasm32-wasi",
32+
"x86_64-apple-ios",
33+
"x86_64-linux-android",
34+
"x86_64-unknown-freebsd",
35+
]
36+
37+
SUPPORTED_PLATFORM_TRIPLES = SUPPORTED_T1_PLATFORM_TRIPLES + SUPPORTED_T2_PLATFORM_TRIPLES
38+
339
# CPUs that map to a "@platforms//cpu entry
440
_CPU_ARCH_TO_BUILTIN_PLAT_SUFFIX = {
541
"aarch64": "aarch64",

0 commit comments

Comments
 (0)