bugfixes to yarn pack, retry of #1464 #2062
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.
This is an updated version of #1464 which had to be reverted because of ci errors.
The errors were caused by changes in the yarn code after the PR was created (util/fs.copy() has an additional parameter).
This is fixed in this PR.
@bestander you asked me to ping you when this is done.
below is the original message of #1464:
Summary
Contains two fixes for yarn pack if "files" is used in package.json:
Please note that this only partly fixes #755 .
As far as I can see what happens in #755 is the following:
While working on this I was wondering why a missing file would create a corrupt archive, but it seemed to be fixed at first. Then I added some more testcases and noticed that it is still possible to create corrupt archives, but this is not limited to the usage of "files" - see #1442.
Basically I think some directory was falsely included, and that invoked the bug described in #1442 .
But a missing or included file does not directly result in a corrupt archive.
Hope this makes sense, I find it difficult to explain right now.
Test plan
I have added some tests for this, just run yarn test.
If you want to see the failing tests checkout 6612ec6.