Skip to content

fix(engine): reuse the pinned pnpm when nodeVersion names another major - #16498

Merged
zkochan merged 2 commits into
pnpm:mainfrom
altaywtf:fix/engine-slot-node-version
Oct 1, 2026
Merged

zkochan merged 2 commits into
pnpm:mainfrom
altaywtf:fix/engine-slot-node-version

Conversation

@altaywtf

@altaywtf altaywtf commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #16497

The bug

A project pins pnpm 12.8.1 and sets nodeVersion: 22.13.0 in pnpm-workspace.yaml. The machine runs Node.js 24. Every pnpm command in that project downloads pnpm 12.8.1 again, although it was already downloaded. Each command takes about a second instead of about 0.1 s, and with no network every command fails.

The bug needs both a pinned pnpm and a nodeVersion whose major differs from the node on PATH. It has been there since 12.0.0. pnpm v11 is not affected.

Why it happened

pnpm keeps downloaded pnpm versions in a shared store. A version's directory name includes the Node.js major it was installed for. pnpm v12 used two different majors for that name:

  • When it looked for an already downloaded version, it used the major of the node on PATH (24).
  • When it installed the version, it used the project's settings, so nodeVersion (22) applied.

The version was stored under the node22 name and looked up under the node24 name, so the lookup never found it.

The fix

The install of pnpm itself now ignores the project's nodeVersion (package_manager_engine_config in pnpm/crates/cli/src/engine_pm/install.rs). The downloaded pnpm runs on the node on PATH, not on nodeVersion, so the install and the lookup now use the same major. Projects without the mismatch get the same directory as before.

nodeVersion still applies to the project's own dependencies. This change affects only how pnpm installs itself.

One more effect: with engineStrict: true, pnpm's own engines.node is now checked against the node on PATH, not against nodeVersion. That is the Node.js pnpm actually runs on.

Test

version_flag_reuses_the_pinned_engine_when_node_version_names_another_major runs pnpm --version twice in a project with a pinned pnpm and a mismatched nodeVersion. The second run uses an unreachable registry. Without the fix the second run fails with ERR_PNPM_RESOLVING_NPM_RESOLVER_NETWORK_ERROR. With the fix it passes.

Measurements

pnpm --version in the example project, macOS arm64, mean of 5 runs:

time works offline
before 994 ms no
after 103 ms yes

Squash Commit Body

pnpm keeps downloaded pnpm versions in a shared store, in a directory
named partly after the Node.js major they were installed for. The lookup
for an already downloaded version used the major of the `node` on PATH.
The install used the project's config, which includes `nodeVersion`, so
it stored the version under that major. When the two majors differed,
the lookup never found the stored version and every command downloaded
it again. Offline, every such command failed.

The install of pnpm itself now ignores `nodeVersion`. The downloaded
pnpm runs on the `node` on PATH, and its env lockfile is already
resolved against that Node.js. pnpm v11 never reads `nodeVersion` when
installing itself, so it is not affected.

With `engineStrict`, pnpm's own `engines.node` is now checked against
the `node` on PATH, which is the Node.js it runs on.

Closes pnpm/pnpm#16497

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • New features are implemented only in the Rust pnpm v12 CLI. Bug fixes
    are implemented in every affected version.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

Written by an agent (Claude Code, Opus 5.5).

Summary by CodeRabbit

  • Bug Fixes
    • Pinned package manager versions are reused across commands even when the project’s configured Node.js major differs from the running version, avoiding repeated downloads and allowing commands to work without network access after the initial install.

@altaywtf
altaywtf requested a review from zkochan as a code owner October 1, 2026 16:57
Copilot AI balanced review requested due to automatic review settings October 1, 2026 16:57
@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 →

@coderabbitai

coderabbitai Bot commented Oct 1, 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: 289a108e-3d9e-46bd-b559-c72e5c4c88ca

📥 Commits

Reviewing files that changed from the base of the PR and between 4ba2968 and 5115ffa.

📒 Files selected for processing (1)
  • .changeset/engine-slot-ignores-node-version.md
 ____________________________________________
< This is what it sounds like when bugs cry. >
 --------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

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: 121f90f4-a104-4a1c-bffe-1a36d3ad04db

📥 Commits

Reviewing files that changed from the base of the PR and between 7afe7b9 and 3683189.

📒 Files selected for processing (3)
  • .changeset/engine-slot-ignores-node-version.md
  • pnpm/crates/cli/src/engine_pm/install.rs
  • pnpm/crates/cli/tests/suite/version.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The engine configuration now clears the project’s nodeVersion when targeting the shared engine store. A CLI test checks that a pinned pnpm version is reused on a later invocation when the registry is unreachable.

Changes

Pinned pnpm reuse

Layer / File(s) Summary
Engine configuration and reuse validation
pnpm/crates/cli/src/engine_pm/install.rs, pnpm/crates/cli/tests/suite/version.rs, .changeset/engine-slot-ignores-node-version.md
The engine configuration clears node_version. The test checks that consecutive --version invocations report pnpm 9.3.0, including when the registry is unreachable. The changeset records the patch.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Assessment against linked issues

Objective Addressed Explanation
Prevent repeated pinned pnpm installation when nodeVersion differs from the host Node.js major, including reuse without registry access [#16497] ✅

Suggested labels

product: pacquet

Merge Risk: ⚪ Minimal · up to 36831

The change aligns pinned pnpm installation and reuse across differing project Node.js versions. No actionable merge-blocking issue remains; merge after normal checks pass.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 36831

The change is narrow and preserves the existing package-selection, verification and locking paths. No introduced security defect was established. Residual uncertainty concerns protection of cached executables and behavior during interrupted or concurrent installation.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The relevant exposure is executable reuse among projects and processes sharing the same configured package-manager store. The store root remains derived from global_pkg_dir. These paths do not establish that different users share writable storage, and deployed ownership permissions remain unverified.

Trust Boundaries and Controls

  • observed — The base already selected host-major cached slots, irrespective of the project's differing nodeVersion. Head changes installation configuration, not that selection rule. On cache misses, identity verification still collects the wrapper and applicable host-platform component, rejects missing integrity metadata and invokes registry-signature checks.

Resilience and Maintainability Implications

  • inferred — Existing failure containment includes temporary-install cleanup, private-install cleanup on owner drop, orphan pruning and interrupted-build re-staging under a slot lock. These mechanisms are unchanged by nodeVersion normalization, but supplied validation does not exercise interruption or concurrent cold-cache installation.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

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

🔵 Needs a closer look

The fix alters a subtle shared engine-install/caching path with an intentional side effect on engineStrict checking and offline reinstall behavior, which the author notes is unverified on Linux and Windows, so final human review is warranted.

Review effort: Balanced
Findings: None

What changed in this PR

This PR fixes a pnpm v12 (pacquet) bug where a project that pins pnpm and sets nodeVersion to a Node.js major different from the node on PATH would reinstall the pinned pnpm on every switching command, failing offline. The engine's global-virtual-store (GVS) slot is keyed on the host's Node.js major by compute_engine_slot (via detect_node_major), but the install was run with the project's config still carrying nodeVersion, so the slot was written under the project's major and never found on lookup. The fix drops node_version from the engine install config so the install, env-lockfile resolution, and slot lookup all key on the host.

Changes:

  • package_manager_engine_config now sets config.node_version = None, with a doc comment explaining why.
  • Added an e2e regression test that installs a pinned engine with a mismatched nodeVersion, then verifies a second --version reuses it against an unreachable registry.
  • Added a pacquet patch changeset describing the user-visible fix.
File Description
pnpm/​crates/​cli/​src/​engine_pm/​install.rs Drops node_version from the engine config so the GVS slot keys on the host Node major, with an explanatory doc comment.
pnpm/​crates/​cli/​tests/​suite/​version.rs Adds a regression test proving the pinned engine is reused offline when nodeVersion names another major.
.changeset/​engine-slot-ignores-node-version.md Release note for the fix, targeting pacquet with a patch bump.

I verified that package_manager_engine_config is the config used for both sync_engine_dependencies (env resolution) and the install, that detect_installability_host consumes config.node_version to build the install host and engine name, and that compute_engine_slot independently uses detect_node_major() — so dropping node_version aligns the written slot with the looked-up slot. The test's node-major selection always differs from the host, dbg!(&output) matches the surrounding test convention, and the changeset follows the repo's style rules. No defects found.


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

@codecov-commenter

codecov-commenter commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.22%. Comparing base (c82802b) to head (5115ffa).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16498      +/-   ##
==========================================
- Coverage   92.22%   92.22%   -0.01%     
==========================================
  Files        1530     1530              
  Lines      205782   205845      +63     
==========================================
+ Hits       189776   189831      +55     
- Misses      16006    16014       +8     

☔ 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.

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

github-actions Bot commented Oct 1, 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 2661.05 ms 2777.27 ms 4.4% 133.05 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1647.19 ms 1606.14 ms -2.5% 82.36 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 501.19 ms 554.37 ms 10.6% 25.06 ms Inconclusive (overlapping samples)
isolated-fresh-restore-hot-cache-hot-store pnpr 384.00 ms 445.90 ms 16.1% 19.20 ms Inconclusive (overlapping samples)
isolated-repeat-install-hot-cache-hot-store pacquet 11.83 ms 11.27 ms -4.8% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 11.96 ms 11.30 ms -5.5% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 16.57 ms 15.30 ms -7.7% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 15.03 ms 14.74 ms -1.9% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2878.28 ms 2695.62 ms -6.3% 143.91 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1847.04 ms 1630.68 ms -11.7% 92.35 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 611.92 ms 507.42 ms -17.1% 30.60 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 394.14 ms 395.94 ms 0.5% 19.71 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1971.51 ms 1948.58 ms -1.2% 98.58 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 501.90 ms 466.18 ms -7.1% 25.09 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 322.08 ms 320.41 ms -0.5% 16.10 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 104.12 ms 101.58 ms -2.4% 5.21 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 330.83 ms 362.44 ms 9.6% 16.54 ms Inconclusive (overlapping samples)
isolated-linked-workspace-resolve-hot-cache-offline pacquet 256.15 ms 251.91 ms -1.7% 12.81 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 6047.40 ms 5307.08 ms -12.2% 302.37 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 5287.64 ms 5187.31 ms -1.9% 264.38 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 284.43 ms 280.90 ms -1.2% 14.22 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 329.32 ms 331.04 ms 0.5% 16.47 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: 4ba296818416

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.798 ± 0.151 2.633 3.028 1.76 ± 0.16
pacquet@main 2.675 ± 0.140 2.501 2.959 1.68 ± 0.15
pnpr@HEAD 1.588 ± 0.119 1.404 1.776 1.00
pnpr@main 1.640 ± 0.153 1.405 1.929 1.03 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.79815495678,
      "stddev": 0.15148366098999191,
      "median": 2.77727374368,
      "user": 2.7068622799999997,
      "system": 2.44360802,
      "min": 2.63274649468,
      "max": 3.0283566606799996
    },
    {
      "command": "pacquet@main",
      "mean": 2.6747480797799996,
      "stddev": 0.1404303784760316,
      "median": 2.66105036068,
      "user": 2.5996447799999998,
      "system": 2.31571962,
      "min": 2.50148165268,
      "max": 2.95869738268
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.58818357548,
      "stddev": 0.11916944741342418,
      "median": 1.60613639568,
      "user": 2.1105140799999997,
      "system": 1.8276230199999997,
      "min": 1.40365412668,
      "max": 1.7755838266800001
    },
    {
      "command": "pnpr@main",
      "mean": 1.64016909728,
      "stddev": 0.15347009958426616,
      "median": 1.64718501518,
      "user": 2.32463658,
      "system": 2.09966922,
      "min": 1.40492729568,
      "max": 1.92867527468
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 567.4 ± 126.4 414.5 818.7 1.43 ± 0.36
pacquet@main 528.6 ± 79.7 448.8 714.1 1.33 ± 0.25
pnpr@HEAD 455.9 ± 64.3 358.9 558.6 1.15 ± 0.21
pnpr@main 396.0 ± 44.9 339.9 462.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.5674305730800001,
      "stddev": 0.12642300249282223,
      "median": 0.5543686589800001,
      "user": 0.5856177600000001,
      "system": 0.93234862,
      "min": 0.41445989398000005,
      "max": 0.8186610299800001
    },
    {
      "command": "pacquet@main",
      "mean": 0.5286041595800001,
      "stddev": 0.07969800386907469,
      "median": 0.50119363248,
      "user": 0.5845627600000001,
      "system": 0.9530259200000002,
      "min": 0.44876415098000005,
      "max": 0.7141408489800001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.4558692860800001,
      "stddev": 0.0643003829234546,
      "median": 0.44590415098,
      "user": 0.51567326,
      "system": 0.9020774199999998,
      "min": 0.35891899998000004,
      "max": 0.55856519098
    },
    {
      "command": "pnpr@main",
      "mean": 0.39597202068000004,
      "stddev": 0.04485200483504724,
      "median": 0.38399906048,
      "user": 0.42508086,
      "system": 0.80373542,
      "min": 0.33985041998000004,
      "max": 0.46241630198000006
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 11.4 ± 1.3 9.1 17.2 1.00
pacquet@main 11.8 ± 1.6 8.3 16.1 1.03 ± 0.18
pnpr@HEAD 11.6 ± 1.3 9.5 16.6 1.02 ± 0.16
pnpr@main 12.2 ± 1.1 10.0 15.5 1.07 ± 0.15
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.011419663643636358,
      "stddev": 0.0012521950222404753,
      "median": 0.0112692512,
      "user": 0.006387110909090912,
      "system": 0.006284754181818184,
      "min": 0.0091432292,
      "max": 0.017177998200000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.011807928430125524,
      "stddev": 0.0015805955589759102,
      "median": 0.0118347352,
      "user": 0.006766591380753136,
      "system": 0.0063343314644351495,
      "min": 0.0082818452,
      "max": 0.0160551212
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.011648668498507464,
      "stddev": 0.0013492527931115998,
      "median": 0.011300122700000002,
      "user": 0.006687477910447757,
      "system": 0.006294796343283578,
      "min": 0.0095141332,
      "max": 0.0165605442
    },
    {
      "command": "pnpr@main",
      "mean": 0.012172244553658545,
      "stddev": 0.001062244251021597,
      "median": 0.0119566557,
      "user": 0.006881738861788615,
      "system": 0.006730466829268292,
      "min": 0.0099622452,
      "max": 0.015528098200000002
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 15.5 ± 1.7 12.5 22.9 1.06 ± 0.16
pacquet@main 16.5 ± 2.1 11.0 22.0 1.13 ± 0.19
pnpr@HEAD 14.5 ± 1.6 10.9 18.3 1.00
pnpr@main 14.9 ± 1.5 11.2 18.5 1.02 ± 0.15
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.015457066278079103,
      "stddev": 0.0016705171142656272,
      "median": 0.015298117860000002,
      "user": 0.008525900677966105,
      "system": 0.00865500700564972,
      "min": 0.012473556860000002,
      "max": 0.022866837860000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.016481503475942027,
      "stddev": 0.002124728639294499,
      "median": 0.01657363086,
      "user": 0.009395931014492752,
      "system": 0.00887549405797102,
      "min": 0.01098897086,
      "max": 0.021987030860000003
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.014538288327105254,
      "stddev": 0.0015560901235626271,
      "median": 0.01473720086,
      "user": 0.008203210000000002,
      "system": 0.007875196052631577,
      "min": 0.010919130860000001,
      "max": 0.018281340860000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.014894441458901108,
      "stddev": 0.0014655816935197393,
      "median": 0.01502548486,
      "user": 0.007980965494505499,
      "system": 0.008588244505494506,
      "min": 0.01121252986,
      "max": 0.018521669860000003
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.743 ± 0.175 2.586 3.189 1.65 ± 0.16
pacquet@main 2.888 ± 0.122 2.743 3.081 1.74 ± 0.15
pnpr@HEAD 1.662 ± 0.122 1.511 1.926 1.00
pnpr@main 1.814 ± 0.246 1.465 2.257 1.09 ± 0.17
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.7431346238600005,
      "stddev": 0.17498346787741167,
      "median": 2.69562492366,
      "user": 2.6595513799999995,
      "system": 2.0126493799999996,
      "min": 2.58649440766,
      "max": 3.18940555966
    },
    {
      "command": "pacquet@main",
      "mean": 2.88849500326,
      "stddev": 0.12204461980272667,
      "median": 2.8782765351600004,
      "user": 3.01476988,
      "system": 2.23505238,
      "min": 2.74277188166,
      "max": 3.08144911766
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.66221056796,
      "stddev": 0.12247257238564974,
      "median": 1.6306802416600001,
      "user": 1.6824261799999998,
      "system": 1.7788168800000002,
      "min": 1.5106461096600001,
      "max": 1.92598194766
    },
    {
      "command": "pnpr@main",
      "mean": 1.81389685386,
      "stddev": 0.24605141473456496,
      "median": 1.8470350251600003,
      "user": 1.9728026799999996,
      "system": 2.0944504800000003,
      "min": 1.46474869166,
      "max": 2.25661841366
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 506.1 ± 26.7 463.9 560.6 1.29 ± 0.07
pacquet@main 620.6 ± 22.1 590.8 659.3 1.58 ± 0.07
pnpr@HEAD 393.5 ± 9.0 381.9 407.9 1.00
pnpr@main 394.5 ± 15.3 365.0 423.0 1.00 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.50607107676,
      "stddev": 0.026711642548117566,
      "median": 0.50742443866,
      "user": 0.7024881199999999,
      "system": 0.8043008599999999,
      "min": 0.46389023416,
      "max": 0.5605940741600001
    },
    {
      "command": "pacquet@main",
      "mean": 0.62063156756,
      "stddev": 0.022140950340819494,
      "median": 0.61192228066,
      "user": 0.90980322,
      "system": 1.01046206,
      "min": 0.59075646016,
      "max": 0.6593418441600001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.39354697756000007,
      "stddev": 0.009015998569946457,
      "median": 0.39593954366000006,
      "user": 0.39073522,
      "system": 0.7933226600000001,
      "min": 0.38194523116,
      "max": 0.40791552016000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.39454534066,
      "stddev": 0.015315582297461335,
      "median": 0.39413639766,
      "user": 0.40221202,
      "system": 0.77525836,
      "min": 0.36502566416000004,
      "max": 0.42302914916
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.967 ± 0.080 1.891 2.161 4.16 ± 0.30
pacquet@main 2.009 ± 0.111 1.871 2.241 4.25 ± 0.35
pnpr@HEAD 0.472 ± 0.029 0.435 0.543 1.00
pnpr@main 0.502 ± 0.019 0.472 0.536 1.06 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.9667824412800001,
      "stddev": 0.07968655685480713,
      "median": 1.94858356438,
      "user": 1.55057318,
      "system": 1.30585964,
      "min": 1.8909913568799999,
      "max": 2.16088346488
    },
    {
      "command": "pacquet@main",
      "mean": 2.0086308813800002,
      "stddev": 0.11114219361722344,
      "median": 1.97150577238,
      "user": 1.62177558,
      "system": 1.38539264,
      "min": 1.8711412198800002,
      "max": 2.24073263988
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.47239108798,
      "stddev": 0.02850878181766855,
      "median": 0.46618098138,
      "user": 0.4666230799999999,
      "system": 0.91531294,
      "min": 0.43533175788,
      "max": 0.5429620328800001
    },
    {
      "command": "pnpr@main",
      "mean": 0.5023421055800001,
      "stddev": 0.019345263008154458,
      "median": 0.5018964018800001,
      "user": 0.45746057999999995,
      "system": 0.92605254,
      "min": 0.47218406588,
      "max": 0.5356373098800001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 360.3 ± 106.4 247.5 545.3 3.52 ± 1.06
pacquet@main 309.2 ± 43.1 238.8 367.4 3.02 ± 0.45
pnpr@HEAD 102.5 ± 5.5 95.4 118.4 1.00
pnpr@main 104.5 ± 5.3 96.4 122.3 1.02 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.36030357162000004,
      "stddev": 0.10640169507546267,
      "median": 0.32040701202000005,
      "user": 0.36900521999999997,
      "system": 0.14561828,
      "min": 0.24746417352,
      "max": 0.54526535052
    },
    {
      "command": "pacquet@main",
      "mean": 0.30917755672,
      "stddev": 0.04313954365328481,
      "median": 0.32208221402000003,
      "user": 0.31206332,
      "system": 0.12036398000000001,
      "min": 0.23879932352000002,
      "max": 0.36742949452000007
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10246032001999998,
      "stddev": 0.005462330200455249,
      "median": 0.10157589152,
      "user": 0.04094367000000001,
      "system": 0.019018113333333333,
      "min": 0.09539909452,
      "max": 0.11840459252
    },
    {
      "command": "pnpr@main",
      "mean": 0.10453038319857143,
      "stddev": 0.005329121977209972,
      "median": 0.10412287702,
      "user": 0.04395499142857142,
      "system": 0.019409065714285714,
      "min": 0.09642855252,
      "max": 0.12228909552
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 357.2 ± 46.9 290.2 419.4 1.08 ± 0.18
pacquet@main 332.2 ± 33.6 281.8 383.4 1.00
pnpm@HEAD 4857.4 ± 263.2 4333.6 5191.0 14.62 ± 1.68
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.3572467095333334,
      "stddev": 0.04691362957973227,
      "median": 0.36244339820000004,
      "user": 0.38788167111111116,
      "system": 0.08707797777777776,
      "min": 0.29024210320000005,
      "max": 0.41936898320000005
    },
    {
      "command": "pacquet@main",
      "mean": 0.3321589838666667,
      "stddev": 0.03362525488037986,
      "median": 0.3308308682,
      "user": 0.35620056,
      "system": 0.0847142,
      "min": 0.28184768320000003,
      "max": 0.38344395220000005
    },
    {
      "command": "pnpm@HEAD",
      "mean": 4.857369576755556,
      "stddev": 0.26316303819803893,
      "median": 4.845940973199999,
      "user": 7.836504448888888,
      "system": 0.4793285333333334,
      "min": 4.3335810552,
      "max": 5.1909896261999995
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 260.5 ± 25.1 229.7 303.2 1.00
pacquet@main 261.0 ± 34.5 226.0 358.9 1.00 ± 0.16
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2604732379566667,
      "stddev": 0.02511145610650719,
      "median": 0.25190715604,
      "user": 0.22005104333333333,
      "system": 0.09253949333333333,
      "min": 0.22971335654,
      "max": 0.30317341954000004
    },
    {
      "command": "pacquet@main",
      "mean": 0.26095831920666673,
      "stddev": 0.03445084306932893,
      "median": 0.25614632004000004,
      "user": 0.20471562666666665,
      "system": 0.10856232666666665,
      "min": 0.22604107254,
      "max": 0.35892967354000005
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 5.406 ± 0.317 5.043 6.010 1.05 ± 0.09
pacquet@main 6.062 ± 0.214 5.680 6.407 1.18 ± 0.09
pnpr@HEAD 5.139 ± 0.337 4.543 5.547 1.00
pnpr@main 5.396 ± 0.410 4.751 6.120 1.05 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 5.405675195480001,
      "stddev": 0.31728894934525875,
      "median": 5.30707885288,
      "user": 2.8529035800000004,
      "system": 2.60175622,
      "min": 5.04325287038,
      "max": 6.00973866638
    },
    {
      "command": "pacquet@main",
      "mean": 6.06202295338,
      "stddev": 0.21389510444810056,
      "median": 6.04739936388,
      "user": 2.92197748,
      "system": 2.8093885199999997,
      "min": 5.68039889538,
      "max": 6.407240231379999
    },
    {
      "command": "pnpr@HEAD",
      "mean": 5.1387955214800005,
      "stddev": 0.33666390172673133,
      "median": 5.187305418379999,
      "user": 2.8367591799999996,
      "system": 2.7618547199999997,
      "min": 4.54341021838,
      "max": 5.54708724538
    },
    {
      "command": "pnpr@main",
      "mean": 5.3963940182800005,
      "stddev": 0.40978088649273064,
      "median": 5.28763662088,
      "user": 2.9515025799999997,
      "system": 2.8660619200000004,
      "min": 4.75087222838,
      "max": 6.12015414638
    }
  ]
}

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 277.5 ± 38.0 209.5 351.8 1.00
pacquet@main 295.5 ± 37.3 239.7 359.9 1.06 ± 0.20
pnpr@HEAD 331.3 ± 53.3 259.9 407.1 1.19 ± 0.25
pnpr@main 338.7 ± 32.8 299.9 399.7 1.22 ± 0.20
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.27746792754000005,
      "stddev": 0.03800018530407247,
      "median": 0.28090018454000004,
      "user": 0.32132143,
      "system": 0.22170400666666668,
      "min": 0.20952183154,
      "max": 0.35184345154
    },
    {
      "command": "pacquet@main",
      "mean": 0.29545178226727276,
      "stddev": 0.03726508171957265,
      "median": 0.28443168954000003,
      "user": 0.34866263454545454,
      "system": 0.21934256727272727,
      "min": 0.23966294154,
      "max": 0.35993873854
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.33125860554000003,
      "stddev": 0.05327655682844533,
      "median": 0.33103977254000005,
      "user": 0.35294758000000004,
      "system": 0.23350793999999997,
      "min": 0.25991034654000006,
      "max": 0.40709310654
    },
    {
      "command": "pnpr@main",
      "mean": 0.3386688614400001,
      "stddev": 0.03281641550456063,
      "median": 0.3293244525400001,
      "user": 0.37995528,
      "system": 0.21879774,
      "min": 0.29986011654000005,
      "max": 0.39966200354000003
    }
  ]
}

The engine install ran with the project's config, including its
`nodeVersion`, so the global-virtual-store slot was hashed with that
Node.js major. The cache lookup keys the slot on the `node` on PATH. When
the two majors differ, the lookup never finds the installed engine, and
every command that switches to the pinned pnpm reinstalls it through the
registry, which also fails offline.

Drop `nodeVersion` from the engine config. The engine runs on the host's
Node.js, the env lockfile is already resolved against it, and the
TypeScript CLI's engine install never reads the setting.

Closes #16497
Copilot AI balanced review requested due to automatic review settings October 1, 2026 18:30
@zkochan
zkochan force-pushed the fix/engine-slot-node-version branch from 3683189 to 4ba2968 Compare October 1, 2026 18:30
@qodo-code-review

qodo-code-review Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Findings visible per group, which tucks the rest behind a View link

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 5115ffa ⏭️ Skipped

Results up to commit 4ba2968 ⚖️ Balanced


No changes from previous review

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

🔵 Needs a closer look

The fix is correct and well-tested, but it changes engineStrict/engine-install slot-keying semantics in a subtle way the author flagged as unverified on Linux and Windows, warranting final human review.

Review effort: Balanced
Findings: None

@zkochan

zkochan commented Oct 1, 2026

Copy link
Copy Markdown
Member

Reviewed, rebased onto main, and followed through CI.

  • Rebase: no conflicts. Head is now 4ba2968.
  • Review: nothing to change. compute_engine_slot keys the slot on detect_node_major(). Both install_engine_to_store and install_engine_from_env go through package_manager_engine_config, so after this change the env resolution, the install, and the lookup all use the host's Node.js major.
  • Local: pnpm test:rust -p pnpm-cli -E 'test(/^version::/) | test(/engine_pm::/) | test(/package_manager_check::/) | test(/pre_command/)' ran 203 tests and all passed on Linux.
  • CI: all checks pass. The first Windows run failed in deps-restorer hoist::symlinks::stale::tests::concurrent_hoists_replace_the_same_stale_dependency_link (os error 4390, a junction race). This PR does not touch that crate. The race is tracked in Fix flaky Windows test waits_for_a_junction_another_hoist_is_creating tasks#53, and the failed job passed on rerun.
  • External review on the current head: CodeRabbit approved with no actionable comments. Copilot reported no findings. Qodo reported no issues. No review threads are open.

Nothing remains within scope.


Written by an agent (Claude Code, claude-opus-5-5).

Copilot AI balanced review requested due to automatic review settings October 1, 2026 19:15
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 5115ffa

@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.

@zkochan
zkochan merged commit 9c616cb into pnpm:main Oct 1, 2026
31 of 32 checks passed

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

🔵 Needs a closer look

Although the one-line fix is well-reasoned and tested, it changes behavior in the sensitive engine-bootstrap path with subtle downstream effects (engineStrict now checks the host node, and the engine env lockfile resolves against the host rather than nodeVersion), which warrants human judgment.

Review effort: Balanced
Findings: None

@altaywtf
altaywtf deleted the fix/engine-slot-node-version branch October 2, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review state: automerge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pinned pnpm reinstalls on every command when nodeVersion names another Node.js major

4 participants