Skip to content

fix: Preserve pnpm node@runtime: lockfile entries - #13408

Merged
anthonyshew merged 1 commit into
mainfrom
task/task_d5qb1o8ldd1mwwsxdkqvlyev
Jul 20, 2026
Merged

anthonyshew merged 1 commit into
mainfrom
task/task_d5qb1o8ldd1mwwsxdkqvlyev

Conversation

@anthonyshew

@anthonyshew anthonyshew commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #13403.

When a project uses pnpm's devEngines.runtime with onFail: "download" (pnpm 10.14+), pnpm records the Node.js runtime in the lockfile as a synthetic dependency: an importer reference plus a node@runtime:<version> entry in packages: and snapshots:. turbo prune kept the importer reference but dropped the corresponding packages:/snapshots: entries, producing an internally inconsistent pruned lockfile. pnpm install --frozen-lockfile in the pruned output then failed with:

Broken lockfile: no entry for 'node@runtime:22.0.0' in pnpm-lock.yaml (ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY)

The root cause was twofold, matching the issue's analysis:

  1. Closure walk dropped the entries. The runtime: dependency is synthesized by pnpm and is not part of turbo's package graph, so it never appears in the resolved closure passed to subgraph. The importer reference was preserved, but the package/snapshot entries were not retained. subgraph now walks importer dependencies using the runtime: protocol (including the root importer, whose regular deps are otherwise sourced from the closure) and retains their packages:/snapshots: entries.

  2. variants were stripped on re-serialization. PackageResolution only modeled tarball/directory/git fields with no catch-all, so the variants array of a type: variations resolution — which nests full per-platform binary resolutions — would be lost even if the entry were kept. Added a flattened other opaque passthrough (mirroring the existing pattern on PackageSnapshot), and updated the fast parser's parse_resolution to capture unknown fields into it instead of skipping them, keeping the fast and serde paths consistent.

Testing

  • Added test_runtime_resolution_variants_round_trip — verifies the type: variations resolution and its nested variants list survive a parse → serialize → parse round-trip.
  • Added test_subgraph_preserves_runtime_package_and_snapshot — verifies turbo prune keeps node@runtime:22.0.0 in both packages: and snapshots: alongside the importer reference.
  • Verified against the actual repro lockfile from zkochan/repro-turbo-prune-runtime: after pruning, node@runtime appears in both packages: and snapshots:, and all 12 platform variants (including the libc: musl target) are preserved.
  • Full turborepo-lockfiles suite passes (263 tests); cargo clippy and cargo fmt clean.

Co-Authored-By: Anthony Shew <anthonyshew@gmail.com>
@anthonyshew
anthonyshew requested a review from a team as a code owner July 19, 2026 18:46
@anthonyshew
anthonyshew requested review from tknickman and removed request for a team July 19, 2026 18:46
@vercel

vercel Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
examples-basic-web Ready Ready Preview, Comment, Open in v0 Jul 19, 2026 6:47pm
examples-designsystem-docs Ready Ready Preview, Comment, Open in v0 Jul 19, 2026 6:47pm
examples-gatsby-web Ready Ready Preview, Comment, Open in v0 Jul 19, 2026 6:47pm
examples-kitchensink-blog Ready Ready Preview, Comment, Open in v0 Jul 19, 2026 6:47pm
examples-nonmonorepo Ready Ready Preview, Comment, Open in v0 Jul 19, 2026 6:47pm
examples-svelte-web Ready Ready Preview, Comment, Open in v0 Jul 19, 2026 6:47pm
examples-tailwind-web Ready Ready Preview, Comment, Open in v0 Jul 19, 2026 6:47pm
examples-vite-web Ready Ready Preview, Comment, Open in v0 Jul 19, 2026 6:47pm
turbo-site Ready Ready Preview, Comment, Open in v0 Jul 19, 2026 6:47pm
turborepo-eve-agent Ready Ready Preview, Comment, Open in v0 Jul 19, 2026 6:47pm

@anthonyshew anthonyshew changed the title fix(prune): preserve pnpm node@runtime: lockfile entries fix: Preserve pnpm node@runtime: lockfile entries Jul 20, 2026
@anthonyshew
anthonyshew merged commit 4ac2f47 into main Jul 20, 2026
70 of 73 checks passed
@anthonyshew
anthonyshew deleted the task/task_d5qb1o8ldd1mwwsxdkqvlyev branch July 20, 2026 16:17
anthonyshew pushed a commit that referenced this pull request Jul 21, 2026
## Release v2.10.6-canary.5

> [!CAUTION]
> Versioned docs aliasing FAILED. [View
logs](https://github.com/vercel/turborepo/actions/runs/29859795408)

### Changes

- docs: Update Geistdocs to 1.13.0 (#13412) (`b1d8c9f`)
- release(turborepo): 2.10.6-canary.4 (#13401) (`90eba05`)
- fix: Preserve pnpm `node@runtime:` lockfile entries (#13408)
(`4ac2f47`)
- chore: Fix typos in with-solid example and globwatch comment (#13416)
(`424cabd`)
- refactor: Remove unused public APIs found by Hawk (#13420) (`831990d`)
- fix: Check dynamic imports in boundaries (#13418) (`31be2b8`)
- refactor: Use regex! for static pattern compilation (#13419)
(`82cd34c`)
- fix: Refactor `turbo watch` (#13423) (`328b99f`)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
anthonyshew pushed a commit that referenced this pull request Jul 22, 2026
## Release v2.10.6

> [!CAUTION]
> Versioned docs aliasing FAILED. [View
logs](https://github.com/vercel/turborepo/actions/runs/29930611207)

### Changes

- release(turborepo): 2.10.5 (#13368) (`a6a563a`)
- fix: Disable unresolved Cargo artifact caching (#13362) (`d76aa27`)
- fix: Surface create-turbo Git failures (#13371) (`8a8b133`)
- fix: Resolve exact cargo profile outputs (#13366) (`0e6a99b`)
- fix: Prune Bun production workspace dev dependencies (#13369)
(`fee6b66`)
- fix: Resolve Cargo target output layouts (#13370) (`8c097cd`)
- release(turborepo): 2.10.6-canary.1 (#13374) (`d0dca26`)
- fix: Preserve Yarn Babel extension during pruning (#13373) (`02ef828`)
- feat: Support Cargo-only repos (#13378) (`24dc68e`)
- fix: Preserve colors in TUI output (#13381) (`99c9ffb`)
- feat: Infer Cargo workspace tasks (#13380) (`58fe9df`)
- fix: Retain shutdown signals for force exit (#13382) (`62ecdaa`)
- release(turborepo): 2.10.6-canary.2 (#13383) (`8035b5d`)
- fix: Resolve weekly security audit vulnerabilities (#13358)
(`64f4aac`)
- chore: Update to Rust 1.97.0 (#13322) (`feb0a1a`)
- fix: Pin VS Code extension macOS runners (#13391) (`26169cd`)
- release(turborepo): 2.10.6-canary.3 (#13392) (`f753f04`)
- docs: Add Experimental Rust Guide (#13375) (`a2bf8a2`)
- ci: Use affected filtering for JS tests (#13386) (`0536a70`)
- ci: Fold docs checks into quality (#13385) (`fcd1858`)
- ci: Verify schemas through Turborepo (#13387) (`66551bc`)
- chore: Avoid duplicate N-API Cargo build (#13388) (`4ddacf4`)
- chore: Hash embedded frameworks data in Rust builds (#13389)
(`373c0a2`)
- ci: Include VS Code extension type checks (#13390) (`716ad9c`)
- refactor: Run releaser bundle directly (#13393) (`b6a92de`)
- refactor: Move release publishing into releaser (#13394) (`e0cf33c`)
- refactor: Consolidate release orchestration (#13395) (`51f5529`)
- feat: Add crate-scoped Cargo verification tasks (#13398) (`aeb2ee5`)
- fix: Fetch release commit parent (#13400) (`ab05127`)
- docs: Update Geistdocs to 1.13.0 (#13412) (`b1d8c9f`)
- release(turborepo): 2.10.6-canary.4 (#13401) (`90eba05`)
- fix: Preserve pnpm `node@runtime:` lockfile entries (#13408)
(`4ac2f47`)
- chore: Fix typos in with-solid example and globwatch comment (#13416)
(`424cabd`)
- refactor: Remove unused public APIs found by Hawk (#13420) (`831990d`)
- fix: Check dynamic imports in boundaries (#13418) (`31be2b8`)
- refactor: Use regex! for static pattern compilation (#13419)
(`82cd34c`)
- fix: Refactor `turbo watch` (#13423) (`328b99f`)
- release(turborepo): 2.10.6-canary.5 (#13424) (`ceee06b`)
- chore: Upgrade brace-expansion (#13429) (`d45bf2a`)
- chore: Update tar to 7.5.18 (#13428) (`d0dbd5a`)
- chore: Upgrade js-yaml (#13427) (`c8e36ad`)
- fix: Match JIT inputs for affected tasks (#13426) (`1b95fcb`)
- fix: Preserve project Yarn package extensions (#13425) (`f08f35c`)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview – turborepo-eve-agent — 2b535fe3 Deployed Jul 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

turbo prune drops pnpm node@runtime: lockfile entries (devEngines onFail: "download"), breaking pnpm install --frozen-lockfile in Docker builds

2 participants