mirror of
https://github.com/flutter/flutter
synced 2024-11-05 18:37:51 +00:00
e410b7cd5e
Uses kernel concatenation to concatenate the `program.dill` and `native_assets.dill`. This will enable compiling `native_assets.dill` after `program.dill` so that tree-shaking information can be used. Issue: * https://github.com/flutter/flutter/issues/146270 ## Implementation choices * We can either run the frontend_server twice as a process invocation (current PR), or keep the process running after the dart compilation and then shut it down after native assets compilation to kernel. Keeping the process running would require more coordination between different `Target`s. * We can either chose to only do separate kernel file compilation in release (AOT) builds, or do it both for JIT and AOT (current PR). Doing it differently in JIT/AOT means more conditionals in lib/src/build_system/targets/, doing it single-shot in JIT might be more performant though. Update: Both of these are mitigated by not running the kernel compiler process if there are no native assets at all. ## Implementation notes This only updates `flutter assemble`. The kernel compilation calls in `flutter run` do not require kernel concatenation. The native-assets-kernel-mapping in `flutter run` contains results from `--dry-run` invocations of `hook/build.dart` (and in the future `hook/link.dart`). These `--dry-run` invocations do not get access to tree-shaking information, so the `link` hook to be introduced later can be run before Dart compilation. ## Tests * Updated the `Target`s tests to reflect the new implementation. ## Related CLs * frontend_server support: https://dart-review.googlesource.com/c/sdk/+/363567 * Same PR for Dart standalone: https://dart-review.googlesource.com/c/sdk/+/362384 |
||
---|---|---|
.. | ||
flutter | ||
flutter_driver | ||
flutter_goldens | ||
flutter_localizations | ||
flutter_test | ||
flutter_tools | ||
flutter_web_plugins | ||
fuchsia_remote_debug_protocol | ||
integration_test | ||
analysis_options.yaml |