Skip to content

Commit 30b7dac

Browse files
committed
Set ninja=true by default
Ninja substantially improves LLVM build time. On a 96-way system, using Make took 248s, and using Ninja took 161s, a 35% improvement. We already require a variety of tools to build Rust. If someone wants to build without Ninja (for instance, to minimize the set of packages required to bootstrap a new target), they can easily set `ninja=false` in `config.toml`. Our defaults should help people build Rust (and LLVM) faster, to speed up development.
1 parent 48717b6 commit 30b7dac

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ by running `./x.py --help` or reading the [rustc dev guide][rustcguidebuild].
3636
* `python` 3 or 2.7
3737
* GNU `make` 3.81 or later
3838
* `cmake` 3.4.3 or later
39+
* `ninja`
3940
* `curl`
4041
* `git`
4142
* `ssl` which comes in `libssl-dev` or `openssl-devel`

config.toml.example

+2-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@
4949
# dynamic version to be available.
5050
#static-libstdcpp = false
5151

52-
# Tell the LLVM build system to use Ninja instead of the platform default for
53-
# the generated build system. This can sometimes be faster than make, for
54-
# example.
55-
#ninja = false
52+
# Whether to use Ninja to build LLVM. This runs much faster than make.
53+
#ninja = true
5654

5755
# LLVM targets to build support for.
5856
# Note: this is NOT related to Rust compilation targets. However, as Rust is

src/bootstrap/config.rs

+1
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ impl Config {
450450
pub fn default_opts() -> Config {
451451
let mut config = Config::default();
452452
config.llvm_optimize = true;
453+
config.ninja = true;
453454
config.llvm_version_check = true;
454455
config.backtrace = true;
455456
config.rust_optimize = true;

0 commit comments

Comments
 (0)