-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Swift migrate] Handle migration for optional features #8711
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
[Swift migrate] Handle migration for optional features #8711
Conversation
In addition to upcoming and experimental features, handle migration for "optional" features (the only one now being StrictMemorySafety). Read optional features from the supported-features JSON coming from the compiler and use their provided flags. While here, use the newly-introduced "categories" field from the JSON to filter the list of categories rather than assuming it's the same as the feature name.
|
@swift-ci please test |
xedin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good, thank you!
|
@DougGregor looks like the failure is related to manifest update: |
|
@swift-ci please test |
|
I had a bad merge; fixed that and improved testing of the "categories" part. |
|
@swift-ci please test Linux |
|
@swift-ci please test Windows |
AnthonyLatsis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you!
| public var categories: [String] { | ||
| switch self { | ||
| case .optional(name: _, migratable: _, categories: let categories, flagName: _), | ||
| .upcoming(name: _, migratable: _, categories: let categories, enabledIn: _), | ||
| .experimental(name: _, migratable: _, categories: let categories): | ||
| categories | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes me want a feature to write self.categories.
…w comments Pass migration flags for optional features through -Xfrontend. The driver will get updated, but separately. Address some code review comments from improve the code. Thanks, Anthony!
|
@swift-ci please test |
|
@swift-ci please test windows |
|
@swift-ci please test self hosted windows |
|
@swift-ci please test windows |
|
@swift-ci please test self hosted Windows |
|
Merging to unblock #8684. |
In addition to upcoming and experimental features, handle migration for "optional" features (the only one now being StrictMemorySafety). Read optional features from the supported-features JSON coming from the compiler and use their provided flags. While here, use the newly-introduced "categories" field from the JSON to filter the list of categories rather than assuming it's the same as the feature name.
…8748) Explanation: Expand migration support to cover optional features like strict memory safety, in addition to upcoming features. While here, also add a test for migration to inferring isolated conformances. Scope: Limited to the migrator. Original PR: #8711 Risk: Very low; it's limited to the migrator. Testing: CI Reviewed by: @xedin, @AnthonyLatsis
In addition to upcoming and experimental features, handle migration for "optional" features (the only one now being StrictMemorySafety). Read optional features from the supported-features JSON coming from the compiler and use their provided flags.
While here, use the newly-introduced "categories" field from the JSON to filter the list of categories rather than assuming it's the same as the feature name.