Skip to content

Commit e2620a8

Browse files
committed
add a bit more
1 parent 2abbee9 commit e2620a8

File tree

1 file changed

+62
-4
lines changed

1 file changed

+62
-4
lines changed

src/getting-started.md

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,24 @@ After updating `config.toml`, as mentioned above, you can use `./x.py`:
147147
```shell
148148
# Build the compiler (stage 1)
149149
./x.py build --stage 1
150+
151+
# Subsequent builds
152+
./x.py build --stage 1 --keep-stage 1
150153
```
151154

152155
This will take a while, especially the first time. Be wary of accidentally
153156
touching or formatting the compiler, as `./x.py` will try to recompile it.
154157

158+
**NOTE**: The `--keep-stage 1` will _assume_ that the stage 0 standard library
159+
does not need to be rebuilt, which is usually true, which will save some time.
160+
However, if you are changing certain parts of the compiler, this may lead to
161+
weird errors. Feel free to ask on [zulip][z] if you are running into issues.
162+
155163
To run the compiler's UI test suite (the bulk of the test suite):
156164

157165
```
158166
# UI tests
159-
./x.py test --stage 1 src/test/ui
167+
./x.py test --stage 1 src/test/ui [--keep-stage 1]
160168
```
161169

162170
This will build the compiler first, if needed.
@@ -190,15 +198,65 @@ You can use `RUSTC_LOG=XXX` to get debug logging. [Read more here][logging].
190198

191199
### Building and Testing `std`/`core`/`alloc`/`test`/`proc_macro`/etc.
192200

193-
TODO
201+
To contribute to `libstd`, you don't need to build the compiler unless you are
202+
planning to use a recently added nightly feature. Instead, you can just build
203+
stage 0.
204+
205+
```sh
206+
./x.py build --stage 0 src/libstd
207+
```
208+
209+
TODO: how to test?
194210

195211
### Building and Testing `rustdoc`
196212

197-
TODO
213+
`rustdoc` uses `rustc` internals (and, of course, the standard library), so you
214+
will have to build the compiler and `std` once before you can build `rustdoc`.
215+
216+
The following command will build all of them. Stage 1 should be sufficient,
217+
even though the release version will use the full 2-stage build.
218+
219+
```sh
220+
# First build
221+
./x.py build --stage 1 src/tools/rustdoc
222+
223+
# Subsequent builds
224+
./x.py build --stage 1 --keep-stage 1 src/tools/rustdoc
225+
```
226+
227+
You can also use `./x.py check` here to do a fast check build.
228+
229+
TODO: how to test?
198230

199231
### Contributing code to other Rust projects
200232

201-
TODO: talk about things like miri, clippy, chalk, etc
233+
There are a bunch of other projects that one can contribute too outside of the
234+
`rust-lang/rust` repo, including `clippy`, `miri`, `chalk`, and many others.
235+
236+
These repos might have their own contributing guidelines and procedures. Many
237+
of them are owned by working groups (e.g. `chalk` is largely owned by
238+
WG-traits). For more info, see the documentation in those repos' READMEs.
239+
240+
### Other ways to contribute
241+
242+
There are a bunch of other ways you can contribute, especially if you don't
243+
feel comfortable jumping straight into the large `rust-lang/rust` codebase.
244+
245+
The following tasks are doable without much background knowledge but are
246+
incredibly helpful:
247+
248+
- [ICE-breakers Cleanup crew][iceb]: find minimal reproductions of ICEs, bisect
249+
regressions, etc. This is a way of helping that saves a ton of time for
250+
others to fix an error later.
251+
- Writing documentation: if you are feeling a bit more intrepid, you could try
252+
to read a part of the code and write doc comments for it. This will help you
253+
to learn some part of the compiler while also producing a useful artifact!
254+
- [Working groups][wg]: there are a bunch of working groups on a wide variety
255+
of rust-related things.
256+
257+
[iceb]: ./ice-breaker/cleanup-crew.md
258+
[wg]: https://rust-lang.github.io/compiler-team/working-groups/
259+
202260

203261
## Contributor Procedures
204262

0 commit comments

Comments
 (0)