Skip to content

Commit 20d880e

Browse files
committed
Use _both_ models for stages
1 parent 2924b69 commit 20d880e

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

src/building/bootstrapping.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,38 @@ first build the new compiler with an older compiler and then use that to
2727
build the new compiler with itself. For development, you usually only want
2828
the `stage1` compiler: `x.py build library/std`.
2929

30+
## Where do stages start and end?
31+
32+
A common question is what exactly happens when you run `x.py build` or `x.py test`.
33+
Does `--stage 1` mean to _build_ the stage 1 artifacts or to _run_ them?
34+
In fact, it means both!
35+
36+
<!-- TODO: label each of the cells with the name of the directory in `build` it corresponds to -->
37+
38+
![stages](./stages.png)
39+
40+
So, for example, when you run `x.py test [--stage 1]`,
41+
that means to build the compiler in row 1 and column 0, then run it on the testsuite.
42+
This corresponds to the `run-stage` diagram.
43+
However, when you run `x.py build [--stage 1]`, that means to build the compiler in
44+
row 2 and column 1. This corresponds to the `link-stage` diagram.
45+
Building any of the items in the diagram also requires first building all items with arrows pointing to it.
46+
47+
### What are `run-stage` and `link-stage`?
48+
49+
`run-stage` means that this deals with _running_ the compiler,
50+
so `--stage N` refers to the artifacts in `build/stageN`.
51+
52+
`link-stage` means that this deals with _building_ the compiler,
53+
and it refers to `build/stageN-component`.
54+
55+
`build/stageN` is suitable for use with `rustup toolchain link`,
56+
but `stageN-component` never has enough components to be usable (since it only has one).
57+
Copying these artifacts from `stage(N-1)-component` to `stageN`
58+
is called _uplifting_ the artifacts to `stageN`.
59+
60+
<!-- TODO: say _why_ build-stage exists and is separate. -->
61+
3062
## Complications of bootstrapping
3163

3264
Since the build system uses the current beta compiler to build the stage-1

src/building/stages.png

91.9 KB
Loading

0 commit comments

Comments
 (0)