Skip to content
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 #5136

Open
1 task
angel-git opened this issue Dec 14, 2022 · 3 comments
Open
1 task

[Bug?]: checksum is different from windows and unix #5136

angel-git opened this issue Dec 14, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@angel-git
Copy link

Self-service

  • I'd be willing to implement a fix

Describe the bug

yarn install fails on windows machine for the same dependency.

Doing yarn install on mac you get the following file inside the cache test-github-dependency-git+ssh-298a2e1cf5-17a50be342.zip

On windows it fails with:

yarn install
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ test-github-dependency@git+ssh://git@github.com:angel-git/test-gith
➤ YN0018: │ test-github-dependency@git+ssh://git@github.com:angel-git/test-githu
b-dependency.git#commit=a9558b728dfcee08264f221211d859e3417a4971: The remote arc
hive doesn't match the expected checksum
➤ YN0000: └ Completed in 7s 544ms
➤ YN0000: Failed with errors in 7s 559ms

If i change the .yarnrc.yml with checksumBehavior: update then windows generates: test-github-dependency-git+ssh-298a2e1cf5-a5121ebaf2.zip. You can see that the checksum is different (17a50be342 vs a5121ebaf2 )

Doing an hexdump for both of files and comparing ( hexdump -C test-github-dependency-git+ssh-298a2e1cf5-17a50be342.zip):
image

The difference is some small character, after more investigating the issue is coming from the bash script gradlew that lives inside the dependency. If i remove that gradlew file, the issue is not longer reproducible

To reproduce

git clone https://github.com/angel-git/yarn-issue
cd yarn-issue
yarn install

do the same on windows machine

Environment

MAC:

System:
    OS: macOS 13.0.1
    CPU: (10) arm64 Apple M1 Max
  Binaries:
    Node: 16.18.0 - /private/var/folders/l0/vlwfh6h92q7fx1g68qxp53140000gp/T/xfs-7f3cfcc9/node
    Yarn: 3.3.0 - /private/var/folders/l0/vlwfh6h92q7fx1g68qxp53140000gp/T/xfs-7f3cfcc9/yarn
    npm: 8.19.2 - /opt/homebrew/bin/npm

WINDOWS:

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor
  Binaries:
    Node: 16.12.0 - ~\AppData\Local\Temp\xfs-3a0cc209\node.CMD
    Yarn: 3.3.0 - ~\AppData\Local\Temp\xfs-3a0cc209\yarn.CMD
    npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD

Additional context

No response

@angel-git angel-git added the bug Something isn't working label Dec 14, 2022
@angel-git
Copy link
Author

Looks like the windows cache zipped doesn't not contain the executable permission and probably making the checksum to fail:

find test-github-dependency-git+ssh-298a2e1cf5-*/test-github-dependency/gradlew -print -ls
test-github-dependency-git+ssh-298a2e1cf5-17a50be342/test-github-dependency/gradlew
41125865       16 -rwxr-xr-x    1 agavalda         staff                5296 Jun 22  1984 test-github-dependency-git+ssh-298a2e1cf5-17a50be342/test-github-dependency/gradlew
test-github-dependency-git+ssh-298a2e1cf5-a5121ebaf2/test-github-dependency/gradlew
41125884       16 -rw-r--r--    1 agavalda         staff                5296 Jun 22  1984 test-github-dependency-git+ssh-298a2e1cf5-a5121ebaf2/test-github-dependency/gradlew

Is there any way to tell yarn not to check file permissions when calculating the checksum?

@0xCourtney
Copy link

for anyone having this issue, I believe this is related #2774 (comment)

@arnoudius
Copy link

arnoudius commented Mar 15, 2023

Same issue here. We're also getting different checksum hashes for dependencies managed via a git repository (i.e. via git+https: / ssh://...), depending on the operating system yarn install is run on.

yarn 3.4.1

chadlwilson added a commit to gocd/gocd that referenced this issue Aug 3, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants