-
Notifications
You must be signed in to change notification settings - Fork 406
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
Validate token choices in CI #1466
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@swift-ci Please test |
ahoppen
force-pushed
the
ahoppen/rawsyntaxvalidation
branch
from
March 30, 2023 14:27
2304c47
to
d7d76ac
Compare
@swift-ci Please test macOS |
ahoppen
force-pushed
the
ahoppen/rawsyntaxvalidation
branch
from
March 31, 2023 04:59
d7d76ac
to
8b43d61
Compare
@swift-ci Please test macOS |
ahoppen
force-pushed
the
ahoppen/rawsyntaxvalidation
branch
from
March 31, 2023 15:20
8b43d61
to
9018486
Compare
@swift-ci Please test macOS |
ahoppen
added a commit
to ahoppen/swift-syntax
that referenced
this pull request
Mar 31, 2023
This fixes all remaining cases that were caught by swiftlang#1466.
ahoppen
added a commit
to ahoppen/swift-syntax
that referenced
this pull request
Mar 31, 2023
This fixes all remaining cases that were caught by swiftlang#1466.
@swift-ci Please test macOS |
ahoppen
added a commit
to ahoppen/swift-syntax
that referenced
this pull request
Apr 5, 2023
This fixes all remaining cases that were caught by swiftlang#1466.
@swift-ci Please test macOS |
This changes the the paradigm around token validation in SwiftSyntax. Previously, we always validated that the `RawSyntax` tree layout was as expected in debug builds (independent of whether we forced assertions on). This property should always be guaranteed by our API unless you are replacing children manually. Verification that the tokens in the tree matched the token choices, on the other hand, was always disabled unless you specifically enabled it by modifying Package.swift. This changes the paradigm by enabling `RawSyntax` layout and token validation whenever the `SWIFTSYNTAX_ENABLE_RAWSYNTAX_VALIDATION` conditional compilation flag is set. I am planning to set this compilation flag on SwiftSyntax’s PR testing jobs at first and, after considering the performance impact, also on Swift’s PR jobs. This should give us two advantages: - In CI we get more extensive tree validation because we are now also validate the token choices - If we are just building SwiftSyntax as a package dependency in SwiftPM, we get faster performance because we skip the `RawSyntax` layout validation (which is really just a way to debug serious issues while working on SwiftSyntax itself).
ahoppen
force-pushed
the
ahoppen/rawsyntaxvalidation
branch
from
April 6, 2023 16:59
9018486
to
e725602
Compare
@swift-ci Please test macOS |
1 similar comment
@swift-ci Please test macOS |
@swift-ci Please test Windows |
@swift-ci Please test Linux |
@swift-ci Please test Windows |
ahoppen
added a commit
to ahoppen/swift-syntax
that referenced
this pull request
Apr 18, 2023
…ation Validate token choices in CI
ahoppen
added a commit
to ahoppen/swift-syntax
that referenced
this pull request
Apr 18, 2023
…ation Validate token choices in CI
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This changes the the paradigm around token validation in SwiftSyntax. Previously, we always validated that the
RawSyntax
tree layout was as expected in debug builds (independent of whether we forced assertions on). This property should always be guaranteed by our API unless you are replacing children manually. Verification that the tokens in the tree matched the token choices, on the other hand, was always disabled unless you specifically enabled it by modifying Package.swift.This changes the paradigm by enabling
RawSyntax
layout and token validation whenever theSWIFTSYNTAX_ENABLE_RAWSYNTAX_VALIDATION
conditional compilation flag is set. I am planning to set this compilation flag on SwiftSyntax’s PR testing jobs at first and, after considering the performance impact, also on Swift’s PR jobs. This should give us two advantages:RawSyntax
layout validation (which is really just a way to debug serious issues while working on SwiftSyntax itself).