You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compiletest no longer respects -Cpanic=abort in TARGET_RUSTCFLAGS after #108905 #110850
Prior to #108905, compiletest would take TARGET_RUSTCFLAGS into account when determining whether a test target can unwind. It did so by calling rustc --print=cfg --target=$TARGET $TARGET_RUSTCFLAGS, which changes the reported panic strategy depending on the flags:
After the PR, compiletest calls rustc --print=all-target-specs-json -Zunstable-options which always reports the default panic strategy for the target (even if TARGET_RUSTCFLAGS are passed):
$ rustc --print=all-target-specs-json -Zunstable-options
...
"x86_64-unknown-fuchsia": {
... (note that no "panic-strategy" is specified, it defaults to "unwind")
}
...
$ rustc --print=all-target-specs-json -Zunstable-options -Cpanic=abort
...
"x86_64-unknown-fuchsia": {
... ("panic-strategy" is still not specified)
}
...
This causes a problem for us because we run the compiler test suite against a toolchain built with -Cpanic=abort. Compiletest will run tests marked with // needs-unwind even though they panic (and thus fail).
I see a few options for fixing this issue:
Have --print=all-target-specs-json respect any additional flags passed.
Parse target_rustcflags specifically for -Cpanic=abort and modify the return value of Config::can_unwind() to take it into account.
Add some new configuration flags to compiletest to control panic strategy for the selected target.
Activity
jyn514 commentedon Apr 26, 2023
This seems like the best solution to me.
apiraino commentedon Apr 27, 2023
WG-prioritization assigning priority (Zulip discussion).
@rustbot label -I-prioritize +P-high
emilyalbini commentedon May 2, 2023
Agree with jyn here on the solution. Unfortunately I won't have much time myself in the coming weeks to address this :(
Rollup merge of rust-lang#111472 - djkoloski:compiletest_cfg_current_…
Auto merge of rust-lang#111472 - djkoloski:compiletest_cfg_current_ta…