[rush-lib] Fix shrinkwrap-deps.json missing file #5021
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a regression where Rush sometimes incorrectly reports "fatal: could not open 'packages/xxx/.rush/temp/shrinkwrap-deps.json' for reading: No such file or directory" when using subspaces.
Details
What happened?
We have a repository with 3 subspaces: S1, S2 and S3. At the same time, P1 depends on P2 and P3.
We committed changes to the project P1.
When running
rush install --from git:origin/master
, Rush will install the dependencies for S1 and S2, but NOT S3, which is correct!BUT, when running
rush build --from git:origin/master
, Rush fails with the message:shrinkwrap-deps.json
wasn't added to P5, because the subspace S3 wasn't installed.What I expected to happen?
No error message should be printed by Rush and build script should be successfully finished.
The solution
Revert to the previous Rush workspace snapshot logic (version 5.139.0), by skipping the
shrinkwrap-deps.json
hashing for all unrelated projects.Current state
Previous working state
How it was tested
rush install --from git:origin/master
(default and S1 will be installed)rush build --from git:origin/master
The message "fatal: could not open 'packages/<project_of_S2>/.rush/temp/shrinkwrap-deps.json' for reading: No such file or directory" will appear and the build script will fail.