Ignore cache misses prior to fetch step to allow mode=update-lockfile#7176
Open
ReDrUm wants to merge 1 commit into
Open
Ignore cache misses prior to fetch step to allow mode=update-lockfile#7176ReDrUm wants to merge 1 commit into
ReDrUm wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What's the problem this PR addresses?
In some situations yarn can fail with an
ENOENTerror if a cache miss occurs during ayarn --mode=update-lockfileinvocation where it should be inconsequential.The
ENOENTerror is thrown by Yarn after it records a cache miss and then tries tostatthe expected cache file in https://github.com/yarnpkg/berry/blob/master/packages/yarnpkg-core/sources/Project.ts#L1174Project.fetchEverythingwas reusing the wholereport.cacheMissesset and trying tostatthe local cache even for misses that happened before the fetch step and never wrote into.yarn/cache.How did you fix it?
Revise the
Projectto track the cache misses and ignore misses prior to the fetch step.Tested on my local project which was affected by the issue, and overcame it with these changes.
Example of affected entry:
Checklist