-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add the ability to spawn an isolate in Dart 2 preview mode #32253
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
Comments
I'd much rather have the Dart version embedded in the dill file that the VM uses to spawn the isolate. Alternatively, make |
@kevmoo @devoncarew How important is this for general travis testing with Dart 2? Some options:
|
Hold on a sec--if we don't plan to support running Dart 2 code from source, that's news to me. It also has major implications for all sorts of tooling. My understanding was that the VM would embed the common front end to do the initial type checking. Isn't that how
#32188 is tracking this, but there are a lot of complexities involved. In addition to getting the transitive closure of pub (which includes the analyzer and dart2js) Dart-2-clean, we'd need to build both Dart 1 and Dart 2 snapshots of pub, bundle them with the SDK, and have pub's wrapper scripts parse arguments to figure out which one to invoke. It's not impossible, but it would be a lot of work.
We used to do this, and it caused all kinds of problems around performance, signal-handling, and standard IO piping. I don't want to regress that behavior, and I'm not keen on adding an alternate code path that has more behavioral differences than just the Dart 2 semantics. |
@nex3 - The VM supports running Dart 2 code from source we don't plan on getting rid of that. @vsmenon - about the ability for the VM to run some isolates in strong mode and others not - we don't currently have support for this when running from source but it should be possible to do this (currently we start the CFE isolate eagerly under the --preview-dart-2 flag but if we made that lazy then this should be possible). |
@rmacnak-google (see offline email about a possible way to get this working quickly) |
re: #32253 (comment)
IMO, very important. I just rolled a new version of If we're asking our ecosystem to try to be fully Dart-2 compliant by I/O, we need to give them the tools to do so... /cc @eseidelGoogle (I found my way here from dart-lang/pub#1807) |
Discussing with @a-siva it sounds like the right solution to this is just to make pub Dart 2 compliant, which would obviate the need for this feature request to be resolved -- because the main pub isolate could be started in Dart 2. |
Landing dart-lang/pub#1857 first will make this a lot easier, since the surface area of pub will be reduced substantially. ETA – next few days. |
Please confirm my understanding:
|
It is not currently possible to run a VM test with dart 2 semantics using It is possible to run a DDC test with dart 2 semantics. I think it should be possible to run a VM test with dart 2 semantics using a hacky workaround of invoking the package:test entrypoint directly (have you find it first) instead of going through |
Just tried this. |
Filed an issue for the bug in front_end: #32867 I can't confirm with certainty that fixing this will unblock testing though. |
Closing since I don't think we're going to support running Isolates in a different mode from the rest of the VM. For now the solution is |
Pub users want to be able to run their executables via
pub run
using Dart 2 preview mode (see dart-lang/pub#1807 and flutter/flutter#14728 (comment)). Becausepub run
runs executables in isolates, this means it'll need to be able to spawn an isolate that uses Dart 2 preview mode.I suggest adding a
bool previewDart2
flag toIsolate.spawnUri()
that will become a deprecated no-op once Dart 2 releases.The text was updated successfully, but these errors were encountered: