Closed lexanth closed 2 years ago
Hi! š
This issue looks stale, and doesn't feature the reproducible
label - which implies that you didn't provide a working reproduction using Sherlock. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it or you edit your first post to include a formal reproduction (you can use the playground for that).
Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we're a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolutions). It helps us help you! š
If you absolutely cannot reproduce a bug on Sherlock (for example because it's a Windows-only issue), a maintainer will have to manually add the upholded
label. Thanks for helping us triaging our repository! š
I had the same issue running yarn@3.2.2 (current stable version) installed with corepack.
Installing the package "canvas": "dwickern/canvas-noop"
from yarn 1.22.19:
canvas-https-d4dab75653-31cdc4ba4d.zip
The same package installed with yarn 3.2.2 via corepack without the yarn v1 bootstrapper: canvas-https-d4dab75653-6b6d48e4ad.zip
Workaround is to corepack disable
and install yarn v1.
I have encountered the same problem while upgrading from Yarn v1 to v3.2.1 recently.
In package.json
(only relevant parts):
{
"packageManager": "yarn@3.2.1",
"dependencies": {
"timecop": "git+https://github.com/jamesarosen/Timecop.js.git#d421df9b00386266bda93eb9c2ea15fedc888761"
}
}
When installing on my machine (Mac OS) with corepack enabled:
$ rm -rf node_modules && yarn cache clean --all && yarn | grep '/private/var/folders/fk'
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-7e3c703f STDOUT Packing timecop@https://github.com/jamesarosen/Timecop.js.git#commit=d421df9b00386266bda93eb9c2ea15fedc888761 from sources
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-7e3c703f STDOUT No package manager configuration detected; defaulting to Yarn
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-7e3c703f STDOUT
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-7e3c703f STDOUT yarn pack v1.22.15
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-7e3c703f STDOUT success Wrote tarball to "/private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-7e3c703f/package.tgz".
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-7e3c703f STDOUT Done in 0.18s.
With corepack disabled:
$ rm -rf node_modules && yarn cache clean --all && yarn | grep '/private/var/folders/fk'
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT Packing timecop@https://github.com/jamesarosen/Timecop.js.git#commit=d421df9b00386266bda93eb9c2ea15fedc888761 from sources
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT No package manager configuration detected; defaulting to Yarn
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: .jshintrc
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: Contributing.md
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: Gemfile
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: Gemfile.lock
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: LICENSE
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: README.md
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: Rakefile
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: lib/BuildTemplate.js
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: lib/MockDate.js
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: lib/TimeStackItem.js
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: lib/Timecop.js
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: lib/timecop/compilation_task.rb
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: lib/timecop/jshint_task.rb
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: package.json
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: spec/javascripts/MockDateSpec.js
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: spec/javascripts/TimeStackItemSpec.js
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: spec/javascripts/TimecopSpec.js
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: spec/javascripts/helpers/SpecHelper.js
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: spec/javascripts/support/jasmine-html.js
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: spec/javascripts/support/jasmine.css
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: spec/javascripts/support/jasmine.js
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: spec/javascripts/support/jasmine.yml
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: spec/javascripts/support/jquery-1.4.4.min.js
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: spec/javascripts/support/json2.js
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: timecop.js
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: Package archive generated in /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064/package.tgz
ā¤ YN0000: ā /private/var/folders/fk/c9z1tyhj02nfdn9dz_71vjk80000gq/T/xfs-88fd0064 STDOUT ā¤ YN0000: Done in 0s 112ms
The resulting ZIP files are almost exactly identical, save for one difference: an extra newline in the package.json
. Note that, in both cases, the version of Node and Yarn CLI is exactly the same. The only difference is that when corepack is enabled/disabled, different versions of Yarn are available (I assume), which means our Git dependency is built with a slightly different version of Yarn, which means the newline is removed / added, which means the checksum changes, which means the install fails. In summary: depending on the Yarn versions available in your environment, the checksums of Git deps may be different.
I ran into this in practice in 2 instances:
node:16.15.1-alpine
, corepack disabled by default)For the time being, we'll avoid using corepack at all so all environments are the same.
Self-service
Describe the bug
When installing a package from github
"cypress-log-to-output": "Narretz/cypress-log-to-output#feat-no-output"
, I'm getting aThe remote archive doesn't match the expected checksum
error in CI (CircleCI - docker imagecimg/node:16.13.2
). I'm using the node modules linker, not PnP.I've compared the contents of the package it's creating in
/tmp
on CI with the contents of the package in my local (macOS) yarn cache. The only file with checksum differences ispackage.json
. In my local version, thepackage.json
has the trailing newline (which matches the git repo). The version on CircleCI is trimming the trailing newline as part of theyarn pack --install-if-required
step (the git clone still has the newline before and after theyarn pack
, but the version inside the tarball seems to have it trimmed).From looking at the source, I can see that yarn berry will always be trimming this trailing newline and I can reproduce it locally.
If I switch from the github protocol to the git one, I get the same result, but can see the package being regenerated:
Note specifically
yarn pack v1.22.15
I'm definitely running yarn berry, but for the
yarn pack
inside it, it's using the globally installed yarn 1. I'm guessing yarn 1 isn't trimming the trailing newline, so then we get a mismatch.In the source, in yarn 2 mode it seems to be doing a lot to try to get this environment set up right, but for some reason (nvm?) it isn't working for me locally. It does seem to the right thing in my CI environment. I used
corepack enable
to set up berry - maybe that isn't ending up being carried across when spawning the separate yarn process when using nvm?This seems like some missing piece of local environment config, but I've followed the getting started docs and can't see anything else missing.
To reproduce
Can't reproduce with sherlock - depends on the yarn 1 install
yarn init -2
enableInlineBuilds: true
so that you can see the pack outputyarn install
yarn pack
on the github dependencyEnvironment
Additional context
No response