-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[pigeon] Write FlutterError utilities for HostAPI #5424
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
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
tarrinneal
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.
This will also need tests added to the swift_generator_tests.dart file testing that a file with only flutter api does generate the ErrorOr class.
If you don't want to deal with these changes, I can wrap it up into my pr that's about to land. let me know.
Thanks for catching this.
|
|
||
| if (hasHostApi) { | ||
| // Always write? | ||
| if (hasFlutterApi || hasHostApi) { |
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 conditional isn't needed here. Just put _writeErrorOr above the pre-existing conditionals.
| ## 13.1.2 | ||
|
|
||
| * Adds compatibilty with `analyzer` 6.x. | ||
| * [cpp] Fix C++ generator skipping FlutterError if no FlutterAPI is defined. |
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 will need to be it's own version bump. With associated changes required (changelog, pubspec, and generator_tools)
|
If you have a PR about to land then feel free to supersede this PR. Appreciate the work! P.S apologies for the messy issue, I was in a rush. Good luck! |
|
Closing as fixed in #5355 |
It seems that when you have a pigeon configuration as follows, some C++ Utility classes are not written in the pigeon header which are required for the generated methods.
I'm not sure why this condition existed in the first place, as it was generating since v10.0.0. Regardless, it breaks compiles on Windows. The HostAPI methods still require FlutterError as shown below, so this clearly is necessary.
List which issues are fixed by this PR. You must list at least one issue.
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
A few things to mention:
flutter testin thepackages/pigeondirectory just spammed a lot ofdart:mirror not supportederrors.Hopefully not a problem, but feel free to cherry pick or just manually implement the fix if these issues block the merge.