Always precompile scripts before running them #3074
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #3073
The idea is that since we have incremental compilation, its worth actually compiling the scripts and running that compiled script. For mutable packages we still always re-compile before each run, but it will be much faster to do so, as each build will be incremental.
This makes running pub executables from source much faster, and it also means you will get some more immediate feedback (the
Building package executable...
message). Previously it was just a blank screen for several seconds (depending on size of the app).Note that this does mean we will always emit some log messages about building scripts for each run. This could break some scripts that rely on the stdout of pub executables. This was always the case for the first run of an immutable package ran with
pub run
, but would come up more often now. We could consider moving that output tostderr
, or suppressing it, but I do think it is actually nice, when running interactively.