From 7827cc048e60bdb48216fdfcaeb0140e03f6d782 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 7 Jun 2019 11:25:45 +0200 Subject: [PATCH] Use RUSTFLAGS to set the optimization level (#10719) * Use RUSTFLAGS to set the optimization level Cargo has a [quirk]() in how configuration settings are propagated when `cargo test` runs: local code respect the settings in `[profile.test]` but all dependencies use the `[profile.dev]` settings. Here we force `opt-level=3` for all dependencies. * Remove unused profile settings * Maybe like this? * Turn off incremental compilation * Remove colors; try again with overflow-checks on * Use quiet CI machine * Turn overflow checking back on * Be explicit about what options we use * Remove "quiet machine" override --- Cargo.toml | 3 +-- scripts/gitlab/test-linux.sh | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5a6c93d64..1a5e32d10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -117,10 +117,9 @@ path = "parity/lib.rs" path = "parity/main.rs" name = "parity" -[profile.dev] - [profile.release] debug = false +lto = true [workspace] # This should only list projects that are not diff --git a/scripts/gitlab/test-linux.sh b/scripts/gitlab/test-linux.sh index 2854508bb..aac007ea6 100755 --- a/scripts/gitlab/test-linux.sh +++ b/scripts/gitlab/test-linux.sh @@ -14,4 +14,5 @@ rustup default $1 rustup show echo "________Running Parity Full Test Suite________" -time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=always -- --test-threads $THREADS +# Why are we using RUSTFLAGS? See https://github.com/paritytech/parity-ethereum/pull/10719 +CARGO_INCREMENTAL=0 RUSTFLAGS="-C opt-level=3 -C overflow-checks=on -C debuginfo=2" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=never -- --test-threads $THREADS