Repository navigation
Invalidate & regenerate script snapshots for globally installed dart apps #1217
Description
Activity
<img src="https://avatars.githubusercontent.com/u/5757092?v=3" align="left" width="48" height="48"hspace="10"> Comment by mkustermann
Added Area-Pub label.
<img src="https://avatars.githubusercontent.com/u/5757092?v=3" align="left" width="48" height="48"hspace="10"> Comment by mkustermann
For completeness:
$ which dartformat
/usr/.../kustermann/.pub-cache/bin/dartformat
$ cat $(which dartformat)#!/usr/bin/env sh
This file was created by pub v1.9.0-dev.0.0.
Package: dart_style
Version: 0.1.0-dev
Executable: dartformat
Script: format
dart "/usr/local/google/home/kustermann/.pub-cache/global_packages/dart_style/bin/format.dart.snapshot" "$@"
<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent
Removed Priority-Unassigned label.
Added Priority-High label.- addedtype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
on Jun 5, 2015 <img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3
Try upgrading pub to the latest bleeding edge and running "pub cache repair". This should have been fixed in dart-lang/sdk@c0e3d5f.
<img src="https://avatars.githubusercontent.com/u/5757092?v=3" align="left" width="48" height="48"hspace="10"> Comment by mkustermann
It works, but the fact that it prints
"Wrong script snapshot version, expected 'f6711525cff9f7d0d08595166664b767' found 'a3a313ea90040f8a3aaa5f443ecbb3db'"
is not nice at all.
One way of avoiding this would be to add something like "dart --test-snapshot-compatibility file.snapshot", so one can ask the VM whether it can read the snapshot, instead of just trying to run it and see what happens :-/
If one would implement this, you could also use "exec dart ..." instead.
<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3
I agree. I filed issue dart-lang/sdk#20802 and issue dart-lang/sdk#20784 when we first started supporting snapshots, but nothing has happened there.
Added Fixed label.
<img src="https://avatars.githubusercontent.com/u/5757092?v=3" align="left" width="96" height="96"hspace="10"> Issue by mkustermann
Originally opened as dart-lang/sdk#21904
Reproduction on my machine:
$ pub global activate -sgit https://github.com/dart-lang/dart_style
$ dartformat
Wrong script snapshot version, expected 'f6711525cff9f7d0d08595166664b767' found '74629058babcf012a75ec8e5b364e464'
Pub should make sure to invalidate script snapshots and re-generate them (on demand) when the dart binary changed.