Use different folders with integrity or without#7586
Merged
Conversation
arcanis
added a commit
that referenced
this pull request
Oct 8, 2019
* Uses a different folder for pkgs with integrity or without * Fixes for when integrity is an object instance * Stores whether integrity exists or not * Updates a lockfile to reference the integrity * Fixes resolver check * Fixes cache pattern
VincentBailly
pushed a commit
to VincentBailly/yarn
that referenced
this pull request
Jun 10, 2020
* Uses a different folder for pkgs with integrity or without * Fixes for when integrity is an object instance * Stores whether integrity exists or not * Updates a lockfile to reference the integrity * Fixes resolver check * Fixes cache pattern
VincentBailly
pushed a commit
to VincentBailly/yarn
that referenced
this pull request
Jun 10, 2020
* Uses a different folder for pkgs with integrity or without * Fixes for when integrity is an object instance * Stores whether integrity exists or not * Updates a lockfile to reference the integrity * Fixes resolver check * Fixes cache pattern
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.
Summary
When installing a package, Yarn used to always store it based on it's old sha1 checksum. To prevent cache injection issues, we started checking that the cache was in a consistent state before installing it. Unfortunately, it means that various errors are reported when packages got installed without integrity fields and later need to be installed with an integrity field.
This diff fixes that by using different folders for those two use cases. It's slightly worse for performances (since some packages will be downloaded twice in this very specific situation), but much better from a UX perspective.
Note that the real fix will come with the v2, since the cache system will be completely different and won't suffer from this kind of problems.
Fix #7584
Test plan
Tested locally.