-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 pack
produces slightly different .tgz
files on different operating systems
#2774
Comments
It turns out Node encodes the operating system when compressing things with the native zlib, so different systems will have different checksums. Fortunately it hasn't been a problem with the cache because we now use zip w/ a wasm version of the zlib (thus guaranteeing determinism), but Unfortunately Node doesn't expose options to control this behaviour and, even if they did, it probably wouldn't be enough: parallelism may cause other deltas during compression, and there would be no way to control that either. The right fix would probably be to use the wasm zlib for compression (thankfully performances for |
Does |
Me neither 😄 I suspect they do; I remember someone mentioning other inconsistent checksum issues on pack when adding npm-powered packages as dependencies, a fews months ago. Perhaps it was this. |
It would seem this is causing checksum mismatch bugs when installing git dependencies as they get packed instead of used as it so it's pretty severe as it's causing everyone to ignore or update checksum mismatches. |
Yeah, that's the workaround. I have a git dependency ( |
Any updates? We're being bit by issue #5136, which is a result of this issue. |
With Yarn 3 there seem to be hash/checksum mismatches for the vendor libraries (opensans, angular 1.0.8) that are stored locally, presumably some issue with the git or file system permissions. Lowish risk as we don't produce official builds from Windows agents, and it's not such a common setup. Additionally, --immutable wasn't used with Yarn 1, so this is still a step forward. Perhaps related to yarnpkg/berry#5136 or yarnpkg/berry#4598 or yarnpkg/berry#2774
This is making it impossible to create deterministic results with |
Creating an issue from this Discord chat.
Describe the bug
Running
yarn pack
produces slightly different archive (.tgz
file) depending on the OS. For example, this is macOS vs. Windows:It comes down to the
OS
header, as described in RFC1952.To Reproduce
yarn pack
on e.g. macOS.yarn pack
on e.g. Windows.Environment if relevant (please complete the following information):
Additional context
Discord chat.
Search terms: operating system, OS, Windows, Linux, macOS, Mac,
yarn pack
, tarball, archive, TGZ, GZIP, ZIP.The text was updated successfully, but these errors were encountered: