Skip to content

[rush] Add PNPM v10 support: SHA256 hashing for dependencies paths lookup and new 'virtual-store-dir-max-length'#5236

Merged
iclanton merged 2 commits intomicrosoft:mainfrom
noiseonwires:pnpm-v10-support
Jun 2, 2025
Merged

[rush] Add PNPM v10 support: SHA256 hashing for dependencies paths lookup and new 'virtual-store-dir-max-length'#5236
iclanton merged 2 commits intomicrosoft:mainfrom
noiseonwires:pnpm-v10-support

Conversation

@noiseonwires
Copy link
Contributor

This PR solves compatibility issues between Rush and PNPM v10. In PNPM v10, the hashing algorithm for dependency paths was changed to SHA256, and the default virtual-store-dir-max-length was reduced from 120 to 60 characters. These upstream changes caused Rush-based projects using PNPM v10 to fail during the linking stage, with errors such as:

ERROR: Internal Error: Cannot find installed dependency "..." in ...
You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.

This update enables Rush to correctly support PNPM v10 by updating its dependency on @pnpm/dependency-path and by adjusting logic to account for the new default max-length value.

Fixes #5235

How was the problem solved?

Updated the rush-lib dependencies to include the latest @pnpm/dependency-path package that uses SHA256 hashing, which is required for PNPM v10.
Modified PnpmLinkManager to detect PNPM v10 and use the updated hashing and the new default virtual-store-dir-max-length (60), while retaining existing logic for PNPM v9 (using 120).
The code dynamically imports the correct version of @pnpm/dependency-path based on the detected PNPM major version.

Scope of the solution:

This change fully solves the issue for both PNPM v9 and v10

Backwards compatibility:

This change is backwards compatible. The logic for PNPM v9 is unchanged, and new logic is only applied for PNPM v10 and above.

Performance impact:

No performance regressions are expected; the code path remains similar, only adapting to new PNPM requirements.

Testing

Manual testing was performed on the final commit. I ran the following commands on our production monorepo with both PNPM v10 and PNPM v9 to verify correct behavior and ensure no regressions:

  • rush update
  • rush install
  • rush build

All works good, and no new issues were observed.

@noiseonwires
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

@iclanton iclanton moved this from Needs triage to In Progress in Bug Triage May 28, 2025
@noiseonwires noiseonwires requested a review from iclanton May 28, 2025 21:00
@iclanton iclanton merged commit 0633df1 into microsoft:main Jun 2, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Closed in Bug Triage Jun 2, 2025
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.

[rush] PNPM 10.x support

2 participants