-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default to short backtraces for dev builds of rustc itself #134743
Conversation
A dev build almost certainly means that whoever's built the compiler has the opportunity to rerun it to collect a more complete trace. So we don't need to default to a complete trace; we should hide irrelevant details by default.
r? jieyouxu |
here is an example short backtrace:
and here are the frames it's omitting:
(note that the "X frames omitted" logic is wrong; that's a pre-existing bug that i happened to fix as part of https://rust-lang.zulipchat.com/#narrow/channel/233931-t-compiler.2Fmajor-changes/topic/Use.20debuginfo.20for.20short.20backtrace.20printing.20compiler-tea.2E.2E.2E) |
Example ICE on native x86_64-pc-windows-msvc after this PR: `x86_64-pc-windows-msvc` before
`x86_64-pc-windows-msvc` after
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this indeed simplifies the dev build rustc ICEs quite a lot. If someone needs the full backtrace, they can still explicitly set RUST_BACKTRACE
to override this logic.
@bors r+ rollup |
Rollup of 3 pull requests Successful merges: - rust-lang#134743 (Default to short backtraces for dev builds of rustc itself) - rust-lang#134750 (Update `#[coverage(..)]` attribute error messages to match the current implementation) - rust-lang#134751 (Enable LSX feature for LoongArch OpenHarmony target) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#134743 - jyn514:rustc-dev-short-backtraces, r=jieyouxu Default to short backtraces for dev builds of rustc itself A dev build almost certainly means that whoever's built the compiler has the opportunity to rerun it to collect a more complete trace. So we don't need to default to a complete trace; we should hide irrelevant details by default.
… r=jieyouxu fix default-backtrace-ice test when running `tests/ui/panics/default-backtrace-ice.rs locally it gave this error: ``` failures: ---- [ui] tests/ui/panics/default-backtrace-ice.rs stdout ---- Saved the actual stderr to "/home/jyn/src/rust3/build/x86_64-unknown-linux-gnu/test/ui/panics/default-backtrace-ice/default-backtrace-ice.stderr" diff of stderr: 7 8 aborting due to `-Z treat-err-as-bug=1` 9 stack backtrace: - (end_short_backtrace) - (begin_short_backtrace) - (end_short_backtrace) - (begin_short_backtrace) + [... omitted 22 frames ...] + ``` (note that you must *not* use --bless; we previously did not have an error annotation to verify it was a full backtrace instead of a short backtrace.) this is a regression from setting RUST_BACKTRACE=1 by default in rust-lang#134743. we need to turn off the new behavior when running UI tests so that they reflect our dist compiler. normally that's done by checking `sess.unstable_opts.ui_testing`, but this happens extremely early in the compiler before we've expanded arg files. do an extremely simple hack that doesn't work in all cases - we don't need it to work in all cases, only when running UI tests. cc rust-lang#129658 (comment) r? `@jieyouxu`
…=jieyouxu fix default-backtrace-ice test when running `tests/ui/panics/default-backtrace-ice.rs locally it gave this error: ``` failures: ---- [ui] tests/ui/panics/default-backtrace-ice.rs stdout ---- Saved the actual stderr to "/home/jyn/src/rust3/build/x86_64-unknown-linux-gnu/test/ui/panics/default-backtrace-ice/default-backtrace-ice.stderr" diff of stderr: 7 8 aborting due to `-Z treat-err-as-bug=1` 9 stack backtrace: - (end_short_backtrace) - (begin_short_backtrace) - (end_short_backtrace) - (begin_short_backtrace) + [... omitted 22 frames ...] + ``` (note that you must *not* use --bless; we previously did not have an error annotation to verify it was a full backtrace instead of a short backtrace.) this is a regression from setting RUST_BACKTRACE=1 by default in rust-lang#134743. we need to turn off the new behavior when running UI tests so that they reflect our dist compiler. normally that's done by checking `sess.unstable_opts.ui_testing`, but this happens extremely early in the compiler before we've expanded arg files. do an extremely simple hack that doesn't work in all cases - we don't need it to work in all cases, only when running UI tests. cc rust-lang#129658 (comment) r? `@jieyouxu`
…=jieyouxu fix default-backtrace-ice test when running `tests/ui/panics/default-backtrace-ice.rs locally it gave this error: ``` failures: ---- [ui] tests/ui/panics/default-backtrace-ice.rs stdout ---- Saved the actual stderr to "/home/jyn/src/rust3/build/x86_64-unknown-linux-gnu/test/ui/panics/default-backtrace-ice/default-backtrace-ice.stderr" diff of stderr: 7 8 aborting due to `-Z treat-err-as-bug=1` 9 stack backtrace: - (end_short_backtrace) - (begin_short_backtrace) - (end_short_backtrace) - (begin_short_backtrace) + [... omitted 22 frames ...] + ``` (note that you must *not* use --bless; we previously did not have an error annotation to verify it was a full backtrace instead of a short backtrace.) this is a regression from setting RUST_BACKTRACE=1 by default in rust-lang#134743. we need to turn off the new behavior when running UI tests so that they reflect our dist compiler. normally that's done by checking `sess.unstable_opts.ui_testing`, but this happens extremely early in the compiler before we've expanded arg files. do an extremely simple hack that doesn't work in all cases - we don't need it to work in all cases, only when running UI tests. cc rust-lang#129658 (comment) r? `@jieyouxu`
fix default-backtrace-ice test when running `tests/ui/panics/default-backtrace-ice.rs locally it gave this error: ``` failures: ---- [ui] tests/ui/panics/default-backtrace-ice.rs stdout ---- Saved the actual stderr to "/home/jyn/src/rust3/build/x86_64-unknown-linux-gnu/test/ui/panics/default-backtrace-ice/default-backtrace-ice.stderr" diff of stderr: 7 8 aborting due to `-Z treat-err-as-bug=1` 9 stack backtrace: - (end_short_backtrace) - (begin_short_backtrace) - (end_short_backtrace) - (begin_short_backtrace) + [... omitted 22 frames ...] + ``` (note that you must *not* use --bless; we previously did not have an error annotation to verify it was a full backtrace instead of a short backtrace.) this is a regression from setting RUST_BACKTRACE=1 by default in rust-lang/rust#134743. we need to turn off the new behavior when running UI tests so that they reflect our dist compiler. normally that's done by checking `sess.unstable_opts.ui_testing`, but this happens extremely early in the compiler before we've expanded arg files. do an extremely simple hack that doesn't work in all cases - we don't need it to work in all cases, only when running UI tests. cc rust-lang/rust#129658 (comment) r? `@jieyouxu`
…=jieyouxu fix default-backtrace-ice test when running `tests/ui/panics/default-backtrace-ice.rs locally it gave this error: ``` failures: ---- [ui] tests/ui/panics/default-backtrace-ice.rs stdout ---- Saved the actual stderr to "/home/jyn/src/rust3/build/x86_64-unknown-linux-gnu/test/ui/panics/default-backtrace-ice/default-backtrace-ice.stderr" diff of stderr: 7 8 aborting due to `-Z treat-err-as-bug=1` 9 stack backtrace: - (end_short_backtrace) - (begin_short_backtrace) - (end_short_backtrace) - (begin_short_backtrace) + [... omitted 22 frames ...] + ``` (note that you must *not* use --bless; we previously did not have an error annotation to verify it was a full backtrace instead of a short backtrace.) this is a regression from setting RUST_BACKTRACE=1 by default in rust-lang#134743. we need to turn off the new behavior when running UI tests so that they reflect our dist compiler. normally that's done by checking `sess.unstable_opts.ui_testing`, but this happens extremely early in the compiler before we've expanded arg files. do an extremely simple hack that doesn't work in all cases - we don't need it to work in all cases, only when running UI tests. cc rust-lang#129658 (comment) r? `@jieyouxu`
fix default-backtrace-ice test when running `tests/ui/panics/default-backtrace-ice.rs locally it gave this error: ``` failures: ---- [ui] tests/ui/panics/default-backtrace-ice.rs stdout ---- Saved the actual stderr to "/home/jyn/src/rust3/build/x86_64-unknown-linux-gnu/test/ui/panics/default-backtrace-ice/default-backtrace-ice.stderr" diff of stderr: 7 8 aborting due to `-Z treat-err-as-bug=1` 9 stack backtrace: - (end_short_backtrace) - (begin_short_backtrace) - (end_short_backtrace) - (begin_short_backtrace) + [... omitted 22 frames ...] + ``` (note that you must *not* use --bless; we previously did not have an error annotation to verify it was a full backtrace instead of a short backtrace.) this is a regression from setting RUST_BACKTRACE=1 by default in rust-lang/rust#134743. we need to turn off the new behavior when running UI tests so that they reflect our dist compiler. normally that's done by checking `sess.unstable_opts.ui_testing`, but this happens extremely early in the compiler before we've expanded arg files. do an extremely simple hack that doesn't work in all cases - we don't need it to work in all cases, only when running UI tests. cc rust-lang/rust#129658 (comment) r? `@jieyouxu`
A dev build almost certainly means that whoever's built the compiler has the opportunity to rerun it to collect a more complete trace. So we don't need to default to a complete trace; we should hide irrelevant details by default.