Fix internal Perl script for Standard Library Header Units test coverage #5056
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While working on internal MSVC-PRs, including mirroring GitHub changes, I noticed something curious. The Standard Library Header Units test appeared to be ICEing, but it wasn't related to any of the PR changes. What happened is that our internal "chk" compiler (with assertions enabled) had begun ICEing in this test. (We weren't seeing it on GitHub because either the shipping "ret" compiler was less severely affected, or because recent changes that intensified the problem hadn't yet shipped. I didn't care enough to investigate which was the case.) The mysterious thing was why this ICE wasn't blocking our internal PR/CI checks. While the ICE had a different underlying cause (internal VSO-2293247 "
/Zc:preprocessordoes not terminate macro definitions properly", which @cdacamar just fixed with internal MSVC-PR-588923), the specific way the STL was encountering it was through the/scanDependenciescompiler option, which is used only by the Standard Library Header Units test, and because that test requires the most complicated custom build steps, we have a Perl scriptcustombuild.plthat drives it. The ICE was causing the Perl script to terminate in a way that the rest of the internal test harness didn't expect, so the test was reported as "skipped" instead of "failed" or "cascaded". That's why our PR/CI checks weren't noticing the ICE, and only if there was another failure would the full test logs contain the record of the ICE (which is how I noticed this - it was a very long story, with the internalperennialtest suite noticing that #4958 didn't handle heterogeneous types inadjacent_differencecorrectly).I found that we need to use the internal function
Run::PrintErrorinstead of Perldie. In the aftermath of the ICE, the compiler's/scanDependenciesemitted bogus JSON (I think it was simply empty), so I'm wrapping the JSON decoding in Perltry/catch.I've verified (before the ICE was fixed) that this now correctly reports test failure, so we'll avoid future regressions of this form.
Click to expand test failure log:
I don't believe that our
custom_format.pyfor the GitHub test harness is affected at all - when stuff goes wrong, the Lit machinery is good about not silently ignoring it.Also, while our Standard Library Modules test has a
custombuild.plof its own, it's far less complicated and doesn't/scanDependenciesor decode JSON, so I believe it's unaffected.