Skip to content

Commit 8cbf9d0

Browse files
committed
fix typo, add link
1 parent 4a6c34a commit 8cbf9d0

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

src/how-to-build-and-run.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ use-jemalloc = false
4949

5050
### Running x.py and building a stage1 compiler
5151

52-
One thing to keep in mind is that `rustc` is a _bootstrapping_ compiler. That
53-
is, since `rustc` is written in Rust, we need to use an older version of the
54-
compiler to compile the newer version. In particular, the newer version of the
55-
compiler, `libstd`, and other tooling may use some unstable features
56-
internally. The result is the compiling `rustc` is done in stages:
52+
One thing to keep in mind is that `rustc` is a _bootstrapping_
53+
compiler. That is, since `rustc` is written in Rust, we need to use an
54+
older version of the compiler to compile the newer version. In
55+
particular, the newer version of the compiler, `libstd`, and other
56+
tooling may use some unstable features internally. The result is that
57+
compiling `rustc` is done in stages:
5758

5859
- **Stage 0:** the stage0 compiler is usually the current _beta_ compiler
5960
(`x.py` will download it for you); you can configure `x.py` to use something
@@ -73,10 +74,11 @@ internally. The result is the compiling `rustc` is done in stages:
7374
with stage1.)
7475
- **Stage 2:** we rebuild our stage1 compiler with itself to produce
7576
the stage2 compiler (i.e. it builds itself) to have all the _latest
76-
optimizations_.
77+
optimizations_. (By default, we copy the stage1 libraries for use by
78+
the stage2 compiler, since they ought to be identical.)
7779
- _(Optional)_ **Stage 3**: to sanity check of our new compiler, we
78-
can build it again with stage2 compiler which must be identical to
79-
itself, unless something has broken.
80+
can build the libraries with the stage2 compiler. The result ought
81+
to be identical to before, unless something has broken.
8082

8183
For hacking, often building the stage 1 compiler is enough, but for
8284
final testing and release, the stage 2 compiler is used.
@@ -86,7 +88,7 @@ It is, in particular, very useful when you're doing some kind of
8688
"type-based refactoring", like renaming a method, or changing the
8789
signature of some function.
8890

89-
<a name=command>
91+
<a name=command></a>
9092

9193
Once you've created a config.toml, you are now ready to run
9294
`x.py`. There are a lot of options here, but let's start with what is
@@ -104,8 +106,8 @@ What this command does is the following:
104106
- This produces the stage1 compiler
105107
- Build libstd using the stage1 compiler (cannot use incremental)
106108

107-
This final product (stage1 compiler + libs build using that compiler)
108-
is what you need to build other rust programs.
109+
This final product (stage1 compiler + libs built using that compiler)
110+
is what you need to build other rust programs.
109111

110112
Note that the command includes the `-i` switch. This enables incremental
111113
compilation. This will be used to speed up the first two steps of the process:
@@ -125,7 +127,7 @@ Note that this whole command just gives you a subset of the full rustc
125127
build. The **full** rustc build (what you get if you just say `./x.py
126128
build`) has quite a few more steps:
127129

128-
- Build librustc rustc with the stage1 compiler.
130+
- Build librustc and rustc with the stage1 compiler.
129131
- The resulting compiler here is called the "stage2" compiler.
130132
- Build libstd with stage2 compiler.
131133
- Build librustdoc and a bunch of other things with the stage2 compiler.
@@ -168,7 +170,7 @@ release: 1.25.0-dev
168170
LLVM version: 4.0
169171
```
170172

171-
<a name=workflow>
173+
<a name=workflow></a>
172174

173175
### Suggested workflows for faster builds of the compiler
174176

@@ -188,7 +190,7 @@ refactoring commits and only run the tests at some later time. You can
188190
then use `git bisect` to track down **precisely** which commit caused
189191
the problem. A nice side-effect of this style is that you are left
190192
with a fairly fine-grained set of commits at the end, all of which
191-
build and pass testes. This often helps reviewing.
193+
build and pass tests. This often helps reviewing.
192194

193195
**Incremental builds with `--keep-stage`.** Sometimes just checking
194196
whether the compiler builds is not enough. A common example is that
@@ -216,7 +218,7 @@ encodes types and other states into the `rlib` files, or if you are editing
216218
things that wind up in the metadata (such as the definition of the MIR).
217219

218220
**The TL;DR is that you might get weird behavior from a compile when
219-
using `--keep-stage 1`** -- for example, strange ICEs or other
221+
using `--keep-stage 1`** -- for example, strange [ICEs](appendix/glossary.html) or other
220222
panics. In that case, you should simply remove the `--keep-stage 1`
221223
from the command and rebuild. That ought to fix the problem.
222224

0 commit comments

Comments
 (0)