@@ -27,6 +27,38 @@ first build the new compiler with an older compiler and then use that to
27
27
build the new compiler with itself. For development, you usually only want
28
28
the ` stage1 ` compiler: ` x.py build library/std ` .
29
29
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
+
30
62
## Complications of bootstrapping
31
63
32
64
Since the build system uses the current beta compiler to build the stage-1
0 commit comments