expand compilation stages
This commit is contained in:
parent
ed758ee494
commit
38a21e9ea6
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
The compiler is built using a tool called `x.py`. You will need to
|
The compiler is built using a tool called `x.py`. You will need to
|
||||||
have Python installed to run it. But before we get to that, if you're going to
|
have Python installed to run it. But before we get to that, if you're going to
|
||||||
be hacking on rustc, you'll want to tweak the configuration of the compiler.
|
be hacking on `rustc`, you'll want to tweak the configuration of the compiler.
|
||||||
The default configuration is oriented towards running the compiler as a user,
|
The default configuration is oriented towards running the compiler as a user,
|
||||||
not a developer.
|
not a developer.
|
||||||
|
|
||||||
|
|
@ -55,13 +55,20 @@ compiler to compile the newer version. In particular, the newer version of the
|
||||||
compiler, `libstd`, and other tooling may use some unstable features
|
compiler, `libstd`, and other tooling may use some unstable features
|
||||||
internally. The result is the compiling `rustc` is done in stages.
|
internally. The result is the compiling `rustc` is done in stages.
|
||||||
|
|
||||||
- **Stage 0:** the stage0 compiler is the current _beta_ compiler; we
|
- **Stage 0:** the stage0 compiler can be your existing (perhaps older version of)
|
||||||
download this binary from the internet.
|
Rust compiler, the current _beta_ compiler or you may download the binary
|
||||||
- **Stage 1:** the code in your clone is then compiled with the stage
|
from the internet
|
||||||
0 compiler to produce the stage 1 compiler.
|
- **Stage 1:** the code in your clone (for new version)
|
||||||
- **Stage 2:** the code in your clone is then compiled with the stage
|
is then compiled with the stage0
|
||||||
1 compiler *again* to produce the stage 2 compiler (i.e. it builds
|
compiler to produce the stage1 compiler.
|
||||||
itself).
|
However, it was built with an older compiler (stage0),
|
||||||
|
so to optimize the stage1 compiler we go to next stage
|
||||||
|
- **Stage 2:** we rebuild our stage1 compiler with itself
|
||||||
|
to produce the stage2 compiler (i.e. it builds
|
||||||
|
itself) to have all the _latest optimizations_
|
||||||
|
- _(Optional)_ **Stage 3**: to sanity check of our new compiler, we can build it again
|
||||||
|
with stage2 compiler which must be identical to itself,
|
||||||
|
unless something has broken
|
||||||
|
|
||||||
For hacking, often building the stage 1 compiler is enough, but for
|
For hacking, often building the stage 1 compiler is enough, but for
|
||||||
final testing and release, the stage 2 compiler is used.
|
final testing and release, the stage 2 compiler is used.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue