-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Yarn rebuilds native dependencies during pruning #526
Comments
Thanks for all your feedback @edmorley :) Is most / all the extra time is coming from the prune step compiling native dependencies? p95 and p99 seem unaffected, but we have seen a spike in median build time (change pushed around 20:30): I was unaware that yarn would rebuild native dependencies in this case, but that does make sense. I'll see what the options are for fixing this. |
The breakdown is as follows (using the timestamps in the log)... Pre-#519 (log excerpt):
With #519 and no environment variable overrides (log excerpt):
With #519 and
Ah so it seems to be due to the use of STR:
Expected:
Actual:
--- .yarn-integrity-original
+++ node_modules/.yarn-integrity
@@ -4,6 +4,7 @@
"node_modules"
],
"flags": [
+ "ignoreScripts",
"production"
],
"linkedModules": [], It does seem reasonable for yarn to store the flags used in the integrity file -- since in the reverse case (ie: As such I think there are two things to consider tweaking:
|
We are seeing much higher pruning times for yarn than npm, and I suspect that this is why. There are binary dependencies lurking in many build trees.
|
Ah of course - I was thinking the lifecycle scripts of the deps themselves, but there's also the root That said with (2) fixed, the only people running prune will be those who actually have something to prune - so some kind of invalidation would be happening regardless of the flags change to |
At the very least, this only results in a longer install and not a broken install, and it's something the yarn team is aware of yarnpkg/yarn#932 |
Hi!
For one of our projects, the durations of the nodejs buildpack part of our compile are as follows (all times are with zero changes to
yarn.lock
since the last build):YARN_PRODUCTION=true
+ interim build: 45 seconds (log excerpt)From both reading the last of the linked logs and from looking back over the PR, It seems that even with
YARN_PRODUCTION=true
, the pruning step still happens (and in our case takes quite a while - likely in part due to yarnpkg/yarn#932).Is this intended? I would have thought that for those installing only
dependencies
(viaYARN_PRODUCTION=true
), the prune step would not need to run at all?Many thanks :-)
The text was updated successfully, but these errors were encountered: