-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
llvm wrapper's target feature filtering breaks UI tests, is difficult to debug #114661
Copy link
Copy link
Open
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.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.T-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.
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.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.T-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Every attempt to ask LLVM "does the target support this feature?" either succeeds or causes a side effect of writing a message to stderr:
Since the UI tests are very strict about matching exactly the same stderr output across LLVM versions, this means teaching rustc about an LLVM feature that exists in only some versions but not others creates a contradiction: if that error line is expected, the tests will fail against newer versions of LLVM, and if it's absent then the tests can't pass against the older versions. Since rustc runs the filter at target selection time, any UI tests at all for this architecture will fail, regardless of their contents.
What's worse is the developer experience. I ran into it introducing UI tests for riscv targets as part of adding an ABI (see #111891 (comment) ) and since the issue presents as having forgotten to
--blesssome output, I went back and forth a number of times adding and removing the line. It's not at all clear from the failure that an unused feature supported-on-some-but-not-other-LLVMs is the culprit, and because it fails in CI the feedback loop for this condition is terribly long.Some possible resolutions include:
/cc @nikic