@@ -310,51 +310,15 @@ lets you use `cargo fmt`.
310310[ the section on vscode ] : suggested.md#configuring-rust-analyzer-for-rustc
311311[ the section on rustup ] : how-to-build-and-run.md?highlight=rustup#creating-a-rustup-toolchain
312312
313- ## Faster builds with ` --keep-stage ` .
314-
315- Sometimes just checking whether the compiler builds is not enough. A common
316- example is that you need to add a ` debug! ` statement to inspect the value of
317- some state or better understand the problem. In that case, you don't really need
318- a full build. By bypassing bootstrap's cache invalidation, you can often get
319- these builds to complete very fast (e.g., around 30 seconds). The only catch is
320- this requires a bit of fudging and may produce compilers that don't work (but
321- that is easily detected and fixed).
322-
323- The sequence of commands you want is as follows:
324-
325- - Initial build: ` ./x build library `
326- - As [ documented previously] , this will build a functional stage1 compiler as
327- part of running all stage0 commands (which include building a ` std `
328- compatible with the stage1 compiler) as well as the first few steps of the
329- "stage 1 actions" up to "stage1 (sysroot stage1) builds std".
330- - Subsequent builds: ` ./x build library --keep-stage 1 `
331- - Note that we added the ` --keep-stage 1 ` flag here
332-
333- [ documented previously ] : ./how-to-build-and-run.md#building-the-compiler
334-
335- As mentioned, the effect of ` --keep-stage 1 ` is that we just _ assume_ that the
336- old standard library can be re-used. If you are editing the compiler, this is
337- almost always true: you haven't changed the standard library, after all. But
338- sometimes, it's not true: for example, if you are editing the "metadata" part of
339- the compiler, which controls how the compiler encodes types and other states
340- into the ` rlib ` files, or if you are editing things that wind up in the metadata
341- (such as the definition of the MIR).
342-
343- ** The TL;DR is that you might get weird behavior from a compile when using
344- ` --keep-stage 1 ` ** -- for example, strange [ ICEs] ( ../appendix/glossary.html#ice )
345- or other panics. In that case, you should simply remove the ` --keep-stage 1 `
346- from the command and rebuild. That ought to fix the problem.
347-
348- You can also use ` --keep-stage 1 ` when running tests. Something like this:
349-
350- - Initial test run: ` ./x test tests/ui `
351- - Subsequent test run: ` ./x test tests/ui --keep-stage 1 `
352-
353- ### Iterating the standard library with ` --keep-stage `
354-
355- If you are making changes to the standard library, you can use `./x build
356- --keep-stage 0 library` to iteratively rebuild the standard library without
357- rebuilding the compiler.
313+ ## Faster Builds with CI-rustc
314+
315+ If you are not working on the compiler, you often don't need to build the compiler tree.
316+ For example, you can skip building the compiler and only build the ` library ` tree or the
317+ tools under ` src/tools ` . To achieve that, you have to enable this by setting the ` download-rustc `
318+ option in your configuration. This tells bootstrap to use the latest nightly compiler for ` stage > 0 `
319+ steps, meaning it will have two precompiled compilers: stage0 compiler and ` download-rustc ` compiler
320+ for ` stage > 0 ` steps. This way, it will never need to build the in-tree compiler. As a result, your
321+ build time will be significantly reduced by not building the in-tree compiler.
358322
359323## Using incremental compilation
360324
0 commit comments