@@ -224,37 +224,33 @@ You may want to have upwards of 10 or 15 gigabytes available to build the compil
224224
225225Once you've created a ` bootstrap.toml ` , you are now ready to run
226226` x ` . There are a lot of options here, but let's start with what is
227- probably the best "go to" command for building a local compiler :
227+ probably the best "go to" command:
228228
229229``` console
230- ./x build rustc
230+ ./x build library
231231```
232232
233- What this command does is build ` rustc ` using the stage0 compiler and stage0 ` std ` .
233+ What this command does is the following:
234+ - Build in-tree rustc using stage0[ ^ stage0 ] rustc and std, producing stage1 rustc.
235+ - Build in-tree std using that (stage1) rustc, producing stage std.
234236
235- To build ` rustc ` with the in-tree ` std ` , use this command instead:
237+ This final product, stage1 rustc + std,
238+ is what you need to build other Rust programs
239+ (unless you use ` #![no_std] ` or ` #![no_core] ` ).
240+
241+ If your changes are only to rustc, you would save build time by using this hack:
236242
237243``` console
238- ./x build rustc --stage 2
244+ ./x build library --keep- stage-std 1
239245```
240246
241- This final product (stage1 compiler + libs built using that compiler)
242- is what you need to build other Rust programs (unless you use ` #![no_std] ` or
243- ` #![no_core] ` ).
244-
245- You will probably find that building the stage1 ` std ` is a bottleneck for you,
246- but fear not, there is a (hacky) workaround...
247- see [ the section on avoiding rebuilds for std] [ keep-stage ] .
248-
249- [ keep-stage ] : ./suggested.md#faster-builds-with---keep-stage
250-
251247Sometimes you don't need a full build. When doing some kind of
252248"type-based refactoring", like renaming a method, or changing the
253249signature of some function, you can use ` ./x check ` instead for a much faster build.
254250
255251Note that this whole command just gives you a subset of the full ` rustc `
256252build. The ** full** ` rustc ` build (what you get with `./x build
257- --stage 2 rustc `) has quite a few more steps:
253+ --stage 2 compiler `) has quite a few more steps:
258254
259255- Build ` rustc ` with the stage1 compiler.
260256 - The resulting compiler here is called the "stage2" compiler, which uses stage1 std from the previous command.
@@ -416,3 +412,4 @@ for each user, but this also applies to local development as well. Occasionally,
416412 are installed with ` rustup toolchain list ` .
417413
418414[ ^ 1 ] : issue[ #1707 ] ( https://github.com/rust-lang/rustc-dev-guide/issues/1707 )
415+ [ ^ stage0 ] : _ stage0_ means something already built, typically downloaded
0 commit comments