Skip to content

Commit 9ee5417

Browse files
authored
Merge pull request #1720 from syphar/docs-rs-default-targets
add blog post about docs.rs changed default targets
2 parents b977cb2 + b5c65a7 commit 9ee5417

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
+++
2+
path = "2025/10/16/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+
# Changes to default build targets on docs.rs
12+
13+
This post announces two changes to the list of default targets used to build
14+
documentation on docs.rs.
15+
16+
Crate authors can specify a custom list of targets using
17+
[docs.rs metadata in `Cargo.toml`](https://docs.rs/about/metadata). If this
18+
metadata is not provided, docs.rs falls back to a default list. We are updating
19+
this list to better reflect the current state of the Rust ecosystem.
20+
21+
## Apple silicon (ARM64) replaces x86_64
22+
23+
Reflecting Apple's transition from x86_64 to its own ARM64 silicon, the Rust
24+
project has updated its platform support tiers. The `aarch64-apple-darwin`
25+
target is now Tier 1, while `x86_64-apple-darwin` has moved to Tier 2. You can
26+
read more about this in [RFC 3671](https://github.com/rust-lang/rfcs/pull/3671)
27+
and [RFC 3841](https://github.com/rust-lang/rfcs/pull/3841).
28+
29+
To align with this, docs.rs will now use `aarch64-apple-darwin` as the default
30+
target for Apple platforms instead of `x86_64-apple-darwin`.
31+
32+
## Linux ARM64 replaces 32-bit x86
33+
34+
Support for 32-bit `i686` architectures is declining, and major Linux
35+
distributions have begun to phase it out.
36+
37+
Consequently, we are replacing the `i686-unknown-linux-gnu` target with
38+
`aarch64-unknown-linux-gnu` in our default set.
39+
40+
## New default target list
41+
42+
The updated list of default targets is:
43+
44+
- `x86_64-unknown-linux-gnu`
45+
- `aarch64-apple-darwin` (replaces `x86_64-apple-darwin`)
46+
- `x86_64-pc-windows-msvc`
47+
- `aarch64-unknown-linux-gnu` (replaces `i686-unknown-linux-gnu`)
48+
- `i686-pc-windows-msvc`
49+
50+
## Opting out
51+
52+
If your crate requires the previous default target list, you can explicitly
53+
define it in your `Cargo.toml`:
54+
55+
```toml
56+
[package.metadata.docs.rs]
57+
targets = [
58+
"x86_64-unknown-linux-gnu",
59+
"x86_64-apple-darwin",
60+
"x86_64-pc-windows-msvc",
61+
"i686-unknown-linux-gnu",
62+
"i686-pc-windows-msvc"
63+
]
64+
```
65+
66+
Note that docs.rs continues to support any target available in the Rust
67+
toolchain; only the _default_ list has changed.

0 commit comments

Comments
 (0)