From 8ee62bb2394596e2c9a72828b755ba90329ea119 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 30 Nov 2018 14:31:04 -0800 Subject: [PATCH] ci: Only run compare-mode tests on one builder The run-pass test suite currently takes 30 minutes on Windows, and that appears to be roughly split between two 15 minute runs of the test suite: one without NLL and one with NLL. In discussion on Discord the platform coverage of the NLL compare mode may not necessarily be worth it, so this commit removes the NLL compare mode from tests by default, and then reenables it on only one builder. --- config.toml.example | 5 +++++ src/bootstrap/config.rs | 3 +++ src/bootstrap/test.rs | 8 +++++++- src/ci/docker/x86_64-gnu-nopt/Dockerfile | 4 +++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/config.toml.example b/config.toml.example index 8b11014edae79..f75e220de47e7 100644 --- a/config.toml.example +++ b/config.toml.example @@ -400,6 +400,11 @@ # override the default allocator for rustc and LLVM. #jemalloc = false +# Run tests in various test suites with the "nll compare mode" in addition to +# running the tests in normal mode. Largely only used on CI and during local +# development of NLL +#test-compare-mode = false + # ============================================================================= # Options for specific targets # diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 0f249eee00022..8fc2d5787cb4b 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -58,6 +58,7 @@ pub struct Config { pub ignore_git: bool, pub exclude: Vec, pub rustc_error_format: Option, + pub test_compare_mode: bool, pub run_host_only: bool, @@ -326,6 +327,7 @@ struct Rust { verify_llvm_ir: Option, remap_debuginfo: Option, jemalloc: Option, + test_compare_mode: Option, } /// TOML representation of how each build target is configured. @@ -540,6 +542,7 @@ impl Config { set(&mut config.codegen_tests, rust.codegen_tests); set(&mut config.rust_rpath, rust.rpath); set(&mut config.jemalloc, rust.jemalloc); + set(&mut config.test_compare_mode, rust.test_compare_mode); set(&mut config.backtrace, rust.backtrace); set(&mut config.channel, rust.channel.clone()); set(&mut config.rust_dist_src, rust.dist_src); diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index e6c260a1426f9..da827356800e9 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -1022,7 +1022,13 @@ impl Step for Compiletest { cmd.arg("--bless"); } - let compare_mode = builder.config.cmd.compare_mode().or(self.compare_mode); + let compare_mode = builder.config.cmd.compare_mode().or_else(|| { + if builder.config.test_compare_mode { + self.compare_mode + } else { + None + } + }); if let Some(ref nodejs) = builder.config.nodejs { cmd.arg("--nodejs").arg(nodejs); diff --git a/src/ci/docker/x86_64-gnu-nopt/Dockerfile b/src/ci/docker/x86_64-gnu-nopt/Dockerfile index d2b0dd13dc2df..b0780fdf32a59 100644 --- a/src/ci/docker/x86_64-gnu-nopt/Dockerfile +++ b/src/ci/docker/x86_64-gnu-nopt/Dockerfile @@ -16,5 +16,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ COPY scripts/sccache.sh /scripts/ RUN sh /scripts/sccache.sh -ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu --disable-optimize-tests +ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu \ + --disable-optimize-tests \ + --set rust.test-compare-mode ENV RUST_CHECK_TARGET check