-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Update to new mojom Dart generation scheme #5924
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
With this, mojom.dart files are generated into one place in the outdir with the path and package determined by the location of the mojom target (and not a DartPackage annotation). This means dart packages need to declare their dependency on the correct mojom rules and import statements have to match the generated name.
|
@abarth I'll need your help coordinating landing this with rolling the packages that show up in bin/cache/ to make sure they line up. |
abarth
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.
IMHO, the flutter.servces.foo packages names are leaking too much implementation detail from the organization of the engine build tree. I think what we should do is move all these mojom files so the package name for all of them is flutter.services. I'm happy to help wth that part. It will be a little ugly on the implementation side, but at least the API will be more sensible.
I'm more worried about the mojom files that we previous got from package:mojo_services and package:mojo. I don't understand where those are going to come from the new design. Previously we got those packages from pub.
It's possible we can reduce or remove many of these dependencies, but if we go that route, we'll need to study each one in detail.
I guess a larger question is how standalone flutter will obtain package:mojo in the future. Should we switch to downloading it from Google storage (like we do for the packages we produce from engine.git) rather than download it from pub? If so, we'll need some mechanism for publishing updated versions of the packages to Google storage.
| import 'dart:typed_data'; | ||
|
|
||
| import 'package:apps.network.mojo.services.network.interfaces/network_service.mojom.dart' as mojom; | ||
| import 'package:apps.network.mojo.services.network.interfaces/url_loader.mojom.dart' as mojom; |
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.
Where do these mojoms come from in the standalone build?
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.
It's pulled from DEPS, but it's in a different path (which raises a really good question about generation)
| import 'package:flutter/services.dart'; | ||
| import 'package:mojo.public.interfaces.network/http_header.mojom.dart' as mojom; | ||
| import 'package:mojo.public.interfaces.network/url_request.mojom.dart' as mojom; | ||
| import 'package:mojo.public.interfaces.network/url_response.mojom.dart' as mojom; |
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.
Ditto
| import 'package:mojo.services.ui.views.interfaces/view_properties.mojom.dart' as mojom; | ||
| import 'package:mojo.services.ui.views.interfaces/view_provider.mojom.dart' as mojom; | ||
| import 'package:mojo.services.ui.views.interfaces/view_token.mojom.dart' as mojom; | ||
| import 'package:mojo.services.ui.views.interfaces/views.mojom.dart' as mojom; |
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.
These as well.
|
(how the heck do you inline reply in this?) I think if you want to isolate the flutter package from the organization of the mojom files the way to do that is to write dart files in predictable places in the flutter/engine repo that export the symbols needed. That package can be organized however is convenient and can be updated whenever the mojom files or other aspect of generation changes. We can then bundle transport the generated mojom.dart files from the flutter/engine build to the flutter/flutter repo in the same (opaque) way other things are transferred. |
|
We've now removed our mojom dependencies, so this isn't needed. |
flutter/engine@a76054f...76ec93d git log a76054f..76ec93d --date=short --no-merges --format='%%ad %%ae %%s' 2018-08-02 [email protected] Add an explicit `-[FlutterViewController init]` implementation (flutter#5924) 2018-08-02 37626415+[email protected] Roll src/third_party/skia e43024a5bab7..64cc576b1fa7 (1 commits) (flutter#5926) 2018-08-01 37626415+[email protected] Roll src/third_party/skia ed8bc196bd56..e43024a5bab7 (1 commits) (flutter#5925) The AutoRoll server is located here: https://flutter-engine-flutter-roll.skia.org Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff, who should be CC'd on the roll, and stop the roller if necessary.
flutter/engine@a76054f...3f46cd2 git log a76054f..3f46cd2 --date=short --no-merges --format='%%ad %%ae %%s' 2018-08-02 [email protected] Roll Dart to b04def964c428ada007cca7ef6b4936001db965d (flutter#5928) 2018-08-02 [email protected] Add an explicit `-[FlutterViewController init]` implementation (flutter#5924) 2018-08-02 37626415+[email protected] Roll src/third_party/skia e43024a5bab7..64cc576b1fa7 (1 commits) (flutter#5926) 2018-08-01 37626415+[email protected] Roll src/third_party/skia ed8bc196bd56..e43024a5bab7 (1 commits) (flutter#5925) The AutoRoll server is located here: https://flutter-engine-flutter-roll.skia.org Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff, who should be CC'd on the roll, and stop the roller if necessary.
flutter/engine@a76054f...391ac2f git log a76054f..391ac2f --date=short --no-merges --format='%%ad %%ae %%s' 2018-08-02 37626415+[email protected] Roll src/third_party/skia 64cc576b1fa7..578ef2847b72 (20 commits) (flutter#5930) 2018-08-02 [email protected] Roll Dart to b04def964c428ada007cca7ef6b4936001db965d (flutter#5928) 2018-08-02 [email protected] Add an explicit `-[FlutterViewController init]` implementation (flutter#5924) 2018-08-02 37626415+[email protected] Roll src/third_party/skia e43024a5bab7..64cc576b1fa7 (1 commits) (flutter#5926) 2018-08-01 37626415+[email protected] Roll src/third_party/skia ed8bc196bd56..e43024a5bab7 (1 commits) (flutter#5925) The AutoRoll server is located here: https://flutter-engine-flutter-roll.skia.org Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff, who should be CC'd on the roll, and stop the roller if necessary.
flutter/engine@a76054f...3b66f20 git log a76054f..3b66f20 --date=short --no-merges --format='%%ad %%ae %%s' 2018-08-02 [email protected] Don't drop MotionEvents with unknown tool type. (flutter#5931) 2018-08-02 37626415+[email protected] Roll src/third_party/skia 64cc576b1fa7..578ef2847b72 (20 commits) (flutter#5930) 2018-08-02 [email protected] Roll Dart to b04def964c428ada007cca7ef6b4936001db965d (flutter#5928) 2018-08-02 [email protected] Add an explicit `-[FlutterViewController init]` implementation (flutter#5924) 2018-08-02 37626415+[email protected] Roll src/third_party/skia e43024a5bab7..64cc576b1fa7 (1 commits) (flutter#5926) 2018-08-01 37626415+[email protected] Roll src/third_party/skia ed8bc196bd56..e43024a5bab7 (1 commits) (flutter#5925) The AutoRoll server is located here: https://flutter-engine-flutter-roll.skia.org Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff, who should be CC'd on the roll, and stop the roller if necessary.
flutter/engine@4893b07...3b66f20 git log 4893b07..3b66f20 --date=short --no-merges --format='%%ad %%ae %%s' 2018-08-02 [email protected] Don't drop MotionEvents with unknown tool type. (flutter#5931) 2018-08-02 37626415+[email protected] Roll src/third_party/skia 64cc576b1fa7..578ef2847b72 (20 commits) (flutter#5930) 2018-08-02 [email protected] Roll Dart to b04def964c428ada007cca7ef6b4936001db965d (flutter#5928) 2018-08-02 [email protected] Add an explicit `-[FlutterViewController init]` implementation (flutter#5924) The AutoRoll server is located here: https://flutter-engine-flutter-roll.skia.org Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff, who should be CC'd on the roll, and stop the roller if necessary.
With this, mojom.dart files are generated into one place in the
outdir with the path and package determined by the location of the
mojom target (and not a DartPackage annotation). This means dart
packages need to declare their dependency on the correct mojom rules
and import statements have to match the generated name.