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

[snapshot] Failed to generate snapshot #34756

Closed
6643 opened this Issue Oct 11, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@6643

6643 commented Oct 11, 2018

$ dart --version
Dart VM version: 2.1.0-dev.7.0 (Unknown timestamp) on "linux_x64"
$ cat main.dart 
import 'dart:io';

main(List<String> args) {
  print(args);
  HttpServer.bind(InternetAddress.anyIPv4, 2018).then((server) {}).catchError(print);
}
$ dart --snapshot=main.dart.snapshot --snapshot-kind=app-jit main.dart
[]
^C

Execute first and then produce a snapshot?
Why do I need to run the program? The previous version did not need to run and the snapshot was successful.

@lrhn lrhn added the area-vm label Oct 11, 2018

@natebosch

This comment has been minimized.

Show comment
Hide comment
@natebosch

natebosch Oct 11, 2018

Member

The program will run when using --snapshot-kind=app-jit, this has been the case since that snapshot kind was introduced. The VM executes the program in order to get some JIT optimizations. You can use --snapshot-kind=script to get a snapshot built without running the program.

Member

natebosch commented Oct 11, 2018

The program will run when using --snapshot-kind=app-jit, this has been the case since that snapshot kind was introduced. The VM executes the program in order to get some JIT optimizations. You can use --snapshot-kind=script to get a snapshot built without running the program.

@6643

This comment has been minimized.

Show comment
Hide comment
@6643

6643 Oct 12, 2018

@natebosch

$ dart --snapshot=main.dart.snapshot --snapshot-kind=script main.dart 
Unrecognized value for snapshot_kind: 'script'
Valid values are: none, kernel, app-jit

Are you sure you have this parameter?
I have a snapshot generated by the previous version, 3.5M file, which is generated by app-jit method.

6643 commented Oct 12, 2018

@natebosch

$ dart --snapshot=main.dart.snapshot --snapshot-kind=script main.dart 
Unrecognized value for snapshot_kind: 'script'
Valid values are: none, kernel, app-jit

Are you sure you have this parameter?
I have a snapshot generated by the previous version, 3.5M file, which is generated by app-jit method.

@natebosch

This comment has been minimized.

Show comment
Hide comment
@natebosch

natebosch Oct 12, 2018

Member

Ah I had the name wrong. It should be --snapshot-kind=kernel.

If you have a file generated with app-jit then it was generated while running the program, which is a great way to do it when possible.

Member

natebosch commented Oct 12, 2018

Ah I had the name wrong. It should be --snapshot-kind=kernel.

If you have a file generated with app-jit then it was generated while running the program, which is a great way to do it when possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment