Skip to content

Commit 9c6beb5

Browse files
tshepangspastorino
authored andcommitted
merge libtest build step with libstd (#434)
Partially handles #431
1 parent 1c16c51 commit 9c6beb5

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

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

+9-22
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ The result is that compiling `rustc` is done in stages:
6969
- **Stage 0:** the stage0 compiler is usually (you can configure `x.py` to use
7070
something else) the current _beta_ `rustc` compiler and its associated dynamic
7171
libraries (which `x.py` will download for you). This stage0 compiler is then
72-
used only to compile `rustbuild`, `std`, `test`, and `rustc`. When compiling
73-
`test` and `rustc`, this stage0 compiler uses the freshly compiled `std`.
72+
used only to compile `rustbuild`, `std`, and `rustc`. When compiling
73+
`rustc`, this stage0 compiler uses the freshly compiled `std`.
7474
There are two concepts at play here: a compiler (with its set of dependencies)
75-
and its 'target' or 'object' libraries (`std`, `test`, and `rustc`).
75+
and its 'target' or 'object' libraries (`std` and `rustc`).
7676
Both are staged, but in a staggered manner.
7777
- **Stage 1:** the code in your clone (for new version) is then
7878
compiled with the stage0 compiler to produce the stage1 compiler.
@@ -102,17 +102,13 @@ When running `x.py` you will see output such as:
102102
```txt
103103
Building stage0 std artifacts
104104
Copying stage0 std from stage0
105-
Building stage0 test artifacts
106-
Copying stage0 test from stage0
107105
Building stage0 compiler artifacts
108106
Copying stage0 rustc from stage0
109107
Building LLVM for x86_64-apple-darwin
110108
Building stage0 codegen artifacts
111109
Assembling stage1 compiler
112110
Building stage1 std artifacts
113111
Copying stage1 std from stage1
114-
Building stage1 test artifacts
115-
Copying stage1 test from stage1
116112
Building stage1 compiler artifacts
117113
Copying stage1 rustc from stage1
118114
Building stage1 codegen artifacts
@@ -127,13 +123,10 @@ Building rustdoc for stage2
127123
Documenting book redirect pages
128124
Documenting stage2 std
129125
Building rustdoc for stage1
130-
Documenting stage2 test
131126
Documenting stage2 whitelisted compiler
132127
Documenting stage2 compiler
133128
Documenting stage2 rustdoc
134129
Documenting error index
135-
Uplifting stage1 test
136-
Copying stage2 test from stage1
137130
Uplifting stage1 rustc
138131
Copying stage2 rustc from stage1
139132
Building stage2 tool error_index_generator
@@ -155,8 +148,6 @@ The following tables indicate the outputs of various stage actions:
155148
| `stage0` builds `bootstrap` | `build/bootstrap` |
156149
| `stage0` builds `libstd` | `build/HOST/stage0-std/TARGET` |
157150
| copy `stage0-std` (HOST only) | `build/HOST/stage0-sysroot/lib/rustlib/HOST` |
158-
| `stage0` builds `libtest` with `stage0-sysroot` | `build/HOST/stage0-test/TARGET` |
159-
| copy `stage0-test` (HOST only) | `build/HOST/stage0-sysroot/lib/rustlib/HOST` |
160151
| `stage0` builds `rustc` with `stage0-sysroot` | `build/HOST/stage0-rustc/HOST` |
161152
| copy `stage0-rustc (except executable)` | `build/HOST/stage0-sysroot/lib/rustlib/HOST` |
162153
| build `llvm` | `build/HOST/llvm` |
@@ -172,8 +163,6 @@ The following tables indicate the outputs of various stage actions:
172163
| copy (uplift) `stage0-sysroot` to `stage1` | `build/HOST/stage1/lib` |
173164
| `stage1` builds `libstd` | `build/HOST/stage1-std/TARGET` |
174165
| copy `stage1-std` (HOST only) | `build/HOST/stage1/lib/rustlib/HOST` |
175-
| `stage1` builds `libtest` | `build/HOST/stage1-test/TARGET` |
176-
| copy `stage1-test` (HOST only) | `build/HOST/stage1/lib/rustlib/HOST` |
177166
| `stage1` builds `rustc` | `build/HOST/stage1-rustc/HOST` |
178167
| copy `stage1-rustc` (except executable) | `build/HOST/stage1/lib/rustlib/HOST` |
179168
| `stage1` builds `codegen` | `build/HOST/stage1-codegen/HOST` |
@@ -186,8 +175,6 @@ The following tables indicate the outputs of various stage actions:
186175
| copy (uplift) `stage1-sysroot` | `build/HOST/stage2/lib and build/HOST/stage2/lib/rustlib/HOST` |
187176
| `stage2` builds `libstd` (except HOST?) | `build/HOST/stage2-std/TARGET` |
188177
| copy `stage2-std` (not HOST targets) | `build/HOST/stage2/lib/rustlib/TARGET` |
189-
| `stage2` builds `libtest` (except HOST?) | `build/HOST/stage2-test/TARGET` |
190-
| copy `stage2-test` (not HOST targets) | `build/HOST/stage2/lib/rustlib/TARGET` |
191178
| `stage2` builds `rustdoc` | `build/HOST/stage2-tools/HOST` |
192179
| copy `rustdoc` | `build/HOST/stage2/bin` |
193180

@@ -201,10 +188,10 @@ Note that the convention `x.py` uses is that:
201188
In short, _stage 0 uses the stage0 compiler to create stage0 artifacts which
202189
will later be uplifted to stage1_.
203190

204-
Every time any of the main artifacts (`std`, `test`, `rustc`) are compiled, two
191+
Every time any of the main artifacts (`std` and `rustc`) are compiled, two
205192
steps are performed.
206193
When `std` is compiled by a stage N compiler, that `std` will be linked to
207-
programs built by the stage N compiler (including test and `rustc` built later
194+
programs built by the stage N compiler (including `rustc` built later
208195
on). It will also be used by the stage (N+1) compiler to link against itself.
209196
This is somewhat intuitive if one thinks of the stage (N+1) compiler as "just"
210197
another program we are building with the stage N compiler. In some ways, `rustc`
@@ -213,7 +200,7 @@ another program we are building with the stage N compiler. In some ways, `rustc`
213200

214201
So "stage0 std artifacts" are in fact the output of the downloaded stage0
215202
compiler, and are going to be used for anything built by the stage0 compiler:
216-
e.g. `rustc`, `test` artifacts. When it announces that it is "building stage1
203+
e.g. `rustc` artifacts. When it announces that it is "building stage1
217204
std artifacts" it has moved on to the next bootstrapping phase. This pattern
218205
continues in latter stages.
219206

@@ -247,9 +234,9 @@ recompiling that `std`.
247234
`--keep-stage` simply assumes the previous compile is fine and copies those
248235
artifacts into the appropriate place, skipping the cargo invocation.
249236

250-
The reason we first build `std`, then `test`, then `rustc`, is largely just
237+
The reason we first build `std`, then `rustc`, is largely just
251238
because we want to minimize `cfg(stage0)` in the code for `rustc`.
252-
Currently `rustc` is always linked against a "new" `std`/`test` so it doesn't
239+
Currently `rustc` is always linked against a "new" `std` so it doesn't
253240
ever need to be concerned with differences in std; it can assume that the std is
254241
as fresh as possible.
255242

@@ -265,7 +252,7 @@ same libraries as the `stage2/bin/rustc` compiler uses itself for programs it
265252
links against.
266253

267254
This `stage2/bin/rustc` compiler is shipped to end-users, along with the
268-
`stage 1 {std,test,rustc}` artifacts.
255+
`stage 1 {std,rustc}` artifacts.
269256

270257
If you want to learn more about `x.py`, read its README.md
271258
[here](https://github.com/rust-lang/rust/blob/master/src/bootstrap/README.md).

0 commit comments

Comments
 (0)