-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Fix installing our xgettext-js fork using Yarn v4 #3258
Conversation
Now the error is showing up in CI test instead:
|
dada56f
to
1a26b23
Compare
For some reason, installing node modules using Node.js 20.13.0 that brings Yarn 4.0.1 would fail with the following error message: xgettext-js@https://github.com/metabrainz/xgettext-js.git#commit=0301681a479c1796ff6850c9bd2a169074386d92: The remote archive doesn't match the expected checksum It is unclear which version(s) and on which platform(s) would fail here. (It fails in macOS and Docker Composed Ubuntu Jammy, but it works in ArchLinux and CircleCI Dockerized Ubuntu Jammy.) When failing, the following key was added to xgettext-js’ package.json: "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" It seems that it was the only difference in the installed files, thus affecting the checksum of the fetched package xgettext-js. To fix this issue I have upgraded our xgettext-js fork to Yarn v4 too, in order to avoid this and have the same checksum on all platforms. To update the checksum in `yarn.lock` file, I have temporarily set `checksumBehavior` key to `update` in `.yarnrc.yml` file and run `yarn`. References: * https://yarnpkg.com/configuration/manifest#packageManager * https://yarnpkg.com/configuration/yarnrc#checksumBehavior
References: * https://github.com/yarnpkg/berry/releases?q=@yarnpkg/cli/4&expanded=true for all the intermediate versions since v4.0.1 * https://github.com/yarnpkg/berry/releases/tag/@yarnpkg/cli/4.2.2 for this version in particular
Finally found a solution that works in both Docker Compose and CircleCI at least. Note that building Docker images without this patch is currently failing too; See build 1055 for example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it's working for me on macOS now. :)
When failing, the following key was added to xgettext-js’ package.json:
In my case I noticed that the package downloaded to ~/.yarn/berry/cache was not of the fork (i.e., it had none of the hermes-parser changes), which is odd.
Phew!
That’s very odd and a second unexplained mystery. After you mentioned it, I did check the content of the installed packages if updating the checksum instead of erroring in both my setup and SSHed CircleCI job, and both had the right fork using hermes-parser. I guess that it takes a pair of deep mysteries to make a breathtaking yarn. Happily, we can now breath again. |
Problem
For some reason, installing node modules using Node.js 20.13.0 that brings Yarn 4.0.1 would fail with the following error message:
It is unclear which version(s) and on which platform(s) would fail here. (It fails in macOS and Docker Composed Ubuntu Jammy, but it works in ArchLinux and CircleCI Dockerized Ubuntu Jammy.) When failing, the following key was added to xgettext-js’ package.json:
It seems that it was the only difference in the installed files, thus affecting the checksum of the fetched package xgettext-js.
Solution
To fix this issue I have upgraded our xgettext-js fork to Yarn v4 too, in order to avoid this and have the same checksum on all platforms.
To update the checksum in
yarn.lock
file, I have temporarily setchecksumBehavior
key toupdate
in.yarnrc.yml
file and runyarn
.References:
Additional change
Upgrade Yarn version to the latest 4.2.2
References:
https://github.com/yarnpkg/berry/releases?q=@yarnpkg/cli/4&expanded=true
for all the intermediate versions since v4.0.1
https://github.com/yarnpkg/berry/releases/tag/@yarnpkg/cli/4.2.2
for this version in particular
Testing
xgettext-js’ fix
yarn’s update