Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Use RUSTFLAGS to set the optimization level (#10719)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
dvdplm authored and soc1c committed Jun 11, 2019
1 parent ee55b4a commit 40e4631
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ path = "parity/lib.rs"
path = "parity/main.rs"
name = "parity"

[profile.dev]

[profile.test]
lto = false
opt-level = 3 # makes tests slower to compile, but faster to run
Expand Down
3 changes: 2 additions & 1 deletion scripts/gitlab/test-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 40e4631

Please sign in to comment.