This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Compile embedder unit test Dart to kernel #7227
Merged
cbracken
merged 2 commits into
flutter:master
from
cbracken:embedder-unittests-build-kernel
Dec 15, 2018
Merged
Compile embedder unit test Dart to kernel #7227
cbracken
merged 2 commits into
flutter:master
from
cbracken:embedder-unittests-build-kernel
Dec 15, 2018
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As of the migration to Dart 2, it has been necessary to compile Dart to kernel prior to execution. The embedder currently requires that the resulting kernel file be named `kernel_blob.bin` and be located at the root of the assets directory passed to the embedder API. This patch updates the test_fixtures build rule to perform a kernel compile using frontend_server, outputting `kernel_blob.bin` to `fixtures/test_target_name` directory, and updates the embedder unittests to specify the kernel file rather than the Dart source file. Since the kernel compiler requires a `main()` function to be defined, it also updates `simple_main.dart` from runtime_unittests to define `main()` rathern than `simple_main()`.
chinmaygarde
approved these changes
Dec 15, 2018
| "--sdk-root", rebase_path("$root_out_dir/flutter_patched_sdk"), | ||
| "--strong", | ||
| "--target", "flutter", | ||
| "--output-dill", rebase_path("$fixtures_location/kernel_blob.bin"), |
Member
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 am not entirely sure but if you put these files in the inputs sections, it will re-run the target if they change on disk.
Member
Author
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.
SGTM - will update. I'm assuming you mean invoker.fixtures? It looks like it's already being picked up (I assume via cleverness in how foreach is implemented). A gn desc for the kernel target gets me:
Target //flutter/shell/platform/embedder:fixtures_kernel
Type: action
Toolchain: //build/toolchain/mac:clang_x64
visibility
*
testonly
false
public
[All headers listed in the sources are public.]
inputs
//flutter/shell/platform/embedder/fixtures/simple_main.dart
//out/host_debug_unopt/frontend_server.dart.snapshot
script
//third_party/dart/build/gn_run_binary.py
args
compiled_action
/Users/chris/src/flutter/engine/src/third_party/dart/tools/sdks/dart-sdk/bin/dart
--dfe=/Users/chris/src/flutter/engine/src/third_party/dart/tools/sdks/dart-sdk/bin/snapshots/kernel-service.dart.snapshot
/Users/chris/src/flutter/engine/src/out/host_debug_unopt/frontend_server.dart.snapshot
--sdk-root
/Users/chris/src/flutter/engine/src/out/host_debug_unopt/flutter_patched_sdk
--strong
--target
flutter
--output-dill
/Users/chris/src/flutter/engine/src/out/host_debug_unopt/gen/flutter/shell/platform/embedder/fixtures/assets/kernel_blob.bin
/Users/chris/src/flutter/engine/src/flutter/shell/platform/embedder/fixtures/simple_main.dart
outputs
//out/host_debug_unopt/gen/flutter/shell/platform/embedder/fixtures/assets/kernel_blob.bin
Direct dependencies (try also "--all", "--tree", or even "--all --tree")
//third_party/dart/utils/kernel-service:frontend_server
I definitely will fix the testonly flag though.
cbracken
added a commit
that referenced
this pull request
Dec 15, 2018
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Dec 16, 2018
engine-flutter-autoroll
added a commit
to flutter/flutter
that referenced
this pull request
Dec 16, 2018
flutter/engine@101b27d...4941125 git log 101b27d..4941125 --no-merges --oneline 4941125 Revert "Compile embedder unit test Dart to kernel (#7227)" (flutter/engine#7230) f7d91d6 Roll src/third_party/skia 282ec5dc6ca7..2e6db18c4309 (1 commits) (flutter/engine#7228) ac9e521 Compile embedder unit test Dart to kernel (flutter/engine#7227) 828acc7 Roll src/third_party/skia d4962e7e07c0..282ec5dc6ca7 (1 commits) (flutter/engine#7226) 8a7ae95 Undeprecated BigInteger support, but document what it actually does. (flutter/engine#6903) 1778924 Offset.fromDirection and Size.aspectRatio (flutter/engine#6805) 9ae8217 Roll src/third_party/skia 8b78d70b9a10..d4962e7e07c0 (1 commits) (flutter/engine#7225) a987b17 Roll src/third_party/skia a1bded9a4f28..8b78d70b9a10 (1 commits) (flutter/engine#7224) ac05993 Roll src/third_party/skia 16d00eeef7d1..a1bded9a4f28 (2 commits) (flutter/engine#7223) 91bb1f8 Roll src/third_party/skia f391d0f771c6..16d00eeef7d1 (4 commits) (flutter/engine#7222) 6c40f84 [vulkan] Fix Fuchsia build 4f148ed Roll src/third_party/skia f6206f91b3c1..f391d0f771c6 (4 commits) (flutter/engine#7220) 1bc7ccf Support real fonts in 'flutter test' (flutter/engine#6913) 5244cf4 Roll src/third_party/skia 59c9f1595ecd..f6206f91b3c1 (1 commits) (flutter/engine#7219) 0f10d3f Roll src/third_party/skia 42e7a7ed6511..59c9f1595ecd (3 commits) (flutter/engine#7218) 1676421 Roll src/third_party/skia 21a7be0741ac..42e7a7ed6511 (1 commits) (flutter/engine#7217) 1a2714b Adds force cursor support (flutter/engine#6945) b50e349 Roll src/third_party/skia cb6b4bde0c2e..21a7be0741ac (3 commits) (flutter/engine#7216) 826f342 [Fuchsia] Depend on libtrace when that is what's really meant (flutter/engine#7214) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll 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 ([email protected]), and stop the roller if necessary.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As of the migration to Dart 2, it has been necessary to compile Dart to
kernel prior to execution. The embedder currently requires that the
resulting kernel file be named
kernel_blob.binand be located at theroot of the assets directory passed to the embedder API.
This patch updates the test_fixtures build rule to perform a kernel
compile using frontend_server, outputting
kernel_blob.bintofixtures/test_target_namedirectory, and updates the embedderunittests to specify the kernel file rather than the Dart source file.
Since the kernel compiler requires a
main()function to be defined, italso updates
simple_main.dartfrom runtime_unittests to definemain()rather thansimple_main().