Skip to content

Commit 02f25b8

Browse files
committed
Auto merge of #140043 - ChrisDenton:rollup-vwf0s9j, r=ChrisDenton
Rollup of 8 pull requests Successful merges: - #138934 (support config extensions) - #139091 (Rewrite on_unimplemented format string parser.) - #139753 (Make `#[naked]` an unsafe attribute) - #139762 (Don't assemble non-env/bound candidates if projection is rigid) - #139834 (Don't canonicalize crate paths) - #139868 (Move `pal::env` to `std::sys::env_consts`) - #139978 (Add citool command for generating a test dashboard) - #139995 (Clean UI tests 4 of n) r? `@ghost` `@rustbot` modify labels: rollup
2 parents a63811d + 03103fe commit 02f25b8

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

src/building/suggested.md

+37
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,43 @@ your `.git/hooks` folder as `pre-push` (without the `.sh` extension!).
2020

2121
You can also install the hook as a step of running `./x setup`!
2222

23+
## Config extensions
24+
25+
When working on different tasks, you might need to switch between different bootstrap configurations.
26+
Sometimes you may want to keep an old configuration for future use. But saving raw config values in
27+
random files and manually copying and pasting them can quickly become messy, especially if you have a
28+
long history of different configurations.
29+
30+
To simplify managing multiple configurations, you can create config extensions.
31+
32+
For example, you can create a simple config file named `cross.toml`:
33+
34+
```toml
35+
[build]
36+
build = "x86_64-unknown-linux-gnu"
37+
host = ["i686-unknown-linux-gnu"]
38+
target = ["i686-unknown-linux-gnu"]
39+
40+
41+
[llvm]
42+
download-ci-llvm = false
43+
44+
[target.x86_64-unknown-linux-gnu]
45+
llvm-config = "/path/to/llvm-19/bin/llvm-config"
46+
```
47+
48+
Then, include this in your `bootstrap.toml`:
49+
50+
```toml
51+
include = ["cross.toml"]
52+
```
53+
54+
You can also include extensions within extensions recursively.
55+
56+
**Note:** In the `include` field, the overriding logic follows a right-to-left order. For example,
57+
in `include = ["a.toml", "b.toml"]`, extension `b.toml` overrides `a.toml`. Also, parent extensions
58+
always overrides the inner ones.
59+
2360
## Configuring `rust-analyzer` for `rustc`
2461

2562
### Project-local rust-analyzer setup

0 commit comments

Comments
 (0)