1
1
# Contributing to Rust
2
+ [ contributing-to-rust ] : #contributing-to-rust
2
3
3
4
Thank you for your interest in contributing to Rust! There are many ways to
4
5
contribute, and we appreciate all of them. This document is a bit long, so here's
@@ -18,18 +19,20 @@ hop on [#rust-internals][pound-rust-internals].
18
19
19
20
As a reminder, all contributors are expected to follow our [ Code of Conduct] [ coc ] .
20
21
21
- [ pound-rust-internals ] : http ://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals
22
+ [ pound-rust-internals ] : https ://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals
22
23
[ internals ] : https://internals.rust-lang.org
23
24
[ coc ] : https://www.rust-lang.org/conduct.html
24
25
25
26
## Feature Requests
27
+ [ feature-requests ] : #feature-requests
26
28
27
29
To request a change to the way that the Rust language works, please open an
28
30
issue in the [ RFCs repository] ( https://github.com/rust-lang/rfcs/issues/new )
29
31
rather than this one. New features and other significant language changes
30
32
must go through the RFC process.
31
33
32
34
## Bug Reports
35
+ [ bug-reports ] : #bug-reports
33
36
34
37
While bugs are unfortunate, they're a reality in software. We can't fix what we
35
38
don't know about, so please report liberally. If you're not sure if something
@@ -80,6 +83,7 @@ $ RUST_BACKTRACE=1 rustc ...
80
83
```
81
84
82
85
## The Build System
86
+ [ the-build-system ] : #the-build-system
83
87
84
88
Rust's build system allows you to bootstrap the compiler, run tests &
85
89
benchmarks, generate documentation, install a fresh build of Rust, and more.
@@ -94,6 +98,7 @@ system internals, try asking in [`#rust-internals`][pound-rust-internals].
94
98
[ bootstrap ] : https://github.com/rust-lang/rust/tree/master/src/bootstrap/
95
99
96
100
### Configuration
101
+ [ configuration ] : #configuration
97
102
98
103
Before you can start building the compiler you need to configure the build for
99
104
your system. In most cases, that will just mean using the defaults provided
@@ -125,6 +130,11 @@ file. If you still have a `config.mk` file in your directory - from
125
130
` ./configure ` - you may need to delete it for ` config.toml ` to work.
126
131
127
132
### Building
133
+ [ building ] : #building
134
+
135
+ Dependencies
136
+ - [ build dependencies] ( README.md#building-from-source )
137
+ - ` gdb ` 6.2.0 minimum, 7.1 or later recommended for test builds
128
138
129
139
The build system uses the ` x.py ` script to control the build process. This script
130
140
is used to build, test, and document various parts of the compiler. You can
@@ -194,6 +204,7 @@ Note: Previously `./configure` and `make` were used to build this project.
194
204
They are still available, but ` x.py ` is the recommended build system.
195
205
196
206
### Useful commands
207
+ [ useful-commands ] : #useful-commands
197
208
198
209
Some common invocations of ` x.py ` are:
199
210
@@ -234,6 +245,7 @@ Some common invocations of `x.py` are:
234
245
code.
235
246
236
247
### Using your local build
248
+ [ using-local-build ] : #using-local-build
237
249
238
250
If you use Rustup to manage your rust install, it has a feature called [ "custom
239
251
toolchains"] [ toolchain-link ] that you can use to access your newly-built compiler
@@ -262,6 +274,7 @@ stage 1. `python x.py build --stage 1 src/libstd src/tools/rustdoc` will build
262
274
rustdoc and libstd, which will allow rustdoc to be run with that toolchain.)
263
275
264
276
## Pull Requests
277
+ [ pull-requests ] : #pull-requests
265
278
266
279
Pull requests are the primary mechanism we use to change Rust. GitHub itself
267
280
has some [ great documentation] [ pull-requests ] on using the Pull Request feature.
@@ -326,20 +339,32 @@ it can be found
326
339
[ here] ( https://github.com/rust-lang/rust-wiki-backup/blob/master/Note-testsuite.md ) .
327
340
328
341
### External Dependencies
342
+ [ external-dependencies ] : #external-dependencies
329
343
330
344
Currently building Rust will also build the following external projects:
331
345
332
346
* [ clippy] ( https://github.com/rust-lang-nursery/rust-clippy )
333
347
* [ miri] ( https://github.com/solson/miri )
334
348
335
349
If your changes break one of these projects, you need to fix them by opening
336
- a pull request against the broken project. When you have opened a pull request,
337
- you can disable the tool via ` src/tools/toolstate.toml ` .
350
+ a pull request against the broken project asking to put the fix on a branch.
351
+ Then you can disable the tool building via ` src/tools/toolstate.toml ` .
352
+ Once the branch containing your fix is likely to be merged, you can point
353
+ the affected submodule at this branch.
354
+
355
+ Don't forget to also add your changes with
356
+
357
+ ```
358
+ git add path/to/submodule
359
+ ```
360
+
361
+ outside the submodule.
338
362
339
363
It can also be more convenient during development to set ` submodules = false `
340
364
in the ` config.toml ` to prevent ` x.py ` from resetting to the original branch.
341
365
342
366
## Writing Documentation
367
+ [ writing-documentation ] : #writing-documentation
343
368
344
369
Documentation improvements are very welcome. The source of ` doc.rust-lang.org `
345
370
is located in ` src/doc ` in the tree, and standard API documentation is generated
@@ -370,6 +395,7 @@ reference to `doc/reference.html`. The CSS might be messed up, but you can
370
395
verify that the HTML is right.
371
396
372
397
## Issue Triage
398
+ [ issue-triage ] : #issue-triage
373
399
374
400
Sometimes, an issue will stay open, even though the bug has been fixed. And
375
401
sometimes, the original bug may go stale because something has changed in the
@@ -437,6 +463,7 @@ If you're looking for somewhere to start, check out the [E-easy][eeasy] tag.
437
463
[ rfcbot ] : https://github.com/dikaiosune/rust-dashboard/blob/master/RFCBOT.md
438
464
439
465
## Out-of-tree Contributions
466
+ [ out-of-tree-contributions ] : #out-of-tree-contributions
440
467
441
468
There are a number of other ways to contribute to Rust that don't deal with
442
469
this repository.
@@ -456,6 +483,7 @@ valuable!
456
483
[ community-library ] : https://github.com/rust-lang/rfcs/labels/A-community-library
457
484
458
485
## Helpful Links and Information
486
+ [ helpful-info ] : #helpful-info
459
487
460
488
For people new to Rust, and just starting to contribute, or even for
461
489
more seasoned developers, some useful places to look for information
0 commit comments