You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Clean up wording
- Suggest `build --stage 1 src/libstd`, which doesn't recompile rustc
twice unnecessarily
- Fix rustdoc globs which only work on Linux
- Add suggestion for `build --stage 0 src/libstd`
- Suggest `-j1` for very slow builds
- Suggesting letting CI run tests when using a slow machine
Copy file name to clipboardExpand all lines: src/getting-started.md
+18-12
Original file line number
Diff line number
Diff line change
@@ -83,12 +83,18 @@ you use your system's LLVM ([see below][configsec]).
83
83
84
84
Like `cargo`, the build system will use as many cores as possible. Sometimes
85
85
this can cause you to run low on memory. You can use `-j` to adjust the number
86
-
concurrent jobs.
86
+
concurrent jobs. If a full build takes more than ~45 minutes to an hour,
87
+
you are probably spending most of the time swapping memory in and out;
88
+
try using `-j1`.
87
89
88
-
Also, if you don't have too much free disk space, you may want to turn off
90
+
On a slow machine, the build times for rustc are very painful. Consider using
91
+
`./x.py check` instead of a full build and letting the automated tests run
92
+
when you push to GitHub.
93
+
94
+
If you don't have too much free disk space, you may want to turn off
89
95
incremental compilation ([see below][configsec]). This will make
90
-
compilation take longer, but will save a ton of space from the incremental
91
-
caches.
96
+
compilation take longer (especially after a rebase),
97
+
but will save a ton of space from the incremental caches.
92
98
93
99
### Cloning
94
100
@@ -169,10 +175,10 @@ should still read the rest of the section:
169
175
| Command | When to use it |
170
176
| --- | --- |
171
177
|`x.py check`| Quick check to see if things compile; rust-analyzer can run this automatically for you |
172
-
|`x.py build --stage 1`| Build just the 1st stage of the compiler; this is faster than building stage 2 and usually good enough|
173
-
|`x.py build --stage 1 --keep-stage 1`| Build the 1st stage of the compiler and skips rebuilding the library; this is useful after you've done an ordinary stage1 build to skip compilation time, but it can cause weird problems. (Just do a regular build to resolve.)|
174
-
|`x.py test --stage 1`|Run the test suite using the stage1 compiler (first build) |
175
-
|`x.py test --stage 1 --keep-stage 1`| Run the test suite using the stage1 compiler (subsequent builds)|
178
+
|`x.py build --stage 0 src/libstd`| Build only the standard library, without building the compiler|
179
+
|`x.py build --stage 1 src/libstd`| Build just the 1st stage of the compiler, along with the standard library; this is faster than building stage 2 and usually good enough|
180
+
|`x.py build --stage 1 --keep-stage 1 src/libstd`|Build the 1st stage of the compiler and skips rebuilding the standard library; this is useful after you've done an ordinary stage1 build to skip compilation time, but it can cause weird problems. (Just do a regular build to resolve.) |
181
+
|`x.py test --stage 1 [--keep-stage 1]`| Run the test suite using the stage1 compiler |
176
182
|`x.py test --stage 1 --bless [--keep-stage 1]`| Run the test suite using the stage1 compiler _and_ update expected test output. |
177
183
|`x.py build`| Do a full 2-stage build. You almost never want to do this. |
178
184
|`x.py test`| Do a full 2-stage build and run all tests. You almost never want to do this. |
@@ -197,10 +203,10 @@ For most contributions, you only need to build stage 1, which saves a lot of tim
197
203
198
204
```sh
199
205
# Build the compiler (stage 1)
200
-
./x.py build --stage 1
206
+
./x.py build --stage 1 src/libstd
201
207
202
208
# Subsequent builds
203
-
./x.py build --stage 1 --keep-stage 1
209
+
./x.py build --stage 1 --keep-stage 1 src/libstd
204
210
```
205
211
206
212
This will take a while, especially the first time. Be wary of accidentally
@@ -281,7 +287,7 @@ the stage-2 compiler, which of course requires a 2-stage build, described above
281
287
282
288
In practice, though, you don't need to build the compiler unless you are
283
289
planning to use a recently added nightly feature. Instead, you can just build
284
-
stage 0 (i.e. which basically just uses the current beta compiler).
290
+
stage 0, which uses the current beta compiler.
285
291
286
292
```sh
287
293
./x.py build --stage 0 src/libstd
@@ -326,7 +332,7 @@ Rustdoc has two types of tests: content tests and UI tests.
326
332
./x.py test --stage 1 src/test/rustdoc-ui
327
333
328
334
# Both at once
329
-
./x.py test --stage 1 src/test/rustdoc*
335
+
./x.py test --stage 1 src/test/rustdoc src/test/rustdoc-ui
0 commit comments