-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Compiletest no longer respects -Cpanic=abort in TARGET_RUSTCFLAGS after #108905 #110850
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Metadata
Metadata
Assignees
Labels
A-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Prior to #108905, compiletest would take
TARGET_RUSTCFLAGSinto account when determining whether a test target can unwind. It did so by callingrustc --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-optionswhich always reports the default panic strategy for the target (even ifTARGET_RUSTCFLAGSare passed):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-unwindeven though they panic (and thus fail).I see a few options for fixing this issue:
--print=all-target-specs-jsonrespect any additional flags passed.target_rustcflagsspecifically for-Cpanic=abortand modify the return value ofConfig::can_unwind()to take it into account.cc @pietroalbini who authored the original PR