-
-
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
[Bug?]: checksum is different from windows and unix for local packages #6105
Comments
Please attach the generated files on Windows and Linux |
I'm not the originator, but I am encountering the same issue when installing on Mac vs Windows. Here's some info I hope helps you resolve it: I have a local package, added as a Mac:
Windows: (Git Bash)
Differences:
Seems it could be resolved by stripping out control characters when zipping? |
Did you per chance configure git on Windows to automatically convert line returns? |
Not that I'm aware of, I have Git Bash installed on many Windows machines, all of them using default installation settings. I can check. |
It was set on Windows, and changing it made a difference, but I still get the checksum mismatch. Mac:
Windows:
I added a .gitattributes file:
Then ran
per https://www.aleksandrhovhannisyan.com/blog/crlf-vs-lf-normalizing-line-endings-in-git/ Windows again:
I committed the .gitattibutes file, and ran Here are verbose zipinfo outputs for comparison. Again the differences are the directory permissions and number of bytes in the package.json file. |
I do not have this option set and have the issue. I believe the permissions are the cause. |
We're having this problem also. It's causing quite a headache when Windows Devs are generating different lockfiles to those on UNIX. |
Folks, isn't it about checksums of packages being calculated on the compressed versions of packages vs the "raw" packages from npm? See my issue from some time ago where I learned about this: #5957 Try setting compression level to 0 in the project -- maybe the differences are due to how the compression algorithm works on various OS? |
Thanks for the suggestion, I hadn't seen that bug. But 1) I'm not using a package from npm - it's a simple And P.S. I agree this is highly annoying, seems to be pretty widespread, and so I'm baffled as to why the maintainers are ignoring it. |
@arcanis kindly remove the 'waiting for feedback' tag, data has been provided |
Hi! 👋 It seems like this issue as been marked as probably resolved, or missing important information blocking its progression. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it. |
Bad @yarnbot |
Yeah, this is definitely not resolved. We had to move one of our repos to |
How do we get a "maintainer to explicitly vouch for it"? |
Hi! 👋 It seems like this issue as been marked as probably resolved, or missing important information blocking its progression. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it. |
Very bad @yarnbot |
Sadly this is breaking for any team that uses both Windows and Unix/MacOS, the only workaround I've found is having @arcanis Maybe we can have a bit of reassurance that it's in someone's scope? The |
Sorry, this thread fell of the radar. Yarn will pack Unfortunately, the way the packages are built may depend from your systems, and that makes this process flaky. We're always looking for ways to improve that, but it's unclear right now what the solution should be. For example, in the case of the OP the problem was about CRLF strings. Should Yarn normalize them during packing? Should it do that on all files? Probably that should exclude binary files? What if a project expects a CRLF for X or Y reason? If we can't do it safely, should we do it at all? That said, perhaps we could at least make a better job at highlighting the issues:
|
@arcanis Since this only affects Alternatively, Yarn could hash the ZIP file in a way that excludes the permissions metadata from the computed hash, avoiding the problem with permissions, and then have better diagnostics for CRLF/LF differences (which should in priniciple be fixable by the user, unlike the permissions issue). A final option would be to ignore or store multiple hashes for packages where a deterministic hash cannot be easily computed. |
+1, but note: validation by commit hash requires
sounds like yarn is trying to re-invent nix also with nix, reproducible builds are hard so by default, nix packages are "input addressed": Trustix - Consensus and voting
Content-addressed Nix − call for testers
|
Self-service
Describe the bug
Yarn computes a different checksum for local packages (ie. packages installed via a relative path) on windows vs linux, causing
yarn install
to fail in CI.To reproduce
yarn add ../relativePath
followed byyarn install
on windows.yarn install
in CI on linux.Environment
Additional context
Related issues:
#5136
#2774
The text was updated successfully, but these errors were encountered: