Repository navigation
[rush] Allow subspaces to opt out of the PNPM global virtual store - #6154
Draft
Jérémy Dieuze (QuanticPotatoes) wants to merge 5 commits into
Draft
Jérémy Dieuze (QuanticPotatoes) wants to merge 5 commits into
Jérémy Dieuze (QuanticPotatoes) wants to merge 5 commits into
Conversation
When RUSH_PNPM_ENABLE_GLOBAL_VIRTUAL_STORE=1, workspace installs set enableGlobalVirtualStore in the generated pnpm-workspace.yaml so package instances live in the shared PNPM store instead of each worktree's node_modules/.pnpm. Follow-up to microsoft#5830, rebased onto current main. Co-authored-by: chenzhelong.sirius <EscapeB@users.noreply.github.com>
microsoft#5994 exported this regexp for TrimRushEnvironmentVariablesPlugin. The GVS follow-up accidentally dropped it and inlined /^RUSH_/i.
Jérémy Dieuze (QuanticPotatoes)
force-pushed
the
d-11160-gvs-subspace-optout
branch
3 times, most recently
from
October 19, 2026 18:32
1d76bce to
dc260df
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Adds an optional per-subspace opt-out from the PNPM global virtual store introduced in #6005:
When
RUSH_PNPM_ENABLE_GLOBAL_VIRTUAL_STOREis enabled, every subspace uses the global virtual store unless itspnpm-config.jsonsets"globalVirtualStore": false.Motivation
Some tooling cannot follow dependencies that live outside the subspace's temp folder. Our case: React Native's Metro bundler restricts
watchFoldersto the subspace'scommon/temp/<subspace>/node_modules. With the global virtual store, packages resolve to<store>/v11/links/..., outside every watched folder, andexpo startfails withFailed to get the SHA-1. We want the global virtual store for the rest of the repo and plain installs for that one subspace.Details
pnpm-config.schema.json/PnpmOptionsConfiguration: new optionalglobalVirtualStoreboolean.isPnpmGlobalVirtualStoreEnabled(subspace)(newlogic/pnpm/PnpmGlobalVirtualStore.ts) is the single check, used byWorkspaceInstallManager(writingenableGlobalVirtualStoreinpnpm-workspace.yaml) andgetCommonTempFlag(so toggling it invalidates the last-install flag).PnpmWorkspaceFilereloads an existingpnpm-workspace.yaml, soenableGlobalVirtualStore: truefrom a previous install was kept after opting out (or after unsetting the environment variable). The install now clears it when the global virtual store does not apply.How it was tested
WorkspaceInstallManagertest: a subspace with"globalVirtualStore": falsegets noenableGlobalVirtualStoreinpnpm-workspace.yamland nopnpmGlobalVirtualStorein the last-install flag; the existing test asserts both are set without the opt-out.rush-libtests forWorkspaceInstallManager,LastInstallFlag,BaseInstallManager,PnpmOptionsConfigurationandPnpmWorkspaceFilepass.