dart-lang / pub

The pub command line tool
https://dart.dev/tools/pub/cmd
BSD 3-Clause "New" or "Revised" License
1.04k stars 224 forks source link

Suggestion: hide the script snapshot version errors when running dart script #1244

Open DartBot opened 9 years ago

DartBot commented 9 years ago

Issue by sethladd Originally opened as dart-lang/sdk#22308


Hi,

Usability/aesthetics request. When changing your Dart version, and then running a script from pub's bin cache, we'll see this:

sethladd@sethladd-macbookair ~/tmp/angulartest $ stagehand ubersimplewebapp Wrong script snapshot version, expected '9b71a36fb6f35a4247b4baef055b2626' found '836a274342f7f88d6b5a9bb59b2649a9' Wrong script snapshot version, expected '9b71a36fb6f35a4247b4baef055b2626' found '836a274342f7f88d6b5a9bb59b2649a9' Creating ubersimplewebapp application 'angulartest':   /Users/sethladd/tmp/angulartest/.gitignore   /Users/sethladd/tmp/angulartest/CHANGELOG.md   /Users/sethladd/tmp/angulartest/LICENSE   /Users/sethladd/tmp/angulartest/README.md   /Users/sethladd/tmp/angulartest/pubspec.yaml   /Users/sethladd/tmp/angulartest/web/index.html   /Users/sethladd/tmp/angulartest/web/main.dart   /Users/sethladd/tmp/angulartest/web/styles/main.css 8 files written.

--> to provision required packages, run 'pub get' sethladd@sethladd-macbookair ~/tmp/angulartest $

Notice the two "wrong script snapshot version" messages. Two messages is a bit weird, and the message itself isn't that useful to an end user.

Could we display something more user friendly? Suggestion: "Dart VM version changed, generating new snapshot for app"

Thanks!

DartBot commented 9 years ago

Comment by nex3


I'd dearly love to get rid of this message, but unfortunately the VM provides no way to control it (issue dart-lang/sdk#20784) and no alternate way to check if a snapshot is up-to-date (issue dart-lang/sdk#20802).

In theory we could try to filter the executable's stdout for this specific message, but in practice doing this in both the binstub scripts and pub itself a way that doesn't cause further problems is nearly impossible.


Marked this as being blocked by dart-lang/sdk#20784, dart-lang/sdk#20802.

sigurdm commented 3 weeks ago

This might still be relevant - and seems to still be blocked on the vm issues.