Skip to content

Commit

Permalink
Auto merge of #9207 - ehuss:testsuite-splitdebug, r=Eh2406
Browse files Browse the repository at this point in the history
testsuite: Use split debuginfo on macos.

This switches the testsuite to use "unpacked" debuginfo on macos, which is a substantial performance boost. On my system, the testsuite runs 1.55 times faster with this change.  Along with #9206, total testsuite time is 3.1 times faster.
  • Loading branch information
bors committed Feb 25, 2021
2 parents 5d97225 + 0f78dbd commit 6780fbd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
8 changes: 8 additions & 0 deletions crates/cargo-test-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,14 @@ fn _process(t: &OsStr) -> cargo::util::ProcessBuilder {
p.env("PATH", new_path);
}

if cfg!(target_os = "macos") {
// This makes the test suite run substantially faster.
p.env("CARGO_PROFILE_DEV_SPLIT_DEBUGINFO", "unpacked")
.env("CARGO_PROFILE_TEST_SPLIT_DEBUGINFO", "unpacked")
.env("CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO", "unpacked")
.env("CARGO_PROFILE_BENCH_SPLIT_DEBUGINFO", "unpacked");
}

p.cwd(&paths::root())
.env("HOME", paths::home())
.env("CARGO_HOME", paths::home().join(".cargo"))
Expand Down
4 changes: 1 addition & 3 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1656,9 +1656,7 @@ fn lto_build() {
--emit=[..]link \
-C opt-level=3 \
-C lto \
-C metadata=[..] \
--out-dir [CWD]/target/release/deps \
-L dependency=[CWD]/target/release/deps`
[..]
[FINISHED] release [optimized] target(s) in [..]
",
)
Expand Down
16 changes: 8 additions & 8 deletions tests/testsuite/lto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,8 @@ fn cdylib_and_rlib() {
[FRESH] registry-shared v0.0.1
[FRESH] bar v0.0.0 [..]
[COMPILING] foo [..]
[RUNNING] `rustc --crate-name foo [..]-C embed-bitcode=no --test[..]
[RUNNING] `rustc --crate-name a [..]-C embed-bitcode=no --test[..]
[RUNNING] `rustc --crate-name foo [..]-C embed-bitcode=no [..]--test[..]
[RUNNING] `rustc --crate-name a [..]-C embed-bitcode=no [..]--test[..]
[FINISHED] [..]
[RUNNING] [..]
[RUNNING] [..]
Expand All @@ -520,8 +520,8 @@ fn cdylib_and_rlib() {
[RUNNING] `rustc --crate-name registry_shared [..]-C embed-bitcode=no[..]
[COMPILING] bar [..]
[RUNNING] `rustc --crate-name bar [..]--crate-type cdylib --crate-type rlib [..]-C embed-bitcode=no[..]
[RUNNING] `rustc --crate-name bar [..]-C embed-bitcode=no --test[..]
[RUNNING] `rustc --crate-name b [..]-C embed-bitcode=no --test[..]
[RUNNING] `rustc --crate-name bar [..]-C embed-bitcode=no [..]--test[..]
[RUNNING] `rustc --crate-name b [..]-C embed-bitcode=no [..]--test[..]
[FINISHED] [..]
[RUNNING] [..]target/release/deps/bar-[..]
[RUNNING] [..]target/release/deps/b-[..]
Expand Down Expand Up @@ -552,8 +552,8 @@ fn dylib() {
[FRESH] registry-shared v0.0.1
[FRESH] bar v0.0.0 [..]
[COMPILING] foo [..]
[RUNNING] `rustc --crate-name foo [..]-C embed-bitcode=no --test[..]
[RUNNING] `rustc --crate-name a [..]-C embed-bitcode=no --test[..]
[RUNNING] `rustc --crate-name foo [..]-C embed-bitcode=no [..]--test[..]
[RUNNING] `rustc --crate-name a [..]-C embed-bitcode=no [..]--test[..]
[FINISHED] [..]
[RUNNING] [..]
[RUNNING] [..]
Expand All @@ -578,8 +578,8 @@ fn dylib() {
[FRESH] registry-shared v0.0.1
[FRESH] registry v0.0.1
[COMPILING] bar [..]
[RUNNING] `rustc --crate-name bar [..]-C embed-bitcode=no --test[..]
[RUNNING] `rustc --crate-name b [..]-C embed-bitcode=no --test[..]
[RUNNING] `rustc --crate-name bar [..]-C embed-bitcode=no [..]--test[..]
[RUNNING] `rustc --crate-name b [..]-C embed-bitcode=no [..]--test[..]
[FINISHED] [..]
[RUNNING] [..]
[RUNNING] [..]
Expand Down

0 comments on commit 6780fbd

Please sign in to comment.