X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=CONTRIBUTING.md;h=f921fb2c94233efa196d6ef16ebc271dc2a813a5;hb=449219ab2bf65f465b18c0841d7f8d9d3b958943;hp=429996126f92b6dd7d13fcfd1b0ce5d224842e98;hpb=410d807e46b2538ab3ab2ebefcc68b44442d025a;p=rust.git diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 429996126f9..f921fb2c942 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -97,33 +97,38 @@ system internals, try asking in [`#rust-internals`][pound-rust-internals]. Before you can start building the compiler you need to configure the build for your system. In most cases, that will just mean using the defaults provided -for Rust. Configuring involves invoking the `configure` script in the project -root. +for Rust. -``` -./configure -``` +To change configuration, you must copy the file `src/bootstrap/config.toml.example` +to `config.toml` in the directory from which you will be running the build, and +change the settings provided. + +There are large number of options provided in this config file that will alter the +configuration used in the build process. Some options to note: -There are large number of options accepted by this script to alter the -configuration used later in the build process. Some options to note: +#### `[llvm]`: +- `ccache = true` - Use ccache when building llvm -- `--enable-debug` - Build a debug version of the compiler (disables optimizations, - which speeds up compilation of stage1 rustc) -- `--enable-optimize` - Enable optimizations (can be used with `--enable-debug` - to make a debug build with optimizations) -- `--disable-valgrind-rpass` - Don't run tests with valgrind -- `--enable-clang` - Prefer clang to gcc for building dependencies (e.g., LLVM) -- `--enable-ccache` - Invoke clang/gcc with ccache to re-use object files between builds -- `--enable-compiler-docs` - Build compiler documentation +#### `[build]`: +- `compiler-docs = true` - Build compiler documentation -To see a full list of options, run `./configure --help`. +#### `[rust]`: +- `debuginfo = true` - Build a compiler with debuginfo +- `optimize = false` - Disable optimizations to speed up compilation of stage1 rust + +For more options, the `config.toml` file contains commented out defaults, with +descriptions of what each option will do. + +Note: Previously the `./configure` script was used to configure this +project. It can still be used, but it's recommended to use a `config.toml` +file. If you still have a `config.mk` file in your directory - from +`./configure` - you may need to delete it for `config.toml` to work. ### Building -Although the `./configure` script will generate a `Makefile`, this is actually -just a thin veneer over the actual build system driver, `x.py`. This file, at -the root of the repository, is used to build, test, and document various parts -of the compiler. You can execute it as: +The build system uses the `x.py` script to control the build process. This script +is used to build, test, and document various parts of the compiler. You can +execute it as: ```sh python x.py build @@ -185,6 +190,9 @@ To learn about all possible rules you can execute, run: python x.py build --help --verbose ``` +Note: Previously `./configure` and `make` were used to build this project. +They are still available, but `x.py` is the recommended build system. + ### Useful commands Some common invocations of `x.py` are: @@ -199,7 +207,7 @@ Some common invocations of `x.py` are: This is the fastest way to recompile after you changed only rustc source code. Note however that the resulting rustc binary won't have a stdlib to link against by default. You can build libstd once with `x.py build src/libstd`, - but it is is only guaranteed to work if recompiled, so if there are any issues + but it is only guaranteed to work if recompiled, so if there are any issues recompile it. - `x.py test` - build the full compiler & run all tests (takes a while). This is what gets run by the continuous integration system against your pull @@ -235,8 +243,8 @@ feature. We use the 'fork and pull' model described there. Please make pull requests against the `master` branch. -Compiling all of `make check` can take a while. When testing your pull request, -consider using one of the more specialized `make` targets to cut down on the +Compiling all of `./x.py test` can take a while. When testing your pull request, +consider using one of the more specialized `./x.py` targets to cut down on the amount of time you have to wait. You need to have built the compiler at least once before running these will work, but that’s only one full build rather than one each time. @@ -307,7 +315,7 @@ To find documentation-related issues, sort by the [A-docs label][adocs]. [adocs]: https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AA-docs -In many cases, you don't need a full `make doc`. You can use `rustdoc` directly +In many cases, you don't need a full `./x.py doc`. You can use `rustdoc` directly to check small fixes. For example, `rustdoc src/doc/reference.md` will render reference to `doc/reference.html`. The CSS might be messed up, but you can verify that the HTML is right. @@ -398,5 +406,5 @@ are: [rr]: https://doc.rust-lang.org/book/README.html [tlgba]: http://tomlee.co/2014/04/a-more-detailed-tour-of-the-rust-compiler/ [ro]: http://www.rustaceans.org/ -[rctd]: ./COMPILER_TESTS.md +[rctd]: ./src/test/COMPILER_TESTS.md [cheatsheet]: https://buildbot.rust-lang.org/homu/