-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[pigeon] [swift] Fix PigeonError
sendability conformance in Swift 6
#8302
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
[pigeon] [swift] Fix PigeonError
sendability conformance in Swift 6
#8302
Conversation
This will break old sdk where Sendable is undefined. You may have to put it behind a flag. |
Are there any minimum Xcode requirements for Flutter projects? Sendable was added in Xcode 13.0 with Swift 5.5. |
packages/pigeon/CHANGELOG.md
Outdated
@@ -1,6 +1,7 @@ | |||
## NEXT |
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.
This should be updated to 22.7.1 along with the pubspec version and the generator_tools file.
I guess this is technically a breaking change, so 23.0.0 might be more correct.
packages/pigeon/CHANGELOG.md
Outdated
@@ -1,6 +1,7 @@ | |||
## NEXT | |||
|
|||
* Updates minimum supported SDK version to Flutter 3.22/Dart 3.4. | |||
* [swift] Make `PigeonError` Class Conform to `Sendable` |
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.
[swift] Changes `PigeonError` class to conform to `Sendable`.
@stuartmorgan shouldn't this pr be failing the test exemption check? |
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.
lgtm after addressing the comments.
PigeonError
Class Conform to Sendable
PigeonError
class to conform to Sendable
.
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.
@stuartmorgan shouldn't this pr be failing the test exemption check?
I think there's a false negative due to the changes to generated files in platform_tests
; we should probably tune the Cocoon rules to ignore .gen.
files in there.
Regardless, this does need testing. A Dart unit test should be fine for this for now (although long term we probably want to adjust the Swift integration tests to actually test a flow that ensures that everything is Sendable
)
I have added the Dart test introduced by this PR. I also agree that the long-term solution would involve updating the Swift integration tests—not just to check for |
…pigeon-error-sendable
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.
Thanks for putting this together, looks good to merge to me.
auto label is removed for flutter/packages/8302, due to This PR has not met approval requirements for merging. Changes were requested by {stuartmorgan}, please make the needed changes and resubmit this PR.
|
@stuartmorgan you'll need to approve this one to land it. |
packages/pigeon/CHANGELOG.md
Outdated
@@ -1,3 +1,7 @@ | |||
## 23.0.0 | |||
|
|||
* [swift] Changes `PigeonError` class to conform to `Sendable`. |
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.
Breaking changes need to follow the CHANGELOG style guide for breaking changes.
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.
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.
I don't think change log is accurate, because PigeonError
already conforms to Error
before this PR (and Error
s are by design Sendable
). This PR does not change this conformance.
How about "Fixes a compile error about PigeonError
's sendability conformance in Swift 6"?
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.
If it was already Sendable, why would we need to change Any? to Sendable? I'm confused.
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.
The PigeonError
type itself was Sendable
, but its details
field was not Sendable
, hence the compile error in Swift 6 (or compile warning in Swift 5's strict mode).
That being said, this PR is still a breaking change tho, because the init
signature is changed.
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.
Sorry for the delay—I was on a national holiday.
Yes, the above discussion is correct. PigeonError
already conforms to Error
, which also makes it Sendable
. However, the type of its details
field prevents it from conforming under Strict Concurrency, leading to a compilation error in Swift 6.
Fixes made, enough reviews to land
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.
Sorry for the block (I removed autosubmit tag), just saw the discussion on CHANGELOG and left a comment there: #8302 (comment)
I fixed that, can you approve so we can land? |
Co-authored-by: hellohuanlin <[email protected]>
PigeonError
class to conform to Sendable
.PigeonError
sendability conformance in Swift 6
autosubmit label was removed for flutter/packages/8302, because This PR has not met approval requirements for merging. Changes were requested by {stuartmorgan}, please make the needed changes and resubmit this PR.
|
@stuartmorgan not sure what the deal is here. I did "invalidate" your review since it had been addressed. Might be related. |
autosubmit label was removed for flutter/packages/8302, because This PR has not met approval requirements for merging. Changes were requested by {stuartmorgan}, please make the needed changes and resubmit this PR.
|
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.
Weird, seems like a Cocoon bug one way or another.
flutter/packages@02c6fef...e6ce02c 2025-02-05 [email protected] [vector_graphics] Allow transition between placeholder and loaded image to have an animation (flutter/packages#8195) 2025-02-04 [email protected] [flutter_markdown] Make custom table column alignments work when text wraps (flutter/packages#8340) 2025-02-04 [email protected] [interactive_media_ads] Adds internal wrapper for iOS native `IMAAdPodInfo` (flutter/packages#8429) 2025-02-03 [email protected] [pigeon] reorg generator files (flutter/packages#8532) 2025-02-03 [email protected] [pigeon] [swift] Fix `PigeonError` sendability conformance in Swift 6 (flutter/packages#8302) 2025-02-03 [email protected] Roll Flutter from b007899 to 8e2a6fc (61 revisions) (flutter/packages#8556) 2025-02-03 [email protected] [google_maps_flutter] Support for Ground Overlay - platform interface (flutter/packages#8518) 2025-01-31 [email protected] [tool] Add --xcode-warnings-exceptions flag (flutter/packages#8524) 2025-01-31 [email protected] [tool] Ensure that injected dependency overrides are sorted (flutter/packages#8542) 2025-01-31 [email protected] [vector_graphics] Revert leak tracker change (flutter/packages#8544) 2025-01-31 [email protected] [shared_preferences_tool] Loosen vm_service constraint to allow for 15 (flutter/packages#8539) 2025-01-31 [email protected] [in_app_purchase] Activate leak testing for android (flutter/packages#8369) 2025-01-31 [email protected] [flutter_markdown] Allow tables to be scrollable with IntrinsicColumnWidth (flutter/packages#8526) 2025-01-30 [email protected] Update CODEOWNERS for pkg:animations (flutter/packages#8534) 2025-01-30 [email protected] Roll Flutter from c1ffaa9 to b007899 (43 revisions) (flutter/packages#8527) 2025-01-30 [email protected] [video_player_web] Adjust Web implementation to the new platform interface (flutter/packages#8528) 2025-01-30 [email protected] [shared_preferences] Exposed SharedPreferencesOptions. (flutter/packages#8530) 2025-01-29 [email protected] Re-land [shared_preferences] Add shared preferences devtool (flutter/packages#8531) 2025-01-29 [email protected] [in_app_purchase_storekit] Add Swift Package Manager compatibility (flutter/packages#8469) 2025-01-29 [email protected] Revert "Re-land [shared_preferences] Add shared preferences devtool" (flutter/packages#8529) 2025-01-29 [email protected] [go_router_builder] Fixes trailing `?` by comparing iterables (flutter/packages#8521) 2025-01-29 [email protected] [tool] Refactor args of strings or YAML file lists (flutter/packages#8513) 2025-01-28 [email protected] [go_router] Add missing await keyword to onTap callback in the code example in `navigation.md` (flutter/packages#8343) 2025-01-28 [email protected] Re-land [shared_preferences] Add shared preferences devtool (flutter/packages#8519) 2025-01-28 [email protected] [vector_graphics] Fix memory leaks and activate leak testing [prod-leak-fix] (flutter/packages#8373) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Ensure
PigeonError
conforms toSendable
for Swift 6.0 compatibility by updating thedetails
property type fromAny?
toSendable?
.Fixes flutter/flutter#160313
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.