@@ -249,51 +249,15 @@ lets you use `cargo fmt`.
249249[ the section on vscode ] : suggested.md#configuring-rust-analyzer-for-rustc
250250[ the section on rustup ] : how-to-build-and-run.md?highlight=rustup#creating-a-rustup-toolchain
251251
252- ## Faster builds with ` --keep-stage ` .
253-
254- Sometimes just checking whether the compiler builds is not enough. A common
255- example is that you need to add a ` debug! ` statement to inspect the value of
256- some state or better understand the problem. In that case, you don't really need
257- a full build. By bypassing bootstrap's cache invalidation, you can often get
258- these builds to complete very fast (e.g., around 30 seconds). The only catch is
259- this requires a bit of fudging and may produce compilers that don't work (but
260- that is easily detected and fixed).
261-
262- The sequence of commands you want is as follows:
263-
264- - Initial build: ` ./x build library `
265- - As [ documented previously] , this will build a functional stage1 compiler as
266- part of running all stage0 commands (which include building a ` std `
267- compatible with the stage1 compiler) as well as the first few steps of the
268- "stage 1 actions" up to "stage1 (sysroot stage1) builds std".
269- - Subsequent builds: ` ./x build library --keep-stage 1 `
270- - Note that we added the ` --keep-stage 1 ` flag here
271-
272- [ documented previously ] : ./how-to-build-and-run.md#building-the-compiler
273-
274- As mentioned, the effect of ` --keep-stage 1 ` is that we just _ assume_ that the
275- old standard library can be re-used. If you are editing the compiler, this is
276- almost always true: you haven't changed the standard library, after all. But
277- sometimes, it's not true: for example, if you are editing the "metadata" part of
278- the compiler, which controls how the compiler encodes types and other states
279- into the ` rlib ` files, or if you are editing things that wind up in the metadata
280- (such as the definition of the MIR).
281-
282- ** The TL;DR is that you might get weird behavior from a compile when using
283- ` --keep-stage 1 ` ** -- for example, strange [ ICEs] ( ../appendix/glossary.html#ice )
284- or other panics. In that case, you should simply remove the ` --keep-stage 1 `
285- from the command and rebuild. That ought to fix the problem.
286-
287- You can also use ` --keep-stage 1 ` when running tests. Something like this:
288-
289- - Initial test run: ` ./x test tests/ui `
290- - Subsequent test run: ` ./x test tests/ui --keep-stage 1 `
291-
292- ### Iterating the standard library with ` --keep-stage `
293-
294- If you are making changes to the standard library, you can use `./x build
295- --keep-stage 0 library` to iteratively rebuild the standard library without
296- rebuilding the compiler.
252+ ## Faster Builds with CI-rustc
253+
254+ If you are not working on the compiler, you often don't need to build the compiler tree.
255+ For example, you can skip building the compiler and only build the ` library ` tree or the
256+ tools under ` src/tools ` . To achieve that, you have to enable this by setting the ` download-rustc `
257+ option in your configuration. This tells bootstrap to use the latest nightly compiler for ` stage > 0 `
258+ steps, meaning it will have two precompiled compilers: stage0 compiler and ` download-rustc ` compiler
259+ for ` stage > 0 ` steps. This way, it will never need to build the in-tree compiler. As a result, your
260+ build time will be significantly reduced by not building the in-tree compiler.
297261
298262## Using incremental compilation
299263
0 commit comments