turbo: [turborepo] [yarn 3] pruned lockfile missing resolution entries
What version of Turborepo are you using?
1.6.3
What package manager are you using / does the bug impact?
Yarn v2/v3 (node_modules linker only)
What operating system are you using?
Mac
Describe the Bug
To optimize our Docker builds we are attempting to use turbo prune to create a lighter weight image. After running prune we copy our pruned lockfile and .json files into a directory and then attempt to run an immutable install.
We have observed that when the root package.json includes yarn resolutions we are unable to run yarn --immutable successfully in the pruned monorepo.
For example
In this reproduction ajv is a dependency of eslint so it is a necessary dependency in the pruned monorepo.
ericjacobson@Erics-MacBook-Air pruned % yarn why ajv
├─ @eslint/eslintrc@npm:0.4.3
│ └─ ajv@npm:6.12.6 (via npm:^6.12.4)
│
├─ eslint@npm:7.32.0
│ └─ ajv@npm:6.12.6 (via npm:^6.10.0)
│
└─ table@npm:6.8.1
└─ ajv@npm:8.11.2 (via npm:^8.0.1)
When the resolution is not included in the root package.json the generated out/yarn.lock is correct, and includes an ajv entry.
When the resolution is included in the root package.json then generated out/yarn.lock is incorrect, and does not include any ajv entries.
Expected Behavior
The pruned lockfile should include dependencies that have a corresponding yarn resolution.
To Reproduce
See the README.md in the reproduction repo for more details.
Reproduction Repo
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 4
- Comments: 20 (9 by maintainers)
Commits related to this issue
- feat: Use Rust Berry lockfile impl (#4684) ### Description Built on top of #4629 Overview of changes: - ~~Change `subgraph` so we calculate workspace's closure in parallel in a similar manner... — committed to vercel/turbo by chris-olszewski a year ago
- fix: allow for workplace descriptors without a protocol (#4755) ### Description Fixes the issue found by @quinnturner in [#2891](https://github.com/vercel/turbo/issues/2791#issuecomment-152647712... — committed to vercel/turbo by chris-olszewski a year ago
- fix: berry prune including all builtin patch descriptors (#4770) ### Description Addresses the issue @erj826 found in [#2791](https://github.com/vercel/turbo/issues/2791#issuecomment-1527616578) ... — committed to vercel/turbo by chris-olszewski a year ago
- chore: vercel/turbo#2791 로 인하여 --immutable 옵션 삭제 — committed to syi0808/liblibrary by syi0808 9 months ago
Any update on this? I don’t see much activity happening on this issue but I have the exact same problem in our app and this is quite blocking.
I have the same problem with alex-dixon in version 1.10.12. After I ran
turbo prune --dockerand tried toyarn install --immutable, this error occurred:Not sure if this helps but I ran into this as well on
1.10.0:When I remove it the install succeeds.
@chris-olszewski thank you for the quick turnaround! Prune appears to be working without any issues for our monorepo using
1.9.4-canary.7!Only downgrading from
1.9.8to1.9.3worked for meHi, i’m not sure if the following is related to this same issue but seems to me that there are some similarities.
I have to patch a package in my project and i’m using
yarn patchto do that (yarn v3), when i doturbo prunethe package.json file in the/outfolder doesn’t have the resolution with the patch. e.g."package-to-patch@x.x.x": "patch:package-to-patch@x.x.x#.yarn/patches/package-to-patch@x.x.x-0608291d42.patch", it does have other resolutions but not the one that has the patch. The same happens with the .lock file, locally i see the package with the patch in the lock file but then in the/outi’m not seeing that.is this the same issue or a different one? happy to provide more information if needed or any help to troubleshoot this.
Thanks for testing this out!
@quinnturner
Are there entire entries missing or is it primarily drift between the keys?
I see the issue here, should have a fix up soon.
@erj826 If that’s the only difference, then that points to our inference of the compatibility patches being incorrect. Will be taking a look at this today.
This was first mentioned in my ticket in #2049. I will close my version as this ticket is more scoped. CC: @chris-olszewski, since you’re assigned to that ticket, perhaps you intend to assign yourself to this ticket?