build icon indicating copy to clipboard operation
build copied to clipboard

Support running .dill files in `run` command

Open thosakwe opened this issue 6 years ago • 3 comments

This will be a very simple PR to implement. Because we have build_vm_compilers, and can generate .dill files already, allowing run to support .dill would let users skip the initial Dart-to-kernel compilation step when running scripts, especially if the scripts haven't changed since the last run.

The line to change is here: https://github.com/dart-lang/build/blob/master/build_runner/lib/src/entrypoint/run_script.dart#L86

This code:

if (p.extension(scriptName) != '.dart')

Will simply become:

if (!const ['.dart', '.dill'].contains(p.extension(scriptName)))

Am I good to send in a PR for this?

thosakwe avatar May 01 '19 08:05 thosakwe

Work is done in this branch: https://github.com/thosakwe/build/tree/run-dill

thosakwe avatar May 01 '19 08:05 thosakwe

We definitely want to support running from dill, if build_vm_compilers is present.

I think we should do it automatically though, we can discover if the .app.dill file is present for the dart file and run that instead.

jakemac53 avatar May 01 '19 13:05 jakemac53

Awesome!

thosakwe avatar May 02 '19 17:05 thosakwe

We have deprecated build_vm_compilers due to lack of usage

jakemac53 avatar Sep 01 '23 17:09 jakemac53