From 18ed1fa12933ff895980b55cf8b858aec8171b85 Mon Sep 17 00:00:00 2001 From: klensy Date: Wed, 15 Jun 2022 16:36:19 +0300 Subject: [PATCH] use `-Cstrip=debuginfo` with ui tests to reduce disk space usage --- src/test/ui/backtrace-apple-no-dsymutil.rs | 1 + src/test/ui/backtrace.rs | 1 + src/test/ui/numbers-arithmetic/promoted_overflow.rs | 4 ++++ .../ui/panics/issue-47429-short-backtraces.legacy.run.stderr | 2 +- src/test/ui/panics/issue-47429-short-backtraces.rs | 1 + src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr | 2 +- src/test/ui/panics/runtime-switch.legacy.run.stderr | 2 +- src/test/ui/panics/runtime-switch.rs | 1 + src/test/ui/panics/runtime-switch.v0.run.stderr | 2 +- src/test/ui/panics/unique-panic.rs | 4 ++++ src/test/ui/runtime/backtrace-debuginfo.rs | 1 + src/test/ui/std-backtrace.rs | 1 + src/tools/compiletest/src/runtest.rs | 2 ++ 13 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/test/ui/backtrace-apple-no-dsymutil.rs b/src/test/ui/backtrace-apple-no-dsymutil.rs index 492ff6356bcaf..d32ad11a122df 100644 --- a/src/test/ui/backtrace-apple-no-dsymutil.rs +++ b/src/test/ui/backtrace-apple-no-dsymutil.rs @@ -1,5 +1,6 @@ // run-pass +// compile-flags:-Cstrip=none // compile-flags:-g -Csplit-debuginfo=unpacked // only-macos diff --git a/src/test/ui/backtrace.rs b/src/test/ui/backtrace.rs index c2d9e222b84a4..05ccfcb5060cb 100644 --- a/src/test/ui/backtrace.rs +++ b/src/test/ui/backtrace.rs @@ -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}; diff --git a/src/test/ui/numbers-arithmetic/promoted_overflow.rs b/src/test/ui/numbers-arithmetic/promoted_overflow.rs index da59e81ed6bf7..ba168f773d856 100644 --- a/src/test/ui/numbers-arithmetic/promoted_overflow.rs +++ b/src/test/ui/numbers-arithmetic/promoted_overflow.rs @@ -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); diff --git a/src/test/ui/panics/issue-47429-short-backtraces.legacy.run.stderr b/src/test/ui/panics/issue-47429-short-backtraces.legacy.run.stderr index fcdc070a4c39e..b6223b93764f4 100644 --- a/src/test/ui/panics/issue-47429-short-backtraces.legacy.run.stderr +++ b/src/test/ui/panics/issue-47429-short-backtraces.legacy.run.stderr @@ -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 diff --git a/src/test/ui/panics/issue-47429-short-backtraces.rs b/src/test/ui/panics/issue-47429-short-backtraces.rs index c34e00bab7cdd..f338ace6bb0d1 100644 --- a/src/test/ui/panics/issue-47429-short-backtraces.rs +++ b/src/test/ui/panics/issue-47429-short-backtraces.rs @@ -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 diff --git a/src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr b/src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr index 1cbf11739bfc6..c2bea44924983 100644 --- a/src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr +++ b/src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr @@ -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 diff --git a/src/test/ui/panics/runtime-switch.legacy.run.stderr b/src/test/ui/panics/runtime-switch.legacy.run.stderr index 979cc56b8312e..f282f18839c64 100644 --- a/src/test/ui/panics/runtime-switch.legacy.run.stderr +++ b/src/test/ui/panics/runtime-switch.legacy.run.stderr @@ -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 diff --git a/src/test/ui/panics/runtime-switch.rs b/src/test/ui/panics/runtime-switch.rs index c163481140666..37ef961e2d019 100644 --- a/src/test/ui/panics/runtime-switch.rs +++ b/src/test/ui/panics/runtime-switch.rs @@ -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 diff --git a/src/test/ui/panics/runtime-switch.v0.run.stderr b/src/test/ui/panics/runtime-switch.v0.run.stderr index 48f829c26d445..7ce9722e5edf1 100644 --- a/src/test/ui/panics/runtime-switch.v0.run.stderr +++ b/src/test/ui/panics/runtime-switch.v0.run.stderr @@ -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 diff --git a/src/test/ui/panics/unique-panic.rs b/src/test/ui/panics/unique-panic.rs index 22e0d63d5946f..ae7911e594389 100644 --- a/src/test/ui/panics/unique-panic.rs +++ b/src/test/ui/panics/unique-panic.rs @@ -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!()); diff --git a/src/test/ui/runtime/backtrace-debuginfo.rs b/src/test/ui/runtime/backtrace-debuginfo.rs index b976c3a13bd59..7c9f1a7f2f49b 100644 --- a/src/test/ui/runtime/backtrace-debuginfo.rs +++ b/src/test/ui/runtime/backtrace-debuginfo.rs @@ -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 diff --git a/src/test/ui/std-backtrace.rs b/src/test/ui/std-backtrace.rs index b5e76666af1f8..07de066b55863 100644 --- a/src/test/ui/std-backtrace.rs +++ b/src/test/ui/std-backtrace.rs @@ -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)] diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index b758bb9cf6790..160b9785d975f 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -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(&[