@@ -20,6 +20,42 @@ your `.git/hooks` folder as `pre-push` (without the `.sh` extension!).
2020
2121You 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. Also, the outer
57+ extension/config always overrides the inner ones.
58+
2359## Configuring ` rust-analyzer ` for ` rustc `
2460
2561### Project-local rust-analyzer setup
0 commit comments