@@ -411,17 +411,17 @@ you can tell the bootstrap shim to print all env variables by adding `-vvv` to y
411411
412412This is an incomplete reference for the outputs generated by bootstrap:
413413
414- | Stage 0 Action | Output |
415- | -----------------------------------------------------------| ----------------------------------------------|
416- | ` beta ` extracted | ` build/HOST/stage0 ` |
417- | ` stage0 ` builds ` bootstrap ` | ` build/bootstrap ` |
418- | ` stage0 ` builds ` test ` /` std ` | ` build/HOST/stage0-std/TARGET ` |
419- | copy ` stage0-std ` (HOST only) | ` build/HOST/stage0-sysroot/lib/rustlib/HOST ` |
420- | ` stage0 ` builds ` rustc ` with ` stage0-sysroot ` | ` build/HOST/stage0-rustc/HOST ` |
421- | copy ` stage0-rustc ` (except executable) | ` build/HOST/stage0-sysroot/lib/rustlib/HOST ` |
422- | build ` llvm ` | ` build/HOST/llvm ` |
423- | ` stage0 ` builds ` codegen ` with ` stage0-sysroot ` | ` build/HOST/stage0-codegen/HOST ` |
424- | ` stage0 ` builds ` rustdoc ` , ` clippy ` , ` miri ` , with ` stage0-sysroot ` | ` build/HOST/stage0-tools/HOST ` |
414+ | Stage 0 Action | Output |
415+ | ------------------------------------------------------------------ | -------------------------------------------- |
416+ | ` beta ` extracted | ` build/HOST/stage0 ` |
417+ | ` stage0 ` builds ` bootstrap ` | ` build/bootstrap ` |
418+ | ` stage0 ` builds ` test ` /` std ` | ` build/HOST/stage0-std/TARGET ` |
419+ | copy ` stage0-std ` (HOST only) | ` build/HOST/stage0-sysroot/lib/rustlib/HOST ` |
420+ | ` stage0 ` builds ` rustc ` with ` stage0-sysroot ` | ` build/HOST/stage0-rustc/HOST ` |
421+ | copy ` stage0-rustc ` (except executable) | ` build/HOST/stage0-sysroot/lib/rustlib/HOST ` |
422+ | build ` llvm ` | ` build/HOST/llvm ` |
423+ | ` stage0 ` builds ` codegen ` with ` stage0-sysroot ` | ` build/HOST/stage0-codegen/HOST ` |
424+ | ` stage0 ` builds ` rustdoc ` , ` clippy ` , ` miri ` , with ` stage0-sysroot ` | ` build/HOST/stage0-tools/HOST ` |
425425
426426` --stage=0 ` stops here.
427427
@@ -448,3 +448,45 @@ This is an incomplete reference for the outputs generated by bootstrap:
448448| copy ` rustdoc ` | ` build/HOST/stage2/bin ` |
449449
450450` --stage=2 ` stops here.
451+
452+ ### Clarification of build command's stdout
453+
454+ In this part, we will investigate the build command's stdout in an action
455+ (similar, but more detailed and complete documentation compare to topic above).
456+ When you execute ` x.py build --dry-run ` command, the build output will be something
457+ like the following:
458+
459+ ``` text
460+ Building stage0 library artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
461+ Copying stage0 library from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
462+ Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
463+ Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
464+ Assembling stage1 compiler (x86_64-unknown-linux-gnu)
465+ Building stage1 library artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
466+ Copying stage1 library from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
467+ Building stage1 tool rust-analyzer-proc-macro-srv (x86_64-unknown-linux-gnu)
468+ Building rustdoc for stage1 (x86_64-unknown-linux-gnu)
469+ ```
470+
471+ #### Building stage0 {std,compiler} artifacts
472+
473+ These steps use the provided (downloaded, usually) compiler to compile the
474+ local Rust source into libraries we can use.
475+
476+ #### Copying stage0 {std,rustc}
477+
478+ This copies the library and compiler artifacts from Cargo into
479+ ` stage0-sysroot/lib/rustlib/{target-triple}/lib `
480+
481+ #### Assembling stage1 compiler
482+
483+ This copies the libraries we built in "building stage0 ... artifacts" into
484+ the stage1 compiler's lib directory. These are the host libraries that the
485+ compiler itself uses to run. These aren't actually used by artifacts the new
486+ compiler generates. This step also copies the rustc and rustdoc binaries we
487+ generated into ` build/$HOST/stage/bin ` .
488+
489+ The stage1/bin/rustc is a fully functional compiler, but it doesn't yet have
490+ any libraries to link built binaries or libraries to. The next 3 steps will
491+ provide those libraries for it; they are mostly equivalent to constructing
492+ the stage1/bin compiler so we don't go through them individually.
0 commit comments