-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Cannot run a snapshot with --preview-dart-2
#32911
Comments
Do we need this fixed to unblock #32188 ? |
Script snapshots add nothing over kernel files. Bug: #32911 Change-Id: If7a58ce8ec5305462e9bf449d02394c87579c9a4 Reviewed-on: https://dart-review.googlesource.com/51801 Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
We can make some progress by running from source always for Dart 2 mode but we'll be paying a performance cost. |
@natebosch, in Dart 2 appjit snapshots is what works, no script snapshots. Did you try an appjit? |
No we have not tried appjit snapshots. This will require some work in pub, I'm not sure how significant. Is there reason we aren't supporting non-jit snapshots? |
In dart 2, the kernel file is the equivalent of script snapshot. You can generate kernel files for the vm using the gen_kernel tool and then pass this to the VM instead of source. |
I can't find |
@a-siva @alexmarkov, we are not shipping the |
cc @mit-mit we should think about whether gen_kernel is the right name for this tool. |
So, um, why do we need a different tool? Why doesn't |
Script snapshotting through kernel _used_to work... Now though I get this:
|
Big +1 for making it work again, and not introducing yet another tool. |
Interestingly this still works:
Updated last command... |
@a-siva - assigning to you. We need this to create and run Dart 2 snapshots for |
@natebosch do we need this to work only when building SDK or do we need this to work from SDK itself too? |
We need this to work externally to the SDK.
Similarly in |
Disclaimer: I'm not suggesting we do this exactly as such, but the following hack (or proof of concept or whatnot) at least works on a hello world script:
Again: I'm not saying we should do it like this, but maybe this can give someone else a starting point. Update: I just tried on dart2js, and that doesn't work with the above. It appears that many |
CL https://dart-review.googlesource.com/c/sdk/+/52740 out for review sivalinuxmach[sdk]>out/ReleaseX64/dart --preview-dart-2 --snapshot=/tmp/hello.snapshot /tmp/hello.dart |
Any update on this, @a-siva ? |
CL https://dart-review.googlesource.com/c/sdk/+/52740 has landed. Can this be closed? |
Yes the CL has landed and stuck, closing issue. |
4b1180a – landed in -dev.53 |
If I create a snapshot without
--preview-dart-2
and try to run it with--preview-dart-2
I get some long stack traces starting with:If I create a snapshot with
--preview-dart-2
and try to run it with--preview-dart-2
I get a bunch of garbage output that make it look like it's trying to parser the binary file as dart text source then a stack trace.If I create a snapshot with
--preview-dart-2
and try to run it without any VM arguments I get a sensible error:The text was updated successfully, but these errors were encountered: