Skip to content

Skip new parser validation when skipping function bodies #67352

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

Merged

Conversation

bnbarham
Copy link
Contributor

This would otherwise result in false positives, since if the old parser skipping a body with errors would cause a verification failure.

Don't perform round trip validation either, since we'll presumbly still hit parsing the full file when not skipping bodies - there's no point running it twice.

Resolves rdar://111032175.

@bnbarham
Copy link
Contributor Author

bnbarham commented Jul 18, 2023

FWIW this can easily fail locally for anyone using an asserts compiler. But SwiftPM tests also fail without this, it's just that they aren't run on CI due to SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS being set. The issue there is that when we're compiling a project, we may end up creating a job to output the swiftmodule skipping non-inlinable function bodies. Then that fails due to the verification check with a potentially different diagnostic to the old swift parser. This fails in the test since it's expecting a particular message:

error: consecutive statements on a line must be separated by newline or ';'

vs

error: consecutive statements on a line must be separated by ';'

Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, would it be worth adding a test?

@bnbarham bnbarham force-pushed the disable-new-validation-when-skipping branch from 9cd96a8 to 0e38a5f Compare July 21, 2023 17:00
@bnbarham bnbarham requested review from CodaFi and rintaro as code owners July 21, 2023 17:00
This would otherwise result in false positives, since if the old parser
skipping a body with errors would cause a verification failure.

Don't perform round trip validation either, since we'll presumbly still
hit parsing the full file when not skipping bodies - there's no point
running it twice.

Resolves rdar://111032175.
@bnbarham bnbarham force-pushed the disable-new-validation-when-skipping branch from 0e38a5f to 392f98c Compare July 21, 2023 22:53
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@bnbarham bnbarham merged commit a5607cc into swiftlang:main Jul 23, 2023
@bnbarham bnbarham deleted the disable-new-validation-when-skipping branch July 23, 2023 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants