@@ -224,37 +224,33 @@ You may want to have upwards of 10 or 15 gigabytes available to build the compil
224
224
225
225
Once you've created a ` bootstrap.toml ` , you are now ready to run
226
226
` 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:
228
228
229
229
``` console
230
- ./x build rustc
230
+ ./x build library
231
231
```
232
232
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.
234
236
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:
236
242
237
243
``` console
238
- ./x build rustc --stage 2
244
+ ./x build library --keep- stage-std 1
239
245
```
240
246
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
-
251
247
Sometimes you don't need a full build. When doing some kind of
252
248
"type-based refactoring", like renaming a method, or changing the
253
249
signature of some function, you can use ` ./x check ` instead for a much faster build.
254
250
255
251
Note that this whole command just gives you a subset of the full ` rustc `
256
252
build. 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:
258
254
259
255
- Build ` rustc ` with the stage1 compiler.
260
256
- 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,
416
412
are installed with ` rustup toolchain list ` .
417
413
418
414
[ ^ 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