Skip to content

Add bootstrapping diagram #1421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion src/building/bootstrapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,32 @@ rustc, then uses it to compile the new compiler.

## Stages of bootstrapping

Compiling `rustc` is done in stages.
Compiling `rustc` is done in stages. Here's a diagram, adapted from Joshua Nelson's
[talk on bootstrapping][rustconf22-talk] at RustConf 2022, with detailed explanations below.

The `A`, `B`, `C`, and `D` show the ordering of the stages of bootstrapping.
<span style="background-color: lightblue">Blue</span> nodes are downloaded,
<span style="background-color: yellow">yellow</span> nodes are built with the stage0 compiler, and
<span style="background-color: lightgreen">green</span> nodes are built with the stage1 compiler.

[rustconf22-talk]: https://rustconf.com/schedule#bootstrapping-the-once-and-future-compiler

```mermaid
graph TD
s0c["stage0 compiler (1.63)"]:::downloaded -->|A| s0l("stage0 std (1.64)"):::with-s0c;
s0c & s0l --- stepb[ ]:::empty;
stepb -->|B| s0ca["stage0 compiler artifacts (1.64)"]:::with-s0c;
s0ca -->|copy| s1c["stage1 compiler (1.64)"]:::with-s0c;
s1c -->|C| s1l("stage1 std (1.64)"):::with-s1c;
s1c & s1l --- stepd[ ]:::empty;
stepd -->|D| s1ca["stage1 compiler artifacts (1.64)"]:::with-s1c;
s1ca -->|copy| s2c["stage2 compiler"]:::with-s1c;

classDef empty width:0px,height:0px;
classDef downloaded fill: lightblue;
classDef with-s0c fill: yellow;
classDef with-s1c fill: lightgreen;
```

### Stage 0

Expand Down