Skip to content

Commit 7c661a0

Browse files
authored
Merge pull request #222 from jonas-schievink/tiers
Generate the platform tier table from YAML
2 parents c05b19e + 861f8ce commit 7c661a0

File tree

3 files changed

+585
-154
lines changed

3 files changed

+585
-154
lines changed

platform-support.md

Lines changed: 27 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -13,160 +13,33 @@ Platforms are identified by their "target triple" which is the string to inform
1313
the compiler what kind of output should be produced. The columns below indicate
1414
whether the corresponding component works on the specified platform.
1515

16-
## Tier 1
17-
18-
Tier 1 platforms can be thought of as "guaranteed to work".
19-
Specifically they will each satisfy the following requirements:
20-
21-
* Official binary releases are provided for the platform.
22-
* Automated testing is set up to run tests for the platform.
23-
* Landing changes to the `rust-lang/rust` repository's master branch is gated on
24-
tests passing.
25-
* Documentation for how to use and how to build the platform is available.
26-
27-
| Target | std |rustc|cargo| notes |
28-
|-------------------------------|-----|-----|-----|----------------------------|
29-
| `i686-apple-darwin` |||| 32-bit OSX (10.7+, Lion+) |
30-
| `i686-pc-windows-gnu` |||| 32-bit MinGW (Windows 7+) |
31-
| `i686-pc-windows-msvc` |||| 32-bit MSVC (Windows 7+) |
32-
| `i686-unknown-linux-gnu` |||| 32-bit Linux (2.6.18+) |
33-
| `x86_64-apple-darwin` |||| 64-bit OSX (10.7+, Lion+) |
34-
| `x86_64-pc-windows-gnu` |||| 64-bit MinGW (Windows 7+) |
35-
| `x86_64-pc-windows-msvc` |||| 64-bit MSVC (Windows 7+) |
36-
| `x86_64-unknown-linux-gnu` |||| 64-bit Linux (2.6.18+) |
37-
38-
## Tier 2
39-
40-
Tier 2 platforms can be thought of as "guaranteed to build". Automated tests
41-
are not run so it's not guaranteed to produce a working build, but platforms
42-
often work to quite a good degree and patches are always welcome! Specifically,
43-
these platforms are required to have each of the following:
44-
45-
* Official binary releases are provided for the platform.
46-
* Automated building is set up, but may not be running tests.
47-
* Landing changes to the `rust-lang/rust` repository's master branch is gated on
48-
platforms **building**. For some platforms only the standard library is
49-
compiled, but for others `rustc` and `cargo` are too.
50-
51-
| Target | std |rustc|cargo| notes |
52-
|-----------------------------------|-----|-----|-----|-------------------------------------|
53-
| `aarch64-apple-ios` || | | ARM64 iOS |
54-
| `aarch64-fuchsia` || | | ARM64 Fuchsia |
55-
| `aarch64-linux-android` || | | ARM64 Android |
56-
| `aarch64-unknown-linux-gnu` |||| ARM64 Linux |
57-
| `aarch64-unknown-linux-musl` || | | ARM64 Linux with MUSL |
58-
| `arm-linux-androideabi` || | | ARMv7 Android |
59-
| `arm-unknown-linux-gnueabi` |||| ARMv6 Linux |
60-
| `arm-unknown-linux-gnueabihf` |||| ARMv6 Linux, hardfloat |
61-
| `arm-unknown-linux-musleabi` || | | ARMv6 Linux with MUSL |
62-
| `arm-unknown-linux-musleabihf` || | | ARMv6 Linux, MUSL, hardfloat |
63-
| `armv5te-unknown-linux-gnueabi` || | | ARMv5TE Linux |
64-
| `armv7-apple-ios` || | | ARMv7 iOS, Cortex-a8 |
65-
| `armv7-linux-androideabi` || | | ARMv7a Android |
66-
| `armv7-unknown-linux-gnueabihf` |||| ARMv7 Linux |
67-
| `armv7-unknown-linux-musleabihf` || | | ARMv7 Linux with MUSL |
68-
| `armv7s-apple-ios` || | | ARMv7 iOS, Cortex-a9 |
69-
| `asmjs-unknown-emscripten` || | | asm.js via Emscripten |
70-
| `i386-apple-ios` || | | 32-bit x86 iOS |
71-
| `i586-pc-windows-msvc` || | | 32-bit Windows w/o SSE |
72-
| `i586-unknown-linux-gnu` || | | 32-bit Linux w/o SSE |
73-
| `i586-unknown-linux-musl` || | | 32-bit Linux w/o SSE, MUSL |
74-
| `i686-linux-android` || | | 32-bit x86 Android |
75-
| `i686-unknown-freebsd` |||| 32-bit FreeBSD |
76-
| `i686-unknown-linux-musl` || | | 32-bit Linux with MUSL |
77-
| `mips-unknown-linux-gnu` |||| MIPS Linux |
78-
| `mips-unknown-linux-musl` || | | MIPS Linux with MUSL |
79-
| `mips64-unknown-linux-gnuabi64` |||| MIPS64 Linux, n64 ABI |
80-
| `mips64el-unknown-linux-gnuabi64` |||| MIPS64 (LE) Linux, n64 ABI |
81-
| `mipsel-unknown-linux-gnu` |||| MIPS (LE) Linux |
82-
| `mipsel-unknown-linux-musl` || | | MIPS (LE) Linux with MUSL |
83-
| `powerpc-unknown-linux-gnu` |||| PowerPC Linux |
84-
| `powerpc64-unknown-linux-gnu` |||| PPC64 Linux |
85-
| `powerpc64le-unknown-linux-gnu` |||| PPC64LE Linux |
86-
| `riscv32imac-unknown-none-elf` | * | | | Bare RISC-V (RV32IMAC ISA) |
87-
| `riscv32imc-unknown-none-elf` | * | | | Bare RISC-V (RV32IMC ISA) |
88-
| `riscv64gc-unknown-none-elf` | * | | | Bare RISC-V (RV64IMAFDC ISA) |
89-
| `riscv64imac-unknown-none-elf` | * | | | Bare RISC-V (RV64IMAC ISA) |
90-
| `s390x-unknown-linux-gnu` |||| S390x Linux |
91-
| `sparc64-unknown-linux-gnu` || | | SPARC Linux |
92-
| `sparcv9-sun-solaris` || | | SPARC Solaris 10/11, illumos |
93-
| `wasm32-unknown-unknown` || | | WebAssembly |
94-
| `wasm32-unknown-emscripten` || | | WebAssembly via Emscripten |
95-
| `x86_64-apple-ios` || | | 64-bit x86 iOS |
96-
| `x86_64-fortanix-unknown-sgx` || | | [Fortanix ABI] for 64-bit Intel SGX |
97-
| `x86_64-fuchsia` || | | 64-bit Fuchsia |
98-
| `x86_64-linux-android` || | | 64-bit x86 Android |
99-
| `x86_64-rumprun-netbsd` || | | 64-bit NetBSD Rump Kernel |
100-
| `x86_64-sun-solaris` || | | 64-bit Solaris 10/11, illumos |
101-
| `x86_64-unknown-cloudabi` || | | 64-bit CloudABI |
102-
| `x86_64-unknown-freebsd` |||| 64-bit FreeBSD |
103-
| `x86_64-unknown-linux-gnux32` || | | 64-bit Linux |
104-
| `x86_64-unknown-linux-musl` |||| 64-bit Linux with MUSL |
105-
| `x86_64-unknown-netbsd` |||| NetBSD/amd64 |
106-
| `x86_64-unknown-redox` || | | Redox OS |
107-
108-
[Fortanix ABI]: https://edp.fortanix.com
109-
110-
<em>*</em> These are bare-metal microcontroller targets that only have access to
111-
the core library, not std.
112-
113-
## Tier 2.5
114-
115-
Tier 2.5 platforms can be thought of as "guaranteed to build", but without
116-
builds available through `rustup`. Automated tests are not run so it's not
117-
guaranteed to produce a working build, but platforms often work to quite a good
118-
degree and patches are always welcome! Specifically, these platforms are
119-
required to have each of the following:
120-
121-
* Automated building is set up, but may not be running tests.
122-
* Landing changes to the `rust-lang/rust` repository's master branch is gated on
123-
platforms **building**. For some platforms only the standard library is
124-
compiled, but for others `rustc` and `cargo` are too.
125-
126-
**This status is accidental: no new platforms should reach this state**
127-
128-
| Target | std |rustc|cargo| notes |
129-
|-----------------------------------|-----|-----|-----|------------------------------|
130-
| `aarch64-unknown-cloudabi` || | | ARM64 CloudABI |
131-
| `armv7-unknown-cloudabi-eabihf` || | | ARMv7 CloudABI, hardfloat |
132-
| `i686-unknown-cloudabi` || | | 32-bit CloudABI |
133-
| `powerpc-unknown-linux-gnuspe` || | | PowerPC SPE Linux |
134-
| `sparc-unknown-linux-gnu` || | | 32-bit SPARC Linux |
135-
136-
## Tier 3
137-
138-
Tier 3 platforms are those which the Rust codebase has support for, but
139-
which are not built or tested automatically, and may not work.
140-
Official builds are not available.
141-
142-
| Target | std |rustc|cargo| notes |
143-
|---------------------------------|-----|-----|-----|----------------------------------------------------------|
144-
| `i686-pc-windows-msvc` (XP) || | | Windows XP support |
145-
| `i686-unknown-haiku` || | | 32-bit Haiku |
146-
| `i686-unknown-netbsd` || | | NetBSD/i386 with SSE2 |
147-
| `mips-unknown-linux-uclibc` || | | MIPS Linux with uClibc |
148-
| `mipsel-unknown-linux-uclibc` || | | MIPS (LE) Linux with uClibc |
149-
| `msp430-none-elf` | * | | | 16-bit MSP430 microcontrollers |
150-
| `sparc64-unknown-netbsd` ||| | NetBSD/sparc64 |
151-
| `thumbv6m-none-eabi` | * | | | Bare Cortex-M0, M0+, M1 |
152-
| `thumbv7em-none-eabi` | * | | | Bare Cortex-M4, M7 |
153-
| `thumbv7em-none-eabihf` | * | | | Bare Cortex-M4F, M7F, FPU, hardfloat |
154-
| `thumbv7m-none-eabi` | * | | | Bare Cortex-M3 |
155-
| `x86_64-pc-windows-msvc` (XP) || | | Windows XP support |
156-
| `x86_64-unknown-bitrig` ||| | 64-bit Bitrig |
157-
| `x86_64-unknown-dragonfly` ||| | 64-bit DragonFlyBSD |
158-
| `x86_64-unknown-haiku` || | | 64-bit Haiku |
159-
| `x86_64-unknown-openbsd` ||| | 64-bit OpenBSD |
160-
| [NVPTX] | ** | | | `--emit=asm` generates PTX code that runs on NVIDIA GPUs |
161-
162-
[NVPTX]: https://github.com/japaric/nvptx#targets
163-
164-
<em>*</em> These are bare-metal microcontroller targets that only have access to
165-
the core library, not std.
166-
167-
<em>**</em> There's backend support for these targets but no target built into
168-
`rustc` (yet). You'll have to write your own target specification file (see the
169-
links in the table). These targets only support the core library.
16+
{% for tier in site.tiers %}
17+
## {{ tier[0] }}
18+
19+
{{ tier[1].description }}
20+
21+
<table>
22+
<tr>
23+
<th>target</th>
24+
<th>std</th>
25+
<th>rustc</th>
26+
<th>cargo</th>
27+
<th>notes</th>
28+
</tr>
29+
{% for target in tier[1].platforms %}
30+
<tr>
31+
<td><code>{{ target.tuple }}</code></td>
32+
<td>{{ target.std }}</td>
33+
<td>{{ target.rustc }}</td>
34+
<td>{{ target.cargo }}</td>
35+
<td>{{ target.notes }}</td>
36+
</tr>
37+
{% endfor %}
38+
</table>
39+
40+
{{ tier[1].footnotes }}
41+
42+
{% endfor %}
17043

17144
But those aren't the only platforms Rust can compile to! Those are the ones with
17245
built-in target definitions and/or standard library support. When linking only

src/main.rs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,37 @@ mod channel {
2323
}
2424
}
2525

26+
mod tiers {
27+
use serde::{Serialize, Deserialize};
28+
use indexmap::IndexMap;
29+
30+
#[derive(Serialize, Deserialize)]
31+
pub struct Platform {
32+
pub tuple: String,
33+
pub std: String,
34+
pub rustc: Option<String>,
35+
pub cargo: Option<String>,
36+
pub notes: String,
37+
}
38+
39+
#[derive(Serialize, Deserialize)]
40+
pub struct Tier {
41+
pub description: String,
42+
pub platforms: Vec<Platform>,
43+
pub footnotes: String,
44+
}
45+
46+
/// `tiers.yaml` content.
47+
#[derive(Serialize, Deserialize)]
48+
#[serde(transparent)]
49+
pub struct Tiers {
50+
/// Maps Tier Name -> Data
51+
pub tiers: IndexMap<String, Tier>,
52+
}
53+
}
54+
2655
mod config {
56+
use super::tiers::Tiers;
2757
use serde::Serialize;
2858

2959
#[derive(Serialize)]
@@ -32,11 +62,13 @@ mod config {
3262
pub platforms: Vec<String>,
3363
}
3464

65+
/// The Jekyll `_config.yaml` data.
3566
#[derive(Serialize)]
3667
pub struct Config {
3768
pub exclude: &'static [&'static str],
3869
pub rustup: Vec<String>,
3970
pub channels: indexmap::IndexMap<&'static str, Channel>,
71+
pub tiers: Tiers,
4072
}
4173
}
4274

@@ -53,10 +85,13 @@ const CHANNELS: &[&str] = &["stable", "beta", "nightly"];
5385
const CHANNEL_URL_PREFIX: &str = "https://static.rust-lang.org/dist/channel-rust-";
5486

5587
fn main() -> Result<(), Box<dyn Error>> {
88+
let tiers: tiers::Tiers = serde_yaml::from_reader(File::open("tiers.yaml")?)?;
89+
5690
let mut cfg = config::Config {
5791
exclude: &["target", "vendor"],
5892
rustup: Vec::new(),
5993
channels: IndexMap::with_capacity(CHANNELS.len()),
94+
tiers,
6095
};
6196

6297
let rustup_url_regex = Regex::new(r"^rustup/dist/([^/]+)/rustup-init(?:\.exe)?$").unwrap();

0 commit comments

Comments
 (0)