Repository navigation
[rush] Fix "rush install" with pnpm 12 and injected workspace dependencies - #6136
Open
Bharat Middha (bmiddha) wants to merge 1 commit into
Open
Bharat Middha (bmiddha) wants to merge 1 commit into
Bharat Middha (bmiddha) wants to merge 1 commit into
Conversation
Bharat Middha (bmiddha)
force-pushed
the
bmiddha-bump-rushstack-to-pnpm-12
branch
from
October 14, 2026 20:51
fba9b6f to
8f34474
Compare
Bharat Middha (bmiddha)
force-pushed
the
bmiddha-bump-rushstack-to-pnpm-12
branch
from
October 15, 2026 01:39
8f34474 to
2de40d6
Compare
Bharat Middha (bmiddha)
force-pushed
the
bmiddha-bump-rushstack-to-pnpm-12
branch
from
October 20, 2026 21:13
2de40d6 to
34059d1
Compare
Bharat Middha (bmiddha)
force-pushed
the
bmiddha-bump-rushstack-to-pnpm-12
branch
from
October 28, 2026 04:35
34059d1 to
f19bdba
Compare
…ncies With pnpm 12 or newer, "rush install" for a subspace that has injected workspace dependencies now passes "--no-frozen-lockfile --prefer-frozen-lockfile" instead of "--frozen-lockfile". Native pnpm's frozen-lockfile freshness check reads the injected workspace manifests without applying pnpmfile hooks, and it rejects "workspace:" targets that live outside the pnpm workspace root. Every Rush project is outside common/temp/<subspace>, so that check always fails with ERR_PNPM_OUTDATED_LOCKFILE. Rush has already verified that the committed shrinkwrap satisfies every package.json, so pnpm can safely reuse the lockfile as-is. Subspaces without injected dependencies, and pnpm versions below 12, keep using "--frozen-lockfile". Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Bharat Middha (bmiddha)
force-pushed
the
bmiddha-bump-rushstack-to-pnpm-12
branch
from
October 30, 2026 21:04
f19bdba to
fd22b2b
Compare
Bharat Middha (bmiddha)
marked this pull request as ready for review
October 30, 2026 21:49
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
With native pnpm 12,
rush installfails withERR_PNPM_OUTDATED_LOCKFILE ... local dependency "..." is outdatedfor any subspace that has injected workspace dependencies. Rush now passes--no-frozen-lockfile --prefer-frozen-lockfileinstead of--frozen-lockfilein that one case. A@microsoft/rushchange file is included.This PR targets
mainand changes rush-lib only. It is the bottom of a stack: #6136 (this PR) → #6138 → #6139 → #6140 → #6141 → #6146 → #6148. Rush 5.182.0 already includes the earlier native pnpm fixes from #6131 and #6133. The repo's own move to pnpm 12.13.0 (pnpmVersion,globalAllowBuilds, regenerated lockfiles andrepo-state.json) is in #6146.Why the split: before, every PR in this stack carried the repo's pnpm 12 bump. None of them could pass CI until Rush was released with these fixes, and that release needed the PRs to merge first. With the bump moved out, this PR runs CI on the repo's current toolchain (Rush 5.182.0 and pnpm 10.27.0) and can merge on its own, so a Rush release can include it. #6146 then needs a Rush release containing this PR, #6138 through #6141, and #6119, followed by a
rushVersionbump.Details
Native pnpm 12 checks the freshness of injected workspace dependencies during a frozen install (
lockfile_freshness/directory_deps). In a Rush repo that check always fails, for two reasons:package.jsonwithout pnpmfilereadPackagehooks, so it sees the unrewrittenworkspace:specifiers.workspace:targets to be inside the pnpm workspace root, which iscommon/temp/<subspace>. Every Rush project lives outside that folder.Rush already verifies that the committed shrinkwrap satisfies every
package.jsonbefore it invokes pnpm. So inBaseInstallManager.pushConfigurationArgs, when all of the following hold:usePnpmFrozenLockfileForRushInstallis enabled,rush install(shrinkwrap updates are not allowed),subspace.getPackageJsonInjectedDependenciesHash()is defined,Rush passes
--no-frozen-lockfile --prefer-frozen-lockfile. It also prints an informational line, not a warning:In every other case, including subspaces without injected dependencies and pnpm < 12, Rush still passes
--frozen-lockfile. pnpm 10 and 11 behavior is unchanged.Tradeoff: for affected subspaces, pnpm may fetch metadata and re-resolve during
rush installinstead of failing outright. In testing, the installed package set was identical to the committed lockfile.rush installnever copies the temp lockfile back tocommon/config.Alternatives considered:
I did not find an upstream pnpm issue for the containment check.
How it was tested
The final commit is
fd22b2bd5c, onmain4481cbe5b1.git range-diffagainst the previous headf19bdbab2fshows=, so the patch is unchanged by the rebase.CI on
fd22b2bd5c, run 41128187233, uses the repo's pinned Rush 5.182.0 and pnpm 10.27.0. All 5 Node.js jobs pass: v22 ubuntu, v24 ubuntu, v24 windows, v26 ubuntu, and v26 windows. CodeQL, Analyze, and license/cla also pass. In every job:rush change --verify) and "Rush Install" passed.rush retest --productionreported 299 operations succeeded, 17 no-op, 0 failed, and no warnings.@microsoft/rush-lib (test)passed: 1927 passed and 0 failed on Ubuntu, 1899 passed and 0 failed on Windows.BaseInstallManager.testpassed 18/18.rush update/rush test/ cache-hitrush teststeps passed.Local testing ran on macOS arm64 with Node 22.23.4, on
f19bdbab2f. That commit has the same patch, onmainaaf2f7675f. Rush commands ran throughinstall-run-rushwith the toolchain pinned at that time, Rush 5.181.0 and pnpm 10.27.0. Theheftcommands used the repo's installed Heft:node common/scripts/install-run-rush.js install: passed, no lockfile orrepo-state.jsondiff.node common/scripts/install-run-rush.js build --production --to @microsoft/rush-lib: passed. 36 operations succeeded and 4 were no-op, with 0 warnings.heft buildinlibraries/rush-lib: passed, 0 warnings.heft test --production --test-path-pattern BaseInstallManagerinlibraries/rush-lib: passed (18/18). New cases:--frozen-lockfileis kept for PNPM 10.27.0 with injected dependencies, and for PNPM 12.10.1 without them.--no-frozen-lockfile --prefer-frozen-lockfileand the informational line, with no warning, are used for PNPM 12 with injected dependencies.node common/scripts/install-run-rush.js change --verify: passed.End-to-end, before the restack, this same change was exercised on the full rushstack repo moved to pnpm 12.13.0. That repo change now lives in #6146. Results with Rush built from this branch:
CI=true rush install: passed.build-tests-subspacetook the--prefer-frozen-lockfilepath.defaultstayed on--frozen-lockfile, with "Lockfile is up to date, resolution step is skipped".repo-state.jsondiff afterward.rush build --production(whole repo): passed, no warnings.heft test --productioninlibraries/rush-lib: passed (1919 passed, 0 failed, 2 skipped).pnpm install --frozen-lockfile ...with pnpm 12.13.0 directly incommon/temp/build-tests-subspacefailed withlocal dependency "@rushstack/terminal" at "../../../libraries/terminal" is outdated. This confirms the change is still needed on the latest pnpm 12.CI=true installwith pnpm 12.13.0 failed withERR_PNPM_OUTDATED_LOCKFILEon the injected@microsoft/rush-lib. Rush 5.182.0 does not include this change either.Impacted documentation
None.