Skip to content

Commit 6780fbd

Browse files
committed
Auto merge of #9207 - ehuss:testsuite-splitdebug, r=Eh2406
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.
2 parents 5d97225 + 0f78dbd commit 6780fbd

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

crates/cargo-test-support/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,6 +1593,14 @@ fn _process(t: &OsStr) -> cargo::util::ProcessBuilder {
15931593
p.env("PATH", new_path);
15941594
}
15951595

1596+
if cfg!(target_os = "macos") {
1597+
// This makes the test suite run substantially faster.
1598+
p.env("CARGO_PROFILE_DEV_SPLIT_DEBUGINFO", "unpacked")
1599+
.env("CARGO_PROFILE_TEST_SPLIT_DEBUGINFO", "unpacked")
1600+
.env("CARGO_PROFILE_RELEASE_SPLIT_DEBUGINFO", "unpacked")
1601+
.env("CARGO_PROFILE_BENCH_SPLIT_DEBUGINFO", "unpacked");
1602+
}
1603+
15961604
p.cwd(&paths::root())
15971605
.env("HOME", paths::home())
15981606
.env("CARGO_HOME", paths::home().join(".cargo"))

tests/testsuite/build.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,9 +1656,7 @@ fn lto_build() {
16561656
--emit=[..]link \
16571657
-C opt-level=3 \
16581658
-C lto \
1659-
-C metadata=[..] \
1660-
--out-dir [CWD]/target/release/deps \
1661-
-L dependency=[CWD]/target/release/deps`
1659+
[..]
16621660
[FINISHED] release [optimized] target(s) in [..]
16631661
",
16641662
)

tests/testsuite/lto.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,8 @@ fn cdylib_and_rlib() {
493493
[FRESH] registry-shared v0.0.1
494494
[FRESH] bar v0.0.0 [..]
495495
[COMPILING] foo [..]
496-
[RUNNING] `rustc --crate-name foo [..]-C embed-bitcode=no --test[..]
497-
[RUNNING] `rustc --crate-name a [..]-C embed-bitcode=no --test[..]
496+
[RUNNING] `rustc --crate-name foo [..]-C embed-bitcode=no [..]--test[..]
497+
[RUNNING] `rustc --crate-name a [..]-C embed-bitcode=no [..]--test[..]
498498
[FINISHED] [..]
499499
[RUNNING] [..]
500500
[RUNNING] [..]
@@ -520,8 +520,8 @@ fn cdylib_and_rlib() {
520520
[RUNNING] `rustc --crate-name registry_shared [..]-C embed-bitcode=no[..]
521521
[COMPILING] bar [..]
522522
[RUNNING] `rustc --crate-name bar [..]--crate-type cdylib --crate-type rlib [..]-C embed-bitcode=no[..]
523-
[RUNNING] `rustc --crate-name bar [..]-C embed-bitcode=no --test[..]
524-
[RUNNING] `rustc --crate-name b [..]-C embed-bitcode=no --test[..]
523+
[RUNNING] `rustc --crate-name bar [..]-C embed-bitcode=no [..]--test[..]
524+
[RUNNING] `rustc --crate-name b [..]-C embed-bitcode=no [..]--test[..]
525525
[FINISHED] [..]
526526
[RUNNING] [..]target/release/deps/bar-[..]
527527
[RUNNING] [..]target/release/deps/b-[..]
@@ -552,8 +552,8 @@ fn dylib() {
552552
[FRESH] registry-shared v0.0.1
553553
[FRESH] bar v0.0.0 [..]
554554
[COMPILING] foo [..]
555-
[RUNNING] `rustc --crate-name foo [..]-C embed-bitcode=no --test[..]
556-
[RUNNING] `rustc --crate-name a [..]-C embed-bitcode=no --test[..]
555+
[RUNNING] `rustc --crate-name foo [..]-C embed-bitcode=no [..]--test[..]
556+
[RUNNING] `rustc --crate-name a [..]-C embed-bitcode=no [..]--test[..]
557557
[FINISHED] [..]
558558
[RUNNING] [..]
559559
[RUNNING] [..]
@@ -578,8 +578,8 @@ fn dylib() {
578578
[FRESH] registry-shared v0.0.1
579579
[FRESH] registry v0.0.1
580580
[COMPILING] bar [..]
581-
[RUNNING] `rustc --crate-name bar [..]-C embed-bitcode=no --test[..]
582-
[RUNNING] `rustc --crate-name b [..]-C embed-bitcode=no --test[..]
581+
[RUNNING] `rustc --crate-name bar [..]-C embed-bitcode=no [..]--test[..]
582+
[RUNNING] `rustc --crate-name b [..]-C embed-bitcode=no [..]--test[..]
583583
[FINISHED] [..]
584584
[RUNNING] [..]
585585
[RUNNING] [..]

0 commit comments

Comments
 (0)