From ff242ed600781b1f7185534873166fabda4b2434 Mon Sep 17 00:00:00 2001 From: Noah Lev Date: Tue, 9 Aug 2022 14:19:33 -0700 Subject: [PATCH 1/3] Add bootstrapping diagram This diagram is based on the diagram in Joshua Nelson's talk on bootstrapping at RustConf 2022 [1]. I converted it to Mermaid and made some tweaks to simplify it and bring it closer to bootstrap's terminology, and then Ralf Jung added nodes for copying artifacts. [1]: https://rustconf.com/schedule#bootstrapping-the-once-and-future-compiler Co-authored-by: Joshua Nelson Co-authored-by: Ralf Jung --- src/building/bootstrapping.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/building/bootstrapping.md b/src/building/bootstrapping.md index fd54de20c..878a09e7a 100644 --- a/src/building/bootstrapping.md +++ b/src/building/bootstrapping.md @@ -18,7 +18,25 @@ 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. + +[rustconf22-talk]: https://rustconf.com/schedule#bootstrapping-the-once-and-future-compiler + +```mermaid +graph TD + s0c["stage0 compiler (1.63)"] -->|A| s0l("stage0 std (1.64)"); + s0c & s0l --- stepb[ ]:::empty; + stepb -->|B| s0ca["stage0 compiler artifacts (1.64)"]; + s0ca -->|copy| s1c["stage1 compiler (1.64)"]; + s1c -->|C| s1l("stage1 std (1.64)"); + s1c & s1l --- stepd[ ]:::empty; + stepd -->|D| s1ca["stage1 compiler artifacts (1.64)"]; + s1ca -->|copy| s2c["stage2 compiler"]; + + classDef empty width:0px,height:0px; +``` ### Stage 0 From a4a87f1d2def18fd6e9d69f924498820328948bf Mon Sep 17 00:00:00 2001 From: Noah Lev Date: Tue, 9 Aug 2022 14:36:49 -0700 Subject: [PATCH 2/3] Add colors to diagram --- src/building/bootstrapping.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/building/bootstrapping.md b/src/building/bootstrapping.md index 878a09e7a..0564d0d7a 100644 --- a/src/building/bootstrapping.md +++ b/src/building/bootstrapping.md @@ -20,22 +20,27 @@ rustc, then uses it to compile the new compiler. 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. +Yellow nodes are built with the stage0 compiler, and +green 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)"] -->|A| s0l("stage0 std (1.64)"); + s0c["stage0 compiler (1.63)"] -->|A| s0l("stage0 std (1.64)"):::with-s0c; s0c & s0l --- stepb[ ]:::empty; - stepb -->|B| s0ca["stage0 compiler artifacts (1.64)"]; - s0ca -->|copy| s1c["stage1 compiler (1.64)"]; - s1c -->|C| s1l("stage1 std (1.64)"); + 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)"]; - s1ca -->|copy| s2c["stage2 compiler"]; + stepd -->|D| s1ca["stage1 compiler artifacts (1.64)"]:::with-s1c; + s1ca -->|copy| s2c["stage2 compiler"]:::with-s1c; classDef empty width:0px,height:0px; + classDef with-s0c fill: yellow; + classDef with-s1c fill: lightgreen, color: black; ``` ### Stage 0 From ec84bd1a5e1f7c42648bedaee3dcef8921ffcedb Mon Sep 17 00:00:00 2001 From: Noah Lev Date: Tue, 9 Aug 2022 14:39:22 -0700 Subject: [PATCH 3/3] Add color for downloaded nodes --- src/building/bootstrapping.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/building/bootstrapping.md b/src/building/bootstrapping.md index 0564d0d7a..259b10fc4 100644 --- a/src/building/bootstrapping.md +++ b/src/building/bootstrapping.md @@ -22,14 +22,15 @@ Compiling `rustc` is done in stages. Here's a diagram, adapted from Joshua Nelso [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. -Yellow nodes are built with the stage0 compiler, and +Blue nodes are downloaded, +yellow nodes are built with the stage0 compiler, and green 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)"] -->|A| s0l("stage0 std (1.64)"):::with-s0c; + 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; @@ -39,8 +40,9 @@ graph TD 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, color: black; + classDef with-s1c fill: lightgreen; ``` ### Stage 0