From ebe6c4cdfee3e67848208563c5315d1f575be817 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Sun, 9 Nov 2025 18:11:25 +0530 Subject: [PATCH 1/2] update the bootstrap readme --- src/bootstrap/README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/bootstrap/README.md b/src/bootstrap/README.md index 12e09cb07dbb2..f15b58fee3783 100644 --- a/src/bootstrap/README.md +++ b/src/bootstrap/README.md @@ -28,14 +28,14 @@ compiler. What actually happens when you invoke bootstrap is: `x.py` cross-platform) is run. This script is responsible for downloading the stage0 compiler/Cargo binaries, and it then compiles the build system itself (this folder). Finally, it then invokes the actual `bootstrap` binary build system. -2. In Rust, `bootstrap` will slurp up all configuration, perform a number of - sanity checks (whether compilers exist, for example), and then start building the - stage0 artifacts. -3. The stage0 `cargo`, downloaded earlier, is used to build the standard library - and the compiler, and then these binaries are then copied to the `stage1` - directory. That compiler is then used to generate the stage1 artifacts which - are then copied to the stage2 directory, and then finally, the stage2 - artifacts are generated using that compiler. +2. In Rust, the bootstrap binary reads all configuration, performs a number of sanity + checks (for example, verifying toolchains and paths), and then prepares to build the + stage 1 compiler and libraries using the prebuilt stage 0 compiler. +3. The stage 0 compiler and standard library, downloaded earlier, are used to build the + stage 1 compiler, which links against the beta standard library. The newly built stage 1 + compiler is then used to build the stage 1 standard library. After that, the stage 1 + compiler is used once more to produce the stage 2 compiler, which links against the + stage 1 standard library. The goal of each stage is to (a) leverage Cargo as much as possible and failing that (b) leverage Rust as much as possible! @@ -167,7 +167,6 @@ build/ # no extra build output in these directories. stage1/ stage2/ - stage3/ ``` ## Extending bootstrap @@ -177,8 +176,9 @@ When you use bootstrap, you'll call it through the entry point script `bootstrap` has a difficult problem: it is written in Rust, but yet it is run before the Rust compiler is built! To work around this, there are two components of bootstrap: the main one written in rust, and `bootstrap.py`. `bootstrap.py` -is what gets run by entry point script. It takes care of downloading the `stage0` -compiler, which will then build the bootstrap binary written in Rust. +is what gets run by entry point script. It takes care of downloading the prebuilt +stage 0 compiler, std and Cargo binaries, which are then used to build the +bootstrap binary. Because there are two separate codebases behind `x.py`, they need to be kept in sync. In particular, both `bootstrap.py` and the bootstrap binary From 425c7047c38a94980dabda48c7755c8b4204e7de Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Mon, 10 Nov 2025 20:57:53 +0530 Subject: [PATCH 2/2] use consistent terminology here. It might not be beta if we overrode the stage0 rustc. --- src/bootstrap/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/README.md b/src/bootstrap/README.md index f15b58fee3783..dcf2221b8bfc2 100644 --- a/src/bootstrap/README.md +++ b/src/bootstrap/README.md @@ -32,7 +32,7 @@ compiler. What actually happens when you invoke bootstrap is: checks (for example, verifying toolchains and paths), and then prepares to build the stage 1 compiler and libraries using the prebuilt stage 0 compiler. 3. The stage 0 compiler and standard library, downloaded earlier, are used to build the - stage 1 compiler, which links against the beta standard library. The newly built stage 1 + stage 1 compiler, which links against the stage 0 standard library. The newly built stage 1 compiler is then used to build the stage 1 standard library. After that, the stage 1 compiler is used once more to produce the stage 2 compiler, which links against the stage 1 standard library.