Skip to content

Commit 9237d5b

Browse files
book: Remove references to build-std
As of nightly-2022-11-10 the UEFI targets are tier 2 and available via rustup, so build-std isn't needed anymore.
1 parent ed1c0c4 commit 9237d5b

File tree

1 file changed

+8
-36
lines changed

1 file changed

+8
-36
lines changed

book/src/tutorial/building.md

+8-36
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,32 @@
33
## Nightly toolchain
44

55
Rust's nightly toolchain is currently required because uefi-rs uses some
6-
unstable features. The [`build-std`] feature we use to build the
7-
standard libraries is also unstable.
6+
unstable features.
87

98
The easiest way to set this up is using a [rustup toolchain file]. In
109
the root of your repository, add `rust-toolchain.toml`:
1110

1211
```toml
1312
[toolchain]
1413
channel = "nightly"
15-
components = ["rust-src"]
14+
targets = ["x86_64-unknown-uefi"]
1615
```
1716

17+
Here we have specified the `x86_64-unknown-uefi` target; there are also
18+
`i686-unknown-uefi` and `aarch64-unknown-uefi` targets available.
19+
1820
Note that nightly releases can sometimes break, so you might opt to pin
19-
to a specific release. For example, `channel = "nightly-2022-09-01"`.
21+
to a specific release. For example, `channel = "nightly-2022-11-10"`.
2022

2123
## Build the application
2224

2325
Run this command to build the application:
2426

2527
```sh
26-
cargo build --target x86_64-unknown-uefi \
27-
-Zbuild-std=core,alloc
28+
cargo build --target x86_64-unknown-uefi
2829
```
2930

3031
This will produce an x86-64 executable:
3132
`target/x86_64-unknown-uefi/debug/my-uefi-app.efi`.
3233

33-
## Simplifying the build command
34-
35-
The above build command is verbose and not easy to remember. With a bit
36-
of configuration we can simplify it a lot.
37-
38-
Create a `.cargo` directory in the root of the project:
39-
40-
```sh
41-
mkdir .cargo
42-
```
43-
44-
Create `.cargo/config.toml` with these contents:
45-
46-
```toml
47-
[build]
48-
target = "x86_64-unknown-uefi"
49-
50-
[unstable]
51-
build-std = ["core", "alloc"]
52-
```
53-
54-
Now you can build much more simply:
55-
56-
```sh
57-
cargo build
58-
```
59-
60-
[`build-std`]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std
61-
[`rust-toolchain.toml`]: https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file
62-
[rustup toolchain file]: https://rust-lang.github.io/rustup/concepts/toolchains.html
34+
[rustup toolchain file]: https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file

0 commit comments

Comments
 (0)