Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch not correctly applied in monorepo #7565

Open
RuudBurger opened this issue Jan 24, 2024 · 0 comments · May be fixed by #7573
Open

Patch not correctly applied in monorepo #7565

RuudBurger opened this issue Jan 24, 2024 · 0 comments · May be fixed by #7573
Assignees

Comments

@RuudBurger
Copy link

RuudBurger commented Jan 24, 2024

Verify latest release

I verified that the issue exists in the latest pnpm release

pnpm version

8.14.1

Which area(s) of pnpm are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

https://github.com/RuudBurger/pnpm-patch-problem

Reproduction steps

  1. Git clone the repo
  2. Run pnpm install
  3. packages/package1 has the patch applied, packages/package2 doesn't
  4. Run pnpm dlx del-cli "**/node_modules"; pnpm i
  5. Both package1 and package2 have the patch applied
  6. Run pnpm dlx del-cli "**/node_modules"; pnpm store prune; pnpm i
  7. Same as step 3.

Extra:

  1. Delete only the package2 node_modules with rm -Rf packages/package2/node_modules; pnpm i
  2. package1 has the patch applied twice
  3. Do this multiple times and you end up with
    Screenshot 2024-01-24 at 20 56 49
  4. The package2 has the patched applied also, minus 1. So it uses the already patched package as a basis, and re-applies the patch after it copies it.

Describe the Bug

See above. The setting node-linker=hoisted is key here. Our repo used react-native and it doesn't work well without the hoisted method.

Expected Behavior

Patching file should be consistent, but after store prune it patches the filed differently.

This means that a CI with no cache, behaves differently then a local dev environment that never did a pnpm store prune.

Which Node.js version are you using?

18.18.2

Which operating systems have you used?

macOS

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

@await-ovo await-ovo self-assigned this Jan 26, 2024
@await-ovo await-ovo linked a pull request Jan 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants