Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@gaaclarke
Copy link
Member

fixes flutter/flutter#72025

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.
  • The reviewer has submitted any presubmit flakes in this PR using the engine presubmit flakes form before re-triggering the failure.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

});

IsolateMaker isolate_maker;
#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_PROFILE || \
Copy link
Member Author

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.

Copy link
Member

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.

@gaaclarke
Copy link
Member Author

@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.

Copy link
Member

@xster xster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM so far

Dart_IsolateFlags* flags, char** error) {
return Dart_CreateIsolateInGroup(
/*group_member=*/spawning_isolate->isolate(),
/*name=*/"spawn",
Copy link
Member

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?

Copy link
Member Author

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.

FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE
if (spawning_isolate) {
isolate_maker = [spawning_isolate](
std::shared_ptr<DartIsolateGroupData>* isolate_group_data,
Copy link
Member

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?

Copy link
Member

@chinmaygarde chinmaygarde left a 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);
Copy link
Member

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.

Copy link
Member Author

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.

@gaaclarke gaaclarke force-pushed the lfe-create-in-group branch 2 times, most recently from ec622eb to d9d572c Compare January 22, 2021 00:41
@gaaclarke gaaclarke marked this pull request as ready for review January 22, 2021 00:50
"--precompilation",
};
static const char* kDartPrecompilationArgs[] = {"--precompilation",
"--enable-isolate-groups"};
Copy link
Member Author

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.

@gaaclarke gaaclarke force-pushed the lfe-create-in-group branch from d9d572c to e3f851b Compare January 22, 2021 01:37
@gaaclarke
Copy link
Member Author

@xster Do you know where we can change the LUCI script so we can get runtime_unittests built for release before we run the tests? I can't seem to find it, it isn't with the recipes.

@xster
Copy link
Member

xster commented Jan 22, 2021

Screen Shot 2021-01-22 at 5 49 26 AM

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

# 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member Author

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.

Copy link
Member

@xster xster left a 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.

@xster
Copy link
Member

xster commented Jan 22, 2021

Latest LGTM

@gaaclarke gaaclarke added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jan 22, 2021
zanderso pushed a commit to flutter/flutter that referenced this pull request Jan 25, 2021
* 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)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Dart's lightweight isolates between multiple engines

6 participants