vercel / turborepo

Build system optimized for JavaScript and TypeScript, written in Rust
https://turbo.build/repo/docs
MIT License
26.04k stars 1.79k forks source link

pnpm patches incorrectly excluded on turbo prune #9120

Open kalvenschraut opened 1 week ago

kalvenschraut commented 1 week ago

Verify canary release

Link to code that reproduces this issue

https://github.com/RTVision/turborepo-prune-patch-issue

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Linux

Which canary version will you have in your reproduction?

2.1.2-canary.0

Describe the Bug

patches are being remove from the pruned workspace when app depends on the package.

Expected Behavior

all patches for dependent libraries be included in the prune of an app.

To Reproduce

clone the repo and run pnpm turbo prune --scope=web and then open up out/pnpm-lock.yaml and see the next patch is no longer present even though it is the base pnpm-lock.yaml file and web depends on next

Additional context

pnpm recently added a feature that allows trying to apply the same patch to all versions of a package which was added in pnpm 9.7. Because of that the patch doesn't have a version in the file name or in the lockfile which I suspect is causing not to be added during the prune. This is the default way pnpm generates patch files now so any new patches done are no longer being kept around.

liam-germain commented 4 days ago

hi is this bug related to why i can't run even the 'with-docker' example with it failing on:

web:build: cache miss, executing e9bd4163eb4a2003 0.347 x internal errors encountered: unable to find package manager binary: cannot 0.347 | find binary path

Everything works great when using yarn but fails when using pnpm