Skip to content

Commit bbfa329

Browse files
committed
add blog post about docs.rs changed default targets
1 parent e688fb1 commit bbfa329

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
+++
2+
path = "2025/10/15/docsrs-changed-default-targets"
3+
title = "docs.rs: changed default targets"
4+
authors = ["Denis Cornehl"]
5+
6+
[extra]
7+
team = "the docs.rs team"
8+
team_url = "https://rust-lang.org/governance/teams/dev-tools/#team-docs-rs"
9+
+++
10+
11+
With Apple's transition from x86_64 to its own silicon (ARM64), the Rust project
12+
has updated its platform support tiers.
13+
14+
Consequently, the `aarch64-apple-darwin` target has been promoted to Tier 1,
15+
while the `x86_64-apple-darwin` target has been demoted to Tier 2. You can read
16+
more about this change in
17+
[RFC 3671](https://github.com/rust-lang/rfcs/pull/3671) and
18+
[RFC 3841](https://github.com/rust-lang/rfcs/pull/3841).
19+
20+
To align with this ecosystem shift, docs.rs is updating its default build
21+
targets.
22+
23+
Crates can provide [docs.rs metadata](https://docs.rs/about/metadata) to specify
24+
which targets to build for. If this metadata is not provided, docs.rs uses a
25+
default list of targets. We are now switching the default macOS target in this
26+
list from `x86_64-apple-darwin` to `aarch64-apple-darwin`.
27+
28+
The new default target list is:
29+
30+
- `x86_64-unknown-linux-gnu`
31+
- `aarch64-apple-darwin` (previously: `x86_64-apple-darwin`)
32+
- `x86_64-pc-windows-msvc`
33+
- `i686-unknown-linux-gnu`
34+
- `i686-pc-windows-msvc`
35+
36+
## If your crate requires the old target list
37+
38+
If your crate needs to be built for the previous default target list, you can
39+
explicitly define it using [docs.rs metadata](https://docs.rs/about/metadata) in
40+
your `Cargo.toml`:
41+
42+
```toml
43+
[package.metadata.docs.rs]
44+
targets = [
45+
"x86_64-unknown-linux-gnu",
46+
"x86_64-apple-darwin",
47+
"x86_64-pc-windows-msvc",
48+
"i686-unknown-linux-gnu",
49+
"i686-pc-windows-msvc"
50+
]
51+
```

0 commit comments

Comments
 (0)