Skip to content

Commit f2103f7

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 f49ef24 commit f2103f7

File tree

1 file changed

+8
-38
lines changed

1 file changed

+8
-38
lines changed

book/src/tutorial/building.md

+8-38
Original file line numberDiff line numberDiff line change
@@ -3,62 +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,compiler_builtins,alloc \
28-
-Zbuild-std-features=compiler-builtins-mem
28+
cargo build --target x86_64-unknown-uefi
2929
```
3030

3131
This will produce an x86-64 executable:
3232
`target/x86_64-unknown-uefi/debug/my-uefi-app.efi`.
3333

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