rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[rush] Feature Request: Support PNPM 9

Open kenrick95 opened this issue 1 year ago • 2 comments

Summary

Rush should support PNPM 9, which has a breaking change on the lockfile format.

Based on the conversation in Zulipchat:

@jeremymeng Last time I checked PNPM v9 on our repo (azure/azure-sdk-for-js) there are changes that broke PnpmShrinkwrapFile. It seems that some properties got moved around in he parsed yaml data.

When directly bumped in my company's repo, I observed that rush update successfully upgraded the lockfile in the temp folder (common/temp/pnpm-lock.yaml), but it wasn't synced back to common/config/rush/pnpm-lock.yaml. Not really sure why..

I tried bumping the PNPM version in in the Rushstack repo and tried to build, but seems like pnpm-sync also needs to be modified to support PNPM 9.

Repro steps

Expected result:

Actual result:

Details

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/rush globally installed version? 5.129.7
rushVersion from rush.json? 5.117.8
useWorkspaces from rush.json? Yes
Operating system? Mac
Would you consider contributing a PR? Yes
Node.js version (node -v)? 18.20.3

kenrick95 avatar Jul 19 '24 03:07 kenrick95

@g-chao - Would you take a look at this?

iclanton avatar Jul 22 '24 18:07 iclanton

Is this something where external PRs would be accepted?

dbartholomae avatar Aug 30 '24 07:08 dbartholomae

Hello, what is the current status ?

VasekProchazka avatar Oct 22 '24 14:10 VasekProchazka

I just tried on our monorepo and everything seems to be working fine with pnpm v9.12.3, rush v5.140.1. Should I expect some issues with pnpm v9?

matthieu-foucault avatar Nov 06 '24 14:11 matthieu-foucault

@dbartholomae - we're happy to accept external PRs.

iclanton avatar Nov 11 '24 18:11 iclanton

I just tried updating pnpm to version 9, and it worked without additional changes (except for pnpm internal things, like the fact that pre and post hooks now are enabled by default). So there doesn't seem to be need for a PR anymore, and maybe this issue can be closed - unless anyone else still runs into trouble?

dbartholomae avatar Nov 15 '24 13:11 dbartholomae

@dbartholomae curious if you have tried pnpm catalog feature that was introduced in v9 and if it works. https://pnpm.io/catalogs

prabirshrestha avatar Nov 19 '24 00:11 prabirshrestha

We don't use them, so I can't really tell

dbartholomae avatar Nov 19 '24 16:11 dbartholomae

@dbartholomae After upgrading to v9 and executing the rush install/update command, you will find that the content of the .rush/temp/shrinkwrap-deps.json file is incorrect. As you can see, rush is currently unable to correctly parse lockfile v9. Thus, Rush cache system doesn't work fine with pnpmv9 because rush will generate a cacheId based on the hash of shrinkwrap-deps.json. I have submitted a PR to fix this issue. https://github.com/microsoft/rushstack/pull/5009.

fzxen avatar Nov 21 '24 03:11 fzxen

Looks like #5009 has been merged and released as @microsoft/[email protected]. Thanks a lot @fzxen!

kenrick95 avatar Dec 11 '24 01:12 kenrick95