Skip to content

fix(deploy): keep runtime edges in the deploy importer when their group is excluded - #15710

Merged
zkochan merged 4 commits into
pnpm:mainfrom
atiqrahmanx:fix/deploy-prod-devengines-runtime
Sep 25, 2026
Merged

zkochan merged 4 commits into
pnpm:mainfrom
atiqrahmanx:fix/deploy-prod-devengines-runtime

Conversation

@atiqrahmanx

@atiqrahmanx atiqrahmanx commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #15703

The bug

pnpm deploy --prod fails with ERR_PNPM_OUTDATED_LOCKFILE when the deployed project declares a devEngines.runtime with onFail: download:

specifiers in the lockfile don't match specifiers in package.json:
* in importers["."]:
* 1 dependency was added: node@runtime:24.16.0

pnpm install --frozen-lockfile --prod on the same project succeeds, and so does pnpm deploy without --prod.

Root cause

A devEngines.runtime (or engines.runtime) with onFail: download is reified into a synthetic <name>: runtime:<version> dependency every time the manifest is read (devEngines maps to devDependencies, engines to dependencies).

The deploy file generators drop an excluded dependency group's direct dependencies from both the generated deploy manifest and the generated deploy lockfile importer. But the generated deploy manifest keeps the devEngines field, so when the install inside the deploy directory re-reads that manifest, the runtime edge is re-derived, and the frozen-lockfile freshness check finds a specifier in the manifest that the pruned importer does not carry.

The fix

Keep runtime references in the generated deploy importer when their dependency group is excluded, the same way peer-only dependencies are already kept. The engines field regenerates them on every manifest read, so the importer must carry them to stay satisfiable. The deploy install still skips them with the rest of the excluded group, so --prod deploys without the runtime in node_modules, matching what pnpm deploy without --prod and a plain pnpm install --prod produce.

Fixed in both stacks, as the bug is present in both: TypeScript createDeployFiles and Rust fill_target_dependencies.

Testing

  • New regression tests fail on main and pass with the fix:
    • TypeScript: prod deploy skips the devEngines runtime without failing the frozen lockfile check in pnpm11/releasing/commands/test/deploy/deploy.test.ts
    • Rust: prod_deploy_skips_a_devengines_runtime_without_failing_the_frozen_lockfile_check in pnpm/crates/cli/tests/suite/deploy_specifiers.rs
  • Ran the deploy suites in both stacks (61 Rust deploy tests, 58 TypeScript deploy tests, 8 e2e deploy tests), the Rust runtime install tests (27), eslint, cspell, and the pinned rustfmt. All green.
  • Verified the issue's exact reproduction against builds of both CLIs from this branch: deploy --prod succeeds, the prod dependencies land in dist/node_modules, the runtime does not, and the deploy lockfile importer keeps the node@runtime: dev edge.

Test fix carried along

interrupt::a_process_the_script_left_behind_survives_the_exit_of_pnpm failed on the macOS Rust CI runner with ParseIntError { kind: Empty }. Its fixture wrote the pid with a plain writeFileSync, so the test could see the file before its contents. The lingering and stubborn fixtures now write the pid to a temporary file and rename it into place.


Written by an agent (ZCode, GLM-5.3).
Test fix section added by an agent (Claude Code, claude-opus-5-5).

Summary by CodeRabbit

  • Bug Fixes
    • Fixed production deployments that failed with ERR_PNPM_OUTDATED_LOCKFILE when a project declared a downloadable devEngines.runtime.
    • Production deployments include regular production dependencies while keeping the runtime package out of deployed node_modules.
    • The runtime entry remains in the deployed lockfile’s development dependencies, preserving the project’s runtime configuration without installing it as a production dependency.
    • Deployments also retain configured patch information in the deployed lockfile.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 9fc270eb-7364-4564-aedd-dc845063283f

📥 Commits

Reviewing files that changed from the base of the PR and between 21d812e and 1a1b012.

📒 Files selected for processing (1)
  • pnpm/crates/cli/tests/suite/interrupt.rs
 ________________________________________________________________________________
< A bunny is never late, nor is he early, he reviews precisely when he means to. >
 --------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: c764f300-a0e3-4c16-90e2-4188ffa5caa0

📥 Commits

Reviewing files that changed from the base of the PR and between 8385129 and c03a140.

📒 Files selected for processing (7)
  • .changeset/prod-deploy-devengines-runtime.md
  • pnpm/crates/cli/src/cli_args/deploy.rs
  • pnpm/crates/cli/src/cli_args/deploy/lockfile.rs
  • pnpm/crates/cli/src/cli_args/deploy/workspace_manifest.rs
  • pnpm/crates/cli/tests/suite/deploy_specifiers.rs
  • pnpm11/releasing/commands/src/deploy/createDeployFiles.ts
  • pnpm11/releasing/commands/test/deploy/deploy.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Production deploy now retains runtime: references in the deployed importer’s development dependencies while excluding the runtime package from deployed node_modules. The Rust deploy path also moves workspace settings construction to the workspace manifest module.

Changes

Production deploy runtime handling

Layer / File(s) Summary
Deploy workspace settings construction
pnpm/crates/cli/src/cli_args/deploy.rs, pnpm/crates/cli/src/cli_args/deploy/lockfile.rs, pnpm/crates/cli/src/cli_args/deploy/workspace_manifest.rs
The Rust deploy path uses deploy_workspace_settings from the workspace manifest module. That function applies configured patch paths and nonempty allow_builds settings to the deploy manifest and config.
Retain runtime references in production deploy
pnpm/crates/cli/src/cli_args/deploy/lockfile.rs, pnpm/crates/cli/tests/suite/deploy_specifiers.rs, pnpm11/releasing/commands/src/deploy/createDeployFiles.ts, pnpm11/releasing/commands/test/deploy/deploy.test.ts, .changeset/prod-deploy-devengines-runtime.md
The Rust and TypeScript deploy paths retain excluded runtime: references in the deployed importer. Regression tests verify production deploy preserves the runtime entry while excluding the runtime package. The changeset records patch releases for the listed packages.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Assessment against linked issues

Objective Addressed Explanation
[ #15703 ] Make pnpm deploy --prod succeed when devEngines.runtime is set, without placing the runtime in deployed node_modules. ✅

Suggested labels: product: pnpm@11, product: pacquet

Merge Risk: ⚪ Minimal · up to c03a1

The production deploy fix appears ready to merge after normal checks. No actionable merge-blocking risk is established by the supplied evidence.

Security Architecture Review

Security architecture risk: 🔵 Low · up to c03a1

The change keeps runtime references needed for production deploys without installing the excluded runtime. The reviewed deploy paths show no demonstrated expansion of build or patch authority, but failure and retry behavior is not fully exercised.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The affected security-relevant scope is the generated deploy directory: runtime references can appear in its lockfile without adding the excluded runtime to its installed packages.

Trust Boundaries and Controls

  • observed — The Rust shared-deploy path carries patch and build permissions from the source configuration and lockfile into deploy-owned settings; installation applies the returned configuration with the workspace directory set to the deploy directory.

Resilience and Maintainability Implications

  • inferred — Error propagation limits the chance that a failed shared install is reported as a successful legacy deploy. Cleanup and externally visible state after an interrupted install and retry remain unverified by an execution trace.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Same-run regression check

HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.

Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2351.67 ms 2431.45 ms 3.4% 117.58 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1464.68 ms 1389.55 ms -5.1% 73.23 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 291.21 ms 268.72 ms -7.7% 14.56 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 302.89 ms 274.67 ms -9.3% 15.14 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 10.13 ms 11.42 ms 12.7% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 9.84 ms 9.88 ms 0.5% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 10.67 ms 11.36 ms 6.4% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 10.60 ms 10.15 ms -4.2% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2808.36 ms 2726.13 ms -2.9% 140.42 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1586.19 ms 1555.04 ms -2.0% 79.31 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 431.44 ms 420.78 ms -2.5% 21.57 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 276.85 ms 280.68 ms 1.4% 13.84 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1753.30 ms 1800.43 ms 2.7% 87.66 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 373.40 ms 382.79 ms 2.5% 18.67 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 250.74 ms 262.82 ms 4.8% 12.54 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 106.36 ms 111.52 ms 4.9% 5.32 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 949.89 ms 902.68 ms -5.0% 47.49 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 207.43 ms 198.60 ms -4.3% 10.37 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4526.06 ms 4506.81 ms -0.4% 226.30 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3520.25 ms 3593.77 ms 2.1% 176.01 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 182.01 ms 160.91 ms -11.6% 9.10 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 176.43 ms 218.49 ms 23.8% 8.82 ms Inconclusive (overlapping samples)

Integrated-Benchmark Report (Linux)

Commit: 21d812e3d15e

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.465 ± 0.150 2.302 2.758 1.68 ± 0.20
pacquet@main 2.435 ± 0.165 2.279 2.729 1.66 ± 0.20
pnpr@HEAD 1.463 ± 0.149 1.296 1.697 1.00
pnpr@main 1.487 ± 0.137 1.306 1.716 1.02 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.4652084946999997,
      "stddev": 0.1502345261720814,
      "median": 2.4314485185,
      "user": 1.6067866599999998,
      "system": 1.5239923599999998,
      "min": 2.3022357374999998,
      "max": 2.7582055805
    },
    {
      "command": "pacquet@main",
      "mean": 2.4348673118,
      "stddev": 0.16477488306617866,
      "median": 2.3516680389999998,
      "user": 1.4019211599999999,
      "system": 1.4675878599999999,
      "min": 2.2786158784999997,
      "max": 2.7286979055
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.4634129823,
      "stddev": 0.14909754789008245,
      "median": 1.3895540290000001,
      "user": 1.3116571600000002,
      "system": 1.37317956,
      "min": 1.2961184405000001,
      "max": 1.6968974365000002
    },
    {
      "command": "pnpr@main",
      "mean": 1.4867811249,
      "stddev": 0.13661161257581128,
      "median": 1.464683473,
      "user": 1.3440569599999999,
      "system": 1.35829356,
      "min": 1.3057752755,
      "max": 1.7157734105
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 265.8 ± 11.0 245.4 284.6 1.00
pacquet@main 291.6 ± 23.0 262.9 324.5 1.10 ± 0.10
pnpr@HEAD 274.2 ± 26.7 237.9 314.9 1.03 ± 0.11
pnpr@main 311.1 ± 56.6 244.7 407.2 1.17 ± 0.22
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.26580607196,
      "stddev": 0.01099398366860501,
      "median": 0.26871820066,
      "user": 0.2923784400000001,
      "system": 0.62731312,
      "min": 0.24544139466000003,
      "max": 0.28459512766
    },
    {
      "command": "pacquet@main",
      "mean": 0.29164240986,
      "stddev": 0.023040152387984736,
      "median": 0.29121160065999996,
      "user": 0.33921574000000004,
      "system": 0.64639102,
      "min": 0.26292037866,
      "max": 0.32449111666
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.27424486886,
      "stddev": 0.02666767457609994,
      "median": 0.27466862216,
      "user": 0.27648984000000004,
      "system": 0.59903992,
      "min": 0.23788180166000003,
      "max": 0.31492192466
    },
    {
      "command": "pnpr@main",
      "mean": 0.31107391935999995,
      "stddev": 0.056570489897632095,
      "median": 0.30289238716,
      "user": 0.32487674,
      "system": 0.6516144199999999,
      "min": 0.24474347766000001,
      "max": 0.40723943166
    }
  ]
}

Scenario: Isolated linker: repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 11.6 ± 1.5 8.5 17.3 1.17 ± 0.19
pacquet@main 10.2 ± 1.2 7.5 15.2 1.04 ± 0.16
pnpr@HEAD 10.1 ± 1.6 7.3 14.8 1.02 ± 0.19
pnpr@main 9.9 ± 1.1 8.1 14.5 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.01158346100583333,
      "stddev": 0.0014614711365273662,
      "median": 0.01141769296,
      "user": 0.0068812166666666645,
      "system": 0.005362860833333333,
      "min": 0.00853741446,
      "max": 0.01726867846
    },
    {
      "command": "pacquet@main",
      "mean": 0.01024780109868613,
      "stddev": 0.001173130712447101,
      "median": 0.010134539460000001,
      "user": 0.005928362043795623,
      "system": 0.004925043065693431,
      "min": 0.007527319460000001,
      "max": 0.01521571346
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.010120864045937506,
      "stddev": 0.0015607988384887747,
      "median": 0.00988355246,
      "user": 0.00592799375,
      "system": 0.004767740625000001,
      "min": 0.00733639046,
      "max": 0.014804049460000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.009879814530866135,
      "stddev": 0.0010560356032165766,
      "median": 0.00983575696,
      "user": 0.005919281889763784,
      "system": 0.004542242519685038,
      "min": 0.008093514460000001,
      "max": 0.01449896546
    }
  ]
}

Scenario: Isolated linker: repeat install, cold cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 11.7 ± 1.5 8.7 17.2 1.15 ± 0.19
pacquet@main 10.7 ± 1.2 8.7 16.3 1.06 ± 0.15
pnpr@HEAD 10.2 ± 1.0 8.1 13.3 1.00
pnpr@main 11.0 ± 1.7 8.4 19.7 1.08 ± 0.19
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.01169276309301587,
      "stddev": 0.0015445552809955072,
      "median": 0.011361746220000002,
      "user": 0.006040832804232801,
      "system": 0.0064702410582010575,
      "min": 0.00869106822,
      "max": 0.01718031622
    },
    {
      "command": "pacquet@main",
      "mean": 0.010749583345000003,
      "stddev": 0.0011521373434620376,
      "median": 0.01067353922,
      "user": 0.005676533035714281,
      "system": 0.005849585446428574,
      "min": 0.008679399220000002,
      "max": 0.016295553219999998
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.01018045965718593,
      "stddev": 0.0009568818359577079,
      "median": 0.010152022220000001,
      "user": 0.005789564824120606,
      "system": 0.005124345025125629,
      "min": 0.008087336220000001,
      "max": 0.013291333220000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.01096143152327869,
      "stddev": 0.0016864662810051785,
      "median": 0.010596765220000002,
      "user": 0.006365214754098356,
      "system": 0.005354581475409834,
      "min": 0.008398189220000001,
      "max": 0.01970126322
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.735 ± 0.048 2.658 2.833 1.70 ± 0.19
pacquet@main 2.809 ± 0.049 2.729 2.877 1.75 ± 0.20
pnpr@HEAD 1.607 ± 0.180 1.451 1.949 1.00
pnpr@main 1.608 ± 0.150 1.450 1.823 1.00 ± 0.15
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.7350341099,
      "stddev": 0.048331745266210785,
      "median": 2.7261279952,
      "user": 2.5875090399999996,
      "system": 2.1948568799999997,
      "min": 2.6575960532000003,
      "max": 2.8328004662
    },
    {
      "command": "pacquet@main",
      "mean": 2.8085428813,
      "stddev": 0.04896815981532342,
      "median": 2.8083604992,
      "user": 2.7804626399999997,
      "system": 2.3520034799999996,
      "min": 2.7294479152,
      "max": 2.8773150442000004
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.60709153,
      "stddev": 0.1800050208052752,
      "median": 1.5550392927,
      "user": 1.52707764,
      "system": 1.7228924799999998,
      "min": 1.4508761012,
      "max": 1.9492219052000002
    },
    {
      "command": "pnpr@main",
      "mean": 1.6080624209,
      "stddev": 0.15033879341075915,
      "median": 1.5861851587,
      "user": 1.50741294,
      "system": 1.7819567800000002,
      "min": 1.4496017852,
      "max": 1.8231485232
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 433.2 ± 31.1 403.3 495.5 1.57 ± 0.13
pacquet@main 430.0 ± 9.1 414.6 444.0 1.56 ± 0.07
pnpr@HEAD 285.1 ± 22.1 255.8 320.2 1.03 ± 0.09
pnpr@main 275.8 ± 11.7 257.8 292.7 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.4332376548,
      "stddev": 0.03109510133589587,
      "median": 0.4207756642,
      "user": 0.6219786600000001,
      "system": 0.7026663999999999,
      "min": 0.4033438787,
      "max": 0.4955102087
    },
    {
      "command": "pacquet@main",
      "mean": 0.42999226840000004,
      "stddev": 0.009085535972012808,
      "median": 0.4314449562,
      "user": 0.6291119599999999,
      "system": 0.7106446,
      "min": 0.4145523597,
      "max": 0.4439989627
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.2851167167,
      "stddev": 0.022062976581742774,
      "median": 0.2806757712,
      "user": 0.23512286,
      "system": 0.5162274,
      "min": 0.2557509357,
      "max": 0.3201572627
    },
    {
      "command": "pnpr@main",
      "mean": 0.2757879242,
      "stddev": 0.01171851887090761,
      "median": 0.2768497727,
      "user": 0.22600195999999997,
      "system": 0.512799,
      "min": 0.2577990537,
      "max": 0.2926793877
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.797 ± 0.052 1.716 1.872 4.74 ± 0.23
pacquet@main 1.754 ± 0.024 1.717 1.792 4.63 ± 0.19
pnpr@HEAD 0.383 ± 0.018 0.353 0.411 1.01 ± 0.06
pnpr@main 0.379 ± 0.015 0.365 0.412 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7965247361199999,
      "stddev": 0.05227523702686021,
      "median": 1.80042802972,
      "user": 1.20738044,
      "system": 1.15071374,
      "min": 1.71602961272,
      "max": 1.8721434617200001
    },
    {
      "command": "pacquet@main",
      "mean": 1.7537665099199997,
      "stddev": 0.02419179162058506,
      "median": 1.75329656722,
      "user": 1.15176434,
      "system": 1.07496944,
      "min": 1.71739063972,
      "max": 1.7919629277200002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.38305490232000006,
      "stddev": 0.017613106366109698,
      "median": 0.38278593672000005,
      "user": 0.33214953999999997,
      "system": 0.8143196400000001,
      "min": 0.35343033572000004,
      "max": 0.41119444072000005
    },
    {
      "command": "pnpr@main",
      "mean": 0.3789141653200001,
      "stddev": 0.014599351061132712,
      "median": 0.37340271922,
      "user": 0.32598444,
      "system": 0.8109175399999999,
      "min": 0.36453786872000005,
      "max": 0.41181283072
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 277.0 ± 36.9 242.9 333.8 2.60 ± 0.36
pacquet@main 256.8 ± 17.1 238.8 289.0 2.41 ± 0.19
pnpr@HEAD 111.4 ± 6.3 97.9 126.4 1.05 ± 0.07
pnpr@main 106.6 ± 4.2 98.2 118.6 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2769874919254545,
      "stddev": 0.03688702855855902,
      "median": 0.26282165538,
      "user": 0.2908625163636364,
      "system": 0.10281470363636362,
      "min": 0.24290704038,
      "max": 0.33376184238
    },
    {
      "command": "pacquet@main",
      "mean": 0.25683219154666664,
      "stddev": 0.017134811417827335,
      "median": 0.25074466438,
      "user": 0.27907187999999994,
      "system": 0.08226417333333334,
      "min": 0.23882040838000002,
      "max": 0.28903872338000003
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.11141844800068966,
      "stddev": 0.006298059614265125,
      "median": 0.11151608538000002,
      "user": 0.04872274206896551,
      "system": 0.020948983448275865,
      "min": 0.09794710838000001,
      "max": 0.12636429338
    },
    {
      "command": "pnpr@main",
      "mean": 0.10658415715777778,
      "stddev": 0.004219960107871787,
      "median": 0.10635649138000002,
      "user": 0.04652576888888889,
      "system": 0.01812808074074074,
      "min": 0.09815320438000001,
      "max": 0.11862593938000002
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 879.0 ± 115.0 616.9 1012.1 1.00
pacquet@main 982.2 ± 129.8 841.6 1258.8 1.12 ± 0.21
pnpm@HEAD 4788.6 ± 392.0 4222.1 5331.9 5.45 ± 0.84
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.8790462363244446,
      "stddev": 0.11502337593228751,
      "median": 0.90267998488,
      "user": 0.9160276911111109,
      "system": 0.19919290888888888,
      "min": 0.6169110278800001,
      "max": 1.0121326458800002
    },
    {
      "command": "pacquet@main",
      "mean": 0.9821969983244446,
      "stddev": 0.12981183399441715,
      "median": 0.9498907268800001,
      "user": 1.010743691111111,
      "system": 0.2266901311111111,
      "min": 0.84163595288,
      "max": 1.25883778488
    },
    {
      "command": "pnpm@HEAD",
      "mean": 4.788569529102222,
      "stddev": 0.3919978719430146,
      "median": 4.81187004888,
      "user": 7.63381446888889,
      "system": 0.36577057555555553,
      "min": 4.22209840888,
      "max": 5.3318526338800005
    }
  ]
}

Scenario: Isolated linker: linked-workspace resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 199.4 ± 4.4 193.9 208.7 1.00
pacquet@main 208.9 ± 9.8 196.3 231.0 1.05 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.19936430545142855,
      "stddev": 0.004375799129727749,
      "median": 0.19860493038,
      "user": 0.15287198285714285,
      "system": 0.08321796,
      "min": 0.19385151588000002,
      "max": 0.20870806888000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.20894353852285713,
      "stddev": 0.009771436672742018,
      "median": 0.20742924388,
      "user": 0.16789234,
      "system": 0.08337360285714286,
      "min": 0.19634557788,
      "max": 0.23104240088
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.599 ± 0.173 4.439 4.859 1.30 ± 0.05
pacquet@main 4.580 ± 0.143 4.430 4.854 1.30 ± 0.04
pnpr@HEAD 3.593 ± 0.103 3.466 3.811 1.02 ± 0.03
pnpr@main 3.529 ± 0.045 3.483 3.617 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.599347033999999,
      "stddev": 0.17333425031632832,
      "median": 4.5068149385,
      "user": 1.80325814,
      "system": 2.0731382799999998,
      "min": 4.439391592,
      "max": 4.859070564
    },
    {
      "command": "pacquet@main",
      "mean": 4.5804873851000005,
      "stddev": 0.1433966386816243,
      "median": 4.5260611514999995,
      "user": 1.99378054,
      "system": 1.99562468,
      "min": 4.4297294009999995,
      "max": 4.854243858999999
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5933766877,
      "stddev": 0.1033537658927039,
      "median": 3.59376814,
      "user": 1.7988645399999998,
      "system": 1.87372428,
      "min": 3.465646499,
      "max": 3.8105101300000004
    },
    {
      "command": "pnpr@main",
      "mean": 3.5285414976,
      "stddev": 0.044583676775793654,
      "median": 3.520248548,
      "user": 1.8810012399999998,
      "system": 1.9310665799999995,
      "min": 3.483339444,
      "max": 3.616806973
    }
  ]
}

Scenario: GVS linker: fresh restore, hot cache + hot store

Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 166.3 ± 19.2 136.1 197.1 1.00
pacquet@main 185.8 ± 21.6 157.4 223.9 1.12 ± 0.18
pnpr@HEAD 203.4 ± 32.4 151.5 245.2 1.22 ± 0.24
pnpr@main 191.9 ± 28.5 151.7 234.6 1.15 ± 0.22
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.16630221465250003,
      "stddev": 0.01923228417328356,
      "median": 0.16091277934000003,
      "user": 0.208961165,
      "system": 0.2138258875,
      "min": 0.13613535384000003,
      "max": 0.19709601084000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.18583130937333336,
      "stddev": 0.021619744110598648,
      "median": 0.18201286684,
      "user": 0.22484217333333328,
      "system": 0.23323019999999997,
      "min": 0.15742652584000003,
      "max": 0.22385340884000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.20340017747636366,
      "stddev": 0.03235719753708907,
      "median": 0.21849176884000002,
      "user": 0.24057713090909097,
      "system": 0.21707074545454547,
      "min": 0.15151356384,
      "max": 0.24524410584000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.19185200907529412,
      "stddev": 0.028528263809141332,
      "median": 0.17642527484,
      "user": 0.22400868705882346,
      "system": 0.20507349411764708,
      "min": 0.15174316884000003,
      "max": 0.23458135984000003
    }
  ]
}

@codecov-commenter

codecov-commenter commented Sep 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.50000% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.95%. Comparing base (8a9d3ee) to head (1a1b012).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
...ates/cli/src/cli_args/deploy/workspace_manifest.rs 47.22% 19 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15710   +/-   ##
=======================================
  Coverage   91.95%   91.95%           
=======================================
  Files        1463     1463           
  Lines      197226   197242   +16     
=======================================
+ Hits       181353   181375   +22     
+ Misses      15873    15867    -6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@atiqrahmanx
atiqrahmanx marked this pull request as ready for review September 25, 2026 19:15
Copilot AI lite review requested due to automatic review settings September 25, 2026 19:15
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Sep 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved review issues remain.

Review effort: Lite
Findings: None

What changed in this PR

Fixes pnpm deploy --prod failures involving downloadable runtime engines by preserving runtime edges in generated deploy importers.

Changes:

  • Preserve excluded runtime: dependencies in TypeScript and Rust deploy generation.
  • Add regression tests for both implementations.
  • Add release metadata.
File Description
pnpm11/​releasing/​commands/​test/​deploy/​deploy.test.ts Adds TypeScript regression coverage.
pnpm11/​releasing/​commands/​src/​deploy/​createDeployFiles.ts Preserves excluded runtime edges.
pnpm/​crates/​cli/​tests/​suite/​deploy_specifiers.rs Adds Rust regression coverage.
pnpm/​crates/​cli/​src/​cli_args/​deploy/​workspace_manifest.rs Hosts shared workspace settings logic.
pnpm/​crates/​cli/​src/​cli_args/​deploy/​lockfile.rs Preserves runtime edges in Rust lockfile generation.
pnpm/​crates/​cli/​src/​cli_args/​deploy.rs Updates the workspace settings import.
.changeset/​prod-deploy-devengines-runtime.md Records the user-visible fix and releases.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

atiqrahmanx and others added 3 commits September 25, 2026 22:22
…up is excluded

A devEngines.runtime with onFail: download is reified into a
node: runtime:<version> dependency every time the manifest is read.
deploy --prod dropped that edge from the generated deploy lockfile
importer while the generated deploy manifest kept the devEngines field,
so the install inside the deploy directory re-derived the edge and
failed its frozen-lockfile check with ERR_PNPM_OUTDATED_LOCKFILE.

The deploy file generators now keep runtime references in the importer
when their dependency group is excluded, like they already keep
peer-only dependencies. The deploy install still skips them with the
rest of the excluded group, so the runtime stays out of the deployed
node_modules.

Fixes pnpm#15703
…e manifest

`deploy_workspace_settings` builds the deploy's `pnpm-workspace.yaml` and
the matching install settings, so it belongs with
`deploy_workspace_manifest` rather than in the lockfile module. This also
keeps `lockfile.rs` within the 400-line limit enforced by
`perfectionist::overly_long_file`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`perfectionist::macro_trailing_comma` requires a trailing comma in
multi-line macro invocations.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI review requested due to automatic review settings September 25, 2026 20:29
@zkochan
zkochan force-pushed the fix/deploy-prod-devengines-runtime branch from c03a140 to 21d812e Compare September 25, 2026 20:29
@qodo-code-review

qodo-code-review Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (3) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Both release lines share one changeset 📘 Rule violation § Compliance
Description
.changeset/prod-deploy-devengines-runtime.md lists both pnpm and pacquet in one front-matter
block despite changing the TypeScript v11 and Rust v12 implementations. The dual-stack release must
therefore be disentangled before each package can receive the separately targeted changeset required
by this policy.
Code

.changeset/prod-deploy-devengines-runtime.md[R2-4]

+"@pnpm/releasing.commands": patch
+"pacquet": patch
+"pnpm": patch
Relevance

●●● Strong

Recent precedent explicitly accepts splitting pnpm and pacquet changesets for independent release
lines.

PR-#15316
PR-#15565

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 713436 requires separate changeset files when one PR changes both the TypeScript pnpm v11 CLI
and Rust pnpm v12 implementation. The new changeset places the v11 pnpm target, the affected
TypeScript support package, and the v12 pacquet target in a single front-matter block.

Rule 713436: Changesets for pnpm v11 vs v12 (pacquet) must target the correct package and bump type
.changeset/prod-deploy-devengines-runtime.md[1-7]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR combines the pnpm v11 and pacquet v12 release entries in one changeset, although dual-stack CLI changes require separately targeted changesets.

## Fix Focus Areas
- .changeset/prod-deploy-devengines-runtime.md[1-7]

## Recommended Fix
Replace the combined file with two changesets. Target `pnpm` and `@pnpm/releasing.commands` with patch bumps in the v11 changeset, and target only `pacquet` in the v12 changeset.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. The deploy fix carries unrelated churn 📘 Rule violation ⚙ Maintainability
Description
deploy_workspace_settings is moved wholesale from lockfile.rs into workspace_manifest.rs, with
corresponding import rewiring, although that helper does not implement runtime-edge preservation.
This relocation expands the focused frozen-lockfile fix into a separate maintenance change that
reviewers and later reverts must handle together.
Code

pnpm/crates/cli/src/cli_args/deploy/workspace_manifest.rs[R42-45]

+/// The `pnpm-workspace.yaml` the deploy writes, and the same settings in
+/// the shape the deploy install consumes. The manifest records the
+/// self-contained deploy layout plus settings that survive from the source.
+pub(super) fn deploy_workspace_settings(
Relevance

●● Moderate

Historical deploy refactors were accepted, but no close precedent establishes whether this specific
behavior-neutral relocation is required.

PR-#15246
PR-#15416

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 2255067 excludes behavior-neutral moves in files or functions not needed by the reported
defect. The added block is the workspace-settings helper relocated from the lockfile module, while
the actual fix is the separate runtime-specifier filter.

Rule 2255067: Bug fix changes must not include unrelated refactors or reformatting
pnpm/crates/cli/src/cli_args/deploy/workspace_manifest.rs[42-84]
pnpm/crates/cli/src/cli_args/deploy/lockfile.rs[1-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The bug-fix PR also relocates the deploy workspace settings helper, a behavior-neutral refactor unrelated to preserving runtime dependency edges.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/deploy/workspace_manifest.rs[42-84]
- pnpm/crates/cli/src/cli_args/deploy/lockfile.rs[1-10]
- pnpm/crates/cli/src/cli_args/deploy.rs[56-59]

## Recommended Fix
Keep `deploy_workspace_settings` in its original lockfile module and restore the original imports in this PR. Submit the module relocation separately so this change contains only the runtime-edge fix and its tests.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. The release note conflates old and new 📘 Rule violation ⚙ Maintainability
Description
The first changeset sentence combines the resolution with the former ERR_PNPM_OUTDATED_LOCKFILE
failure through Fixed ... failing instead of stating the old behavior separately. Readers are not
given distinct past-tense and current-behavior statements for projects declaring
devEngines.runtime.
Code

.changeset/prod-deploy-devengines-runtime.md[7]

+Fixed `pnpm deploy --prod` failing with `ERR_PNPM_OUTDATED_LOCKFILE` when the deployed project declares a `devEngines.runtime` with `onFail: download`. The runtime stays out of the deployed `node_modules` with the rest of the dev dependencies [#15703](https://github.com/pnpm/pnpm/issues/15703).
Relevance

●● Moderate

Evidence is mixed: several recent changes accept separating old behavior, while comparable recent
suggestions were rejected.

PR-#14179
PR-#15578
PR-#15542

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 3058498 requires previous buggy behavior to appear in its own past-tense sentence, separate
from the corrected behavior. The changeset instead expresses the fix and former failure together as
Fixed ... failing, followed by a sentence about runtime installation rather than a distinct
statement that deployment now succeeds.

Rule 3058498: Describe previous buggy behavior in a separate past-tense sentence
.changeset/prod-deploy-devengines-runtime.md[7-7]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The bug-fix release note folds the previous failure into a sentence announcing the fix instead of describing old and current behavior in separate sentences.

## Fix Focus Areas
- .changeset/prod-deploy-devengines-runtime.md[7-7]

## Recommended Fix
Rewrite the entry as two direct sentences. First state in past tense that `pnpm deploy --prod` previously failed for the specified runtime configuration, then state that it now succeeds while leaving the development runtime out of deployed `node_modules`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 64 rules
✅ Skills: review-code
✅ Cross-repo context — repo relationships
  Explored: repo: pnpm/update (sha: fcaa952e) — View relationship
  Explored: repo: pnpm/setup (sha: fbda4c85) — View relationship
Review mode: 🚀 Fast: This is a small, localized test-fixture robustness change in one file, with no production behavior or security-sensitive impact.

Grey Divider

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified.

Review effort: Lite
Findings: None

The lingering and stubborn fixtures wrote their pid with a plain
writeFileSync, which creates the file before it writes the contents.
A test that polled for the file could read it empty and fail with
ParseIntError { kind: Empty }, as seen on the macOS Rust CI runner.
Write to a temporary file and rename it into place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI review requested due to automatic review settings September 25, 2026 20:45
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 1a1b012

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified.

Review effort: Lite
Findings: None

@zkochan
zkochan merged commit d136989 into pnpm:main Sep 25, 2026
57 of 58 checks passed
@welcome

welcome Bot commented Sep 25, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm deploy --prod fails with ERR_PNPM_OUTDATED_LOCKFILE when devEngines.runtime is set

4 participants