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

[rush] Add a reset function to the pnpmfile to allow for clearing state #4696

Merged
merged 3 commits into from May 13, 2024

Conversation

william2958
Copy link
Contributor

Summary

This MR fixes an issue where the PnpmfileShim carries cached state between subsequent subspace installs.

Currently if the project graph looks like this:
projectA depends on projectB
projectA -> subspaceA
projectB -> subspaceB
and you run rush install -t projectA, rush will incorrectly run subspaceB's pnpmfile when installing for subspaceA.

This fixes the issue by clearing the state in the pnpmfile.

Details

How it was tested

Impacted documentation

@iclanton iclanton changed the title Add a reset function to the pnpmfile to allow for clearing state [rush] Add a reset function to the pnpmfile to allow for clearing state May 10, 2024
@iclanton iclanton enabled auto-merge May 13, 2024 21:19
@iclanton iclanton merged commit 31a64ee into microsoft:main May 13, 2024
5 checks passed
@@ -40,7 +49,7 @@ function init(context: IPnpmfileContext | any): IPnpmfileContext {
if (!context.pnpmfileShimSettings) {
context.pnpmfileShimSettings = __non_webpack_require__('./pnpmfileSettings.json');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were the installs running in the same process? If not I don't see how there could be contamination of in-memory state, and if so, then we need to purge the require.cache entry corresponding to ./pnpmfileSettings.json to ensure that we get the latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

None yet

3 participants