-
Notifications
You must be signed in to change notification settings - Fork 6k
Started using Dart_CreateInGroup when using spawn on a release build #23782
Started using Dart_CreateInGroup when using spawn on a release build #23782
Conversation
runtime/dart_isolate.cc
Outdated
| }); | ||
|
|
||
| IsolateMaker isolate_maker; | ||
| #if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_PROFILE || \ |
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.
@mkustermann Are AOT builds still required? It seems like it from dart-lang/sdk#36097 but I thought I would 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.
Yes, we're still working on JIT.
c9f399f to
6019d79
Compare
|
@chinmaygarde @xster I still have to figure out how to test this. I just wanted to get a read on if the guarding mechanisms for this route are to your liking and get your thoughts on testing. |
xster
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.
LGTM so far
runtime/dart_isolate.cc
Outdated
| Dart_IsolateFlags* flags, char** error) { | ||
| return Dart_CreateIsolateInGroup( | ||
| /*group_member=*/spawning_isolate->isolate(), | ||
| /*name=*/"spawn", |
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.
What's the impact of this name? Add some comments?
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'm not sure, I moved over the same name selection from the other section.
runtime/dart_isolate.cc
Outdated
| FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE | ||
| if (spawning_isolate) { | ||
| isolate_maker = [spawning_isolate]( | ||
| std::shared_ptr<DartIsolateGroupData>* isolate_group_data, |
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.
do you need to use this somehow? Add some comments?
chinmaygarde
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.
Other than the nit about error handling (and double checking the error message buffer). Looks good so far.
| (*isolate_group_data)->GetAdvisoryScriptEntrypoint().c_str(), | ||
| (*isolate_group_data)->GetIsolateSnapshot()->GetDataMapping(), | ||
| (*isolate_group_data)->GetIsolateSnapshot()->GetInstructionsMapping(), | ||
| flags, isolate_group_data, isolate_data, error); |
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.
In case of error, the error message must be printed to the log (like elsewhere in this TU). Also, can you make sure we don't have to free the error message buffer? The Dart APIs are a bit inconsistent about what to do with the error buffer. Something you have to free it otherwise its a small leak.
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 tonic class DartErrorString is taking care of that here, it was a bit harder to follow before. It should be more clear now.
ec622eb to
d9d572c
Compare
| "--precompilation", | ||
| }; | ||
| static const char* kDartPrecompilationArgs[] = {"--precompilation", | ||
| "--enable-isolate-groups"}; |
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.
@mkustermann Is there a risk to turning this on for users that don't ever call Dart_CreateIsolateInGroup? I worry about affecting the stability of users who don't use these experimental APIs.
d9d572c to
e3f851b
Compare
|
@xster Do you know where we can change the LUCI script so we can get |
|
Looks like we're already building for profile/release and testing for them https://cs.opensource.google/flutter/recipes/+/master:recipes/engine.py;l=684 |
testing/run_tests.py
Outdated
| # TODO(tbd): Remove this explicit testing of release builds after lightweight | ||
| # isolates are supported in JIT mode. | ||
| release_runtime_out_dir = EnsureReleaseRuntimeTestsAreBuilt() | ||
| RunEngineExecutable(release_runtime_out_dir, 'runtime_unittests', filter, shuffle_flags) |
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.
according to https://cs.opensource.google/flutter/recipes/+/master:recipes/engine.py;l=684?q=file:recipes%2Fengine.py, we might not have to do this
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.
We need run_tests.py able to run locally too. I would have expected the build to be a noop, but looks like the goma check might be happening before it releases it doesn't need to build something.
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.
in that case, wouldn't you do run_tests.py --type=engine --variant=host_release_unopt?
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 tried host_release_unopt I removed that after reading through the recipe, I think it's using host_release https://cs.opensource.google/flutter/recipes/+/master:recipes/engine.py;l=683?q=file:recipes%2Fengine.py
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'm going to put a try block around the build so that it can continue to execution on the server, but hopefully still build locally.
xster
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.
If the new unit tests pass on release mode, LGTM.
|
Latest LGTM |
* 004d8ad Roll Skia from cc6961b9ac5e to 6a272434c2b2 (3 revisions) (flutter/engine#23864) * 7c2da3b reland of flutter/engine#23634 (flutter/engine#23865) * a4f02b7 Share Android surface GrDirectContext (flutter/engine#23798) * 31ef1dd Roll Skia from 6a272434c2b2 to bfc9be0f773f (2 revisions) (flutter/engine#23867) * 6dec57f Remove workarounds now that type promotion accounts for local boolean variables. (flutter/engine#23862) * a787229 Roll Skia from bfc9be0f773f to 3193ff271628 (5 revisions) (flutter/engine#23872) * a242dd8 [web] Fix shadows for arbitrary paths on PhysicalShape (flutter/engine#23830) * 05b4bec Started using Dart_CreateInGroup when using spawn on a release build (flutter/engine#23782)

fixes flutter/flutter#72025
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.