-
Notifications
You must be signed in to change notification settings - Fork 231
improvements for binary executables #2099
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
Comments
Reading: I'm starting to think that we might have two things we can do here: A) We should maybe not be pre-compiling scripts from B) in pana reduce package score if there are libraries in |
Fwiw I would actually love it if pub stopped precompiling scripts completely on pub get/upgrade - it is really slow and could instead be done lazily always. That would also make it so pub get/upgrade don't fail just because of a bad executable (you would get the error later when you try to actually run the offending script), and also it would allow it to re-snapshot them if you delete your local pub cache (in .dart_tool of your package). Today if you do that you lose all snapshots until you run pub get/upgrade again so all binaries are slow after that point. The downside of course is the first run of these executables is slow, but I think that is probably ok, or at least a reasonable tradeoff. Packages should be able to release executables without increasing pub get/upgrade times for all users who have a transitive dep on their package by multiple seconds which is the case today. |
@sigurdm was also suggesting we made pre-compilation of scripts lazy. |
This issue is specifically |
Yet, some packages contain many targets that you never run.. as a package may define multiple executable scripts. I agree that, lazy pre-compilation is mostly a problem for |
We made script precompilation lazy for dependencies: #2277 |
I was recently surprised that a package I published failed to install via
pub global activate
.My issue was that I had some shared code in libraries within the
bin/
folder that are not binaries themselves. When I ranpub global activate
I saw that precompilation failed on those libraries. I was surprised by this because the libraries were not listed in the executables section in the pubspect.yaml file and because, during development, activating via path (pub global activate -s path ...
) gives no warning of the issue.My workaround is to move the shared code under
bin/src/
. However, I wonder:To reproduce this, try:
and you'll see errors like:
The text was updated successfully, but these errors were encountered: