about summary refs log tree commit diff
diff options
context:
space:
mode:
authoronur-ozkan <work@onurozkan.dev>2025-03-25 20:17:32 +0300
committeronur-ozkan <work@onurozkan.dev>2025-04-15 11:32:56 +0300
commit89e3befe63f35b7556614d85ce63214f62a9a771 (patch)
tree8052a0303817d703d8ccfefb03e312ffebe8bc8f
parent1c1febc59db038876d7fe78a1f056bf324fdff6a (diff)
downloadrust-89e3befe63f35b7556614d85ce63214f62a9a771.tar.gz
rust-89e3befe63f35b7556614d85ce63214f62a9a771.zip
document config extensions
Signed-off-by: onur-ozkan <work@onurozkan.dev>
-rw-r--r--src/doc/rustc-dev-guide/src/building/suggested.md36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/doc/rustc-dev-guide/src/building/suggested.md b/src/doc/rustc-dev-guide/src/building/suggested.md
index 43ff2ba726f..5d37a78af88 100644
--- a/src/doc/rustc-dev-guide/src/building/suggested.md
+++ b/src/doc/rustc-dev-guide/src/building/suggested.md
@@ -20,6 +20,42 @@ your `.git/hooks` folder as `pre-push` (without the `.sh` extension!).
 
 You can also install the hook as a step of running `./x setup`!
 
+## Config extensions
+
+When working on different tasks, you might need to switch between different bootstrap configurations.
+Sometimes you may want to keep an old configuration for future use. But saving raw config values in
+random files and manually copying and pasting them can quickly become messy, especially if you have a
+long history of different configurations.
+
+To simplify managing multiple configurations, you can create config extensions.
+
+For example, you can create a simple config file named `cross.toml`:
+
+```toml
+[build]
+build = "x86_64-unknown-linux-gnu"
+host = ["i686-unknown-linux-gnu"]
+target = ["i686-unknown-linux-gnu"]
+
+
+[llvm]
+download-ci-llvm = false
+
+[target.x86_64-unknown-linux-gnu]
+llvm-config = "/path/to/llvm-19/bin/llvm-config"
+```
+
+Then, include this in your `bootstrap.toml`:
+
+```toml
+include = ["cross.toml"]
+```
+
+You can also include extensions within extensions recursively.
+
+**Note:** In the `include` field, the overriding logic follows a right-to-left order. Also, the outer
+extension/config always overrides the inner ones.
+
 ## Configuring `rust-analyzer` for `rustc`
 
 ### Project-local rust-analyzer setup