From 30b7dac745b1555cd96f41977f7d24435cbe7fa2 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Wed, 29 Jul 2020 11:37:33 -0700 Subject: [PATCH] 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. --- README.md | 1 + config.toml.example | 6 ++---- src/bootstrap/config.rs | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3399f7fe6c8..fe9776bc5f8 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ by running `./x.py --help` or reading the [rustc dev guide][rustcguidebuild]. * `python` 3 or 2.7 * GNU `make` 3.81 or later * `cmake` 3.4.3 or later + * `ninja` * `curl` * `git` * `ssl` which comes in `libssl-dev` or `openssl-devel` diff --git a/config.toml.example b/config.toml.example index 36587cc0784..9abb8add785 100644 --- a/config.toml.example +++ b/config.toml.example @@ -49,10 +49,8 @@ # dynamic version to be available. #static-libstdcpp = false -# Tell the LLVM build system to use Ninja instead of the platform default for -# the generated build system. This can sometimes be faster than make, for -# example. -#ninja = false +# Whether to use Ninja to build LLVM. This runs much faster than make. +#ninja = true # LLVM targets to build support for. # Note: this is NOT related to Rust compilation targets. However, as Rust is diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 8b8b01b1153..f549de6570f 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -450,6 +450,7 @@ fn normalize_python_path(path: OsString) -> PathBuf { pub fn default_opts() -> Config { let mut config = Config::default(); config.llvm_optimize = true; + config.ninja = true; config.llvm_version_check = true; config.backtrace = true; config.rust_optimize = true;