Skip to content

Commit

Permalink
Auto merge of #98140 - klensy:compiletest-strip, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
compiletest: strip debuginfo by default for mode=ui

This reduces occupied disk space, for example for src/test/ui it drops from 1972mb to 132mb (x86_64-pc-windows-msvc).

Individual tests that require debuginfo/symbols should turn this option off (as in fixed tests).
  • Loading branch information
bors committed Jun 26, 2022
2 parents 20a6f3a + 18ed1fa commit 639a655
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/test/ui/backtrace-apple-no-dsymutil.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass

// compile-flags:-Cstrip=none
// compile-flags:-g -Csplit-debuginfo=unpacked
// only-macos

Expand Down
1 change: 1 addition & 0 deletions src/test/ui/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// ignore-sgx no processes
// ignore-msvc see #62897 and `backtrace-debuginfo.rs` test
// compile-flags:-g
// compile-flags:-Cstrip=none

use std::env;
use std::process::{Command, Stdio};
Expand Down
4 changes: 4 additions & 0 deletions src/test/ui/numbers-arithmetic/promoted_overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// run-fail
// error-pattern: overflow
// compile-flags: -C overflow-checks=yes
// for some reason, fails to match error string on
// wasm32-unknown-unknown with stripped debuginfo and symbols,
// so don't strip it
// compile-flags:-Cstrip=none

fn main() {
let x: &'static u32 = &(0u32 - 1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:21:5
thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:22:5
stack backtrace:
0: std::panicking::begin_panic
1: issue_47429_short_backtraces::main
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/panics/issue-47429-short-backtraces.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Regression test for #47429: short backtraces were not terminating correctly

// compile-flags: -O
// compile-flags:-Cstrip=none
// run-fail
// check-run-results
// exec-env:RUST_BACKTRACE=1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:21:5
thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:22:5
stack backtrace:
0: std::panicking::begin_panic::<&str>
1: issue_47429_short_backtraces::main
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/panics/runtime-switch.legacy.run.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
thread 'main' panicked at 'explicit panic', $DIR/runtime-switch.rs:24:5
thread 'main' panicked at 'explicit panic', $DIR/runtime-switch.rs:25:5
stack backtrace:
0: std::panicking::begin_panic
1: runtime_switch::main
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/panics/runtime-switch.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Test for std::panic::set_backtrace_style.

// compile-flags: -O
// compile-flags:-Cstrip=none
// run-fail
// check-run-results
// exec-env:RUST_BACKTRACE=0
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/panics/runtime-switch.v0.run.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
thread 'main' panicked at 'explicit panic', $DIR/runtime-switch.rs:24:5
thread 'main' panicked at 'explicit panic', $DIR/runtime-switch.rs:25:5
stack backtrace:
0: std::panicking::begin_panic::<&str>
1: runtime_switch::main
Expand Down
4 changes: 4 additions & 0 deletions src/test/ui/panics/unique-panic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// run-fail
// error-pattern: panic
// for some reason, fails to match error string on
// wasm32-unknown-unknown with stripped debuginfo and symbols,
// so don't strip it
// compile-flags:-Cstrip=none

fn main() {
Box::new(panic!());
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/runtime/backtrace-debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

// compile-flags:-g -Copt-level=0 -Cllvm-args=-enable-tail-merge=0
// compile-flags:-Cforce-frame-pointers=yes
// compile-flags:-Cstrip=none
// ignore-pretty issue #37195
// ignore-emscripten spawning processes is not supported
// ignore-sgx no processes
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/std-backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// ignore-sgx no processes
// ignore-msvc see #62897 and `backtrace-debuginfo.rs` test
// compile-flags:-g
// compile-flags:-Cstrip=none

#![feature(backtrace)]

Expand Down
2 changes: 2 additions & 0 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,8 @@ impl<'test> TestCx<'test> {
rustc.arg("-Ccodegen-units=1");
rustc.arg("-Zui-testing");
rustc.arg("-Zdeduplicate-diagnostics=no");
// FIXME: use this for other modes too, for perf?
rustc.arg("-Cstrip=debuginfo");
}
MirOpt => {
rustc.args(&[
Expand Down

0 comments on commit 639a655

Please sign in to comment.