-
Notifications
You must be signed in to change notification settings - Fork 607
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
[rush] rush add
in not-yet-rush-install
-ed repo when using yarn causes integrity check failure
#2929
Comments
related: #2928 |
I managed to find an order of commands that miraculously makes it work without deleting caches, the lockfile, etc: In a fresh mvr repo ( # run the failed add
pushd projects/proj1 && rush add -p lodash.pick && popd
# I need to do this command twice (bizarrely, it fails the first time but succeeds the next!)
for i in $(seq 2)
do
pushd common/temp
# I used the same paths as rush does, but I make them non-absolute and use global `yarn` here for brevity
yarn install --link-folder yarn-link --cache-folder common/temp/yarn-cache --non-interactive --update-checksums
popd
done
# now the previously `rush add` will work
cd projects/proj1 && rush add -p lodash.pick The error the first time yarn --update-checksums is ran is:
|
I can't find it anywhere and it failed when I tried, so I might as well ask, is yarn v2 supported by rush? Maybe there's a fix for needing to run --update-checksums twice in yarn-v2 |
it looks like |
I used tar + pushd projects/proj1 && rush add -p lodash.pick && popd
# the following are added:
# common/temp/yarn-preinstall.lock
# common/temp/yarn.lock
# common/temp/projects/proj1/**
# common/temp/yarn-local
# common/temp/.npmrc
# common/temp/yarn-cache/**
# common/temp/package.json
# I'll add later what yarn commands were run which should explain a lot of this
pushd common/temp
yarn install --link-folder yarn-link --cache-folder common/temp/yarn-cache --non-interactive --update-checksums
popd
# first time this runs, the following are added:
# common/temp/yarn-error.log (because of the error)
# common/temp/yarn-cache/v6/npm-@rush-temp-proj1-0.0.0-d12365c6ba1a4ab080edcc54c46602e10fff4f75/node_modules/@rush-temp/proj1/** (the temp project is cached)
# the above directory includes the file that causes an error, maybe a race occurs and the file is created during/after the erroring code which needs it?
pushd common/temp
yarn install --link-folder yarn-link --cache-folder common/temp/yarn-cache --non-interactive --update-checksums
popd
# second time this is ran, it doesn't cause any errors and adds the following:
# common/temp/node_modules/@rush-temp/
# common/temp/node_modules/lazy-from/** (this is the initial dep of proj1)
# common/temp/node_modules/.yarn-integrity
pushd projects/proj1 && rush add -p lodash.pick && popd
# this time lodash.pick is added correctly, to common/temp/node_modules and the yarn-cache |
due to having a(n albeit ugly) workaround, lack of upgraded yarn support in rush (I tried forcing v2 and v3 but there are multiple issues) I'm not going to look into this further, I'd rather look at electron-tools supporting pnpm |
Our support for Yarn in general isn't as good as PNPM. @octogonz, do you know if we've looked into supporting Yarn V2? |
By "Yarn V2" i assume you mean Yarn Plug'n'Play. (V2 is also able to do the Yarn Classic installation model.) I did investigate supporting that. The work would be similar to what we did for PNPM workspaces. The main problem is that we need someone to volunteer to do the work. Plug'n'Play is hard to justify investing in since it has more compatibility issues than PNPM, and not really any significant practical advantages besides a theoretically simpler design. (Feedback welcome on this point.) |
@octogonz Support for Yarn (2/3) — like you said, really Plug'n'Play (PnP) — is about the only thing stopping me from using rushstack! Regarding its practical advantages, combining the offline cache with PnP enables a zero install philosophy, this has significant benefits for the software supply chain & security, and I wouldn't dismiss them quickly. It's also something which rushstack could always use & benefit from itself 😉. I'd also be more than happy to contribute & help with adding support for this. If someone else was to do it but needed a hand, I'm relatively familiar with the yarn codebase now, too (though that said, I'm not familiar with rushstack at this point 😅). |
I have the same problem, but only when installing @rushstack/eslint-config. |
Summary
I wanted to add a package to one of my subproject's dependencies, but had not yet ran
rush install
. I would expect the dependency to be added to the package.json andrush update
to be successfully called, installing the package.This does not happen if you run
rush install
first, but I've seen it occur when I hadrush install
-ed, I just haven't reproduced those yet.maybe related: #1706 (comment)
Repro steps
cd projects/proj1 && rush add -p lodash.pick
, (this is specific to the provided repo, you cancd
into whichever project you have on your own repo, and add whatever package you like.Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/rush
globally installed version?rushVersion
from rush.json?useWorkspaces
from rush.json?node -v
)?The text was updated successfully, but these errors were encountered: