Skip to content

fix(install): rewrite the bin shims after extendNodePath changes - #17622

Merged
zkochan merged 1 commit into
mainfrom
fix/record-extend-node-path
Nov 3, 2026
Merged

zkochan merged 1 commit into
mainfrom
fix/record-extend-node-path

Conversation

@zkochan

@zkochan zkochan commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Summary

A repeat pnpm install after an extendNodePath change reports "Already up to date" and leaves the bin shims with the NODE_PATH of the previous setting. This happens in both CLIs, whether the change comes from pnpm-workspace.yaml or PNPM_CONFIG_EXTEND_NODE_PATH. A review on #17315 surfaced it. pnpm/tasks#219 tracks it, and the Config classification test listed extend_node_path as Unseen.

The setting changes neither the lockfile nor .modules.yaml, and the workspace state did not record it:

Fast path sees the change Full install rewrites the shims
v11 before no yes
v12 before no no: the frozen-tree check also short-circuits

Changes:

  • Both CLIs record extendNodePath in the workspace state while it is off, and compare it in the install gate. It is OptionalSettingKey in v11, and its unset equivalent is true, the default. This follows runtime from fix(install): link the runtime after a --no-runtime install #17545.
  • v12's frozen-tree check compares the recorded value beside supportedArchitectures (recorded_extend_node_path_matches).
  • The run gate keeps comparing it, since a script runs the shims the setting shapes.
  • The classification moves extend_node_path from Unseen to Recorded.

An unrecorded value reads as the default. A state written before this change keeps the fast path for anyone on the default. A user with extendNodePath: false gets one full install, which rewrites the shims.

Verification

  • Real binaries, a custom modulesDir, and a registry package with a bin ([email protected] from npm). Before, toggling false to true left the shim without export NODE_PATH in both CLIs, through yaml and through env. After, every toggle runs the full install and the shim follows the setting, and an unchanged repeat install still takes the fast path in both.
  • Mixed CLIs: a v11 install followed by a v12 install, then v11 again, stays on the fast path in both directions, at the default and with extendNodePath: false.
  • New e2e modules_dir::repeat_install_rewrites_registry_bins_when_extend_node_path_changes toggles through yaml and env. It fails without the recording and, separately, without the frozen-tree comparison.
  • v11 checkDepsStatus cases for a changed and an unrecorded-default extendNodePath. Each fails with the key or its unset equivalent removed.
  • pnpm-package-manager + pnpm-workspace-state: 1191 passed. pnpm-cli repeat_install/modules_dir/global_virtual_store/oracle: 294 passed. Oracle + hoist with PNPM_V11_BUNDLE: 251 passed. @pnpm/deps.status and @pnpm/workspace.state jest suites pass. clippy, rustfmt, eslint, and prose lint are clean. Nothing was run on Windows or macOS.

The existing yaml test bins_in_a_custom_modules_dir_are_relinked_when_extend_node_path_changes passed before this change only because its file: dependencies fail the frozen-tree check (has_directory_snapshot). The new test uses a registry dependency.

Squash Commit Body

A repeat install after an extendNodePath change, made in
pnpm-workspace.yaml or through PNPM_CONFIG_EXTEND_NODE_PATH, reported
"Already up to date" and left the bin shims with the NODE_PATH of the
previous setting. The change touches neither the lockfile nor
.modules.yaml, and the workspace state did not record the setting, so
the fast path saw nothing to do. Both CLIs had the gap.

Record extendNodePath in the workspace state while it is off, and
compare it in the install gate. An unrecorded value reads as the
default, so a state written before this change keeps the fast path for
anyone on the default, and each CLI reads the other's state without
seeing a change. v11's full install already rewrites the shims. v12's
frozen-tree check also short-circuited the full install, so it now
compares the recorded value too, beside supportedArchitectures.

The run gate keeps comparing it: a script runs the shims the setting
shapes.

Part of pnpm/tasks#219.

Checklist

  • 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, claude-opus-5-5).

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Repeated installs now refresh executable shims when the extendNodePath setting changes, including when an environment override changes its value.
    • Installs correctly recognize changes to extendNodePath when checking whether the workspace is up to date.

A repeat install after an extendNodePath change, made in
pnpm-workspace.yaml or through PNPM_CONFIG_EXTEND_NODE_PATH, reported
"Already up to date" and left the bin shims with the NODE_PATH of the
previous setting. The change touches neither the lockfile nor
.modules.yaml, and the workspace state did not record the setting, so
the fast path saw nothing to do. Both CLIs had the gap.

Record extendNodePath in the workspace state while it is off, and
compare it in the install gate. An unrecorded value reads as the
default, so a state written before this change keeps the fast path for
anyone on the default, and each CLI reads the other's state without
seeing a change. v11's full install already rewrites the shims. v12's
frozen-tree check also short-circuited the full install, so it now
compares the recorded value too, beside supportedArchitectures.

The run gate keeps comparing it: a script runs the shims the setting
shapes.

Part of pnpm/tasks#219.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The change records extendNodePath in workspace state and includes it in repeat-install drift checks. When the setting changes, the up-to-date check rejects the unchanged-tree result. A CLI test checks the resulting executable shim contents.

Changes: extendNodePath repeat-install handling

Layer / File(s) Summary
Workspace-state contract and defaults
pnpm/crates/workspace-state/src/lib.rs, pnpm11/workspace/state/src/types.ts, pnpm11/workspace/state/src/validation.ts, pnpm11/deps/status/test/checkDepsStatus.test.ts
Workspace state now includes optional extendNodePath. An unset value matches true; tests cover this default and a recorded false value compared with an unset current value.
Install-policy drift and up-to-date check
pnpm/crates/package-manager/src/optimistic_repeat_install/settings/install_policy.rs, pnpm/crates/package-manager/src/optimistic_repeat_install/settings.rs, pnpm/crates/package-manager/src/optimistic_repeat_install.rs, pnpm/crates/package-manager/src/optimistic_repeat_install/tests/settings_classification.rs, pnpm/crates/package-manager/src/install/prepare_modules_state/up_to_date.rs
Install policy records extendNodePath when disabled and detects differences from the current setting. The up-to-date check rejects the unchanged-tree result when the recorded and current values differ.
Repeat-install shim test and release entries
pnpm/crates/cli/tests/suite/modules_dir.rs, .changeset/repeat-install-records-extend-node-path.md
The CLI test checks shim contents after workspace and environment setting changes. The changeset adds patch entries for @pnpm/workspace.state, pacquet, and pnpm.

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant Config
  participant InstallPolicy
  participant WorkspaceState
  participant UpToDateCheck
  participant BinShim
  Config->>InstallPolicy: provide extendNodePath
  InstallPolicy->>WorkspaceState: record false or omit the default true
  UpToDateCheck->>WorkspaceState: compare recorded and current values
  UpToDateCheck-->>Config: reject the up-to-date result when values differ
  Config->>BinShim: install updates the shim contents
Loading

Possibly related PRs

  • pnpm/pnpm#17264: Records other settings that can cause repeat installs to miss configuration drift.
  • pnpm/pnpm#17391: Extends workspace-state recording and repeat-install checks for other settings.
  • pnpm/pnpm#17315: Updates how environment and command-line configuration affect extendNodePath.

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

Suggested reviewers: lazerg, kairosci

Merge Risk: Minimal · up to d1490

Repeat installs now rewrite bin shims when extendNodePath changes, and existing state at the default setting keeps its fast path. No actionable merge-blocking risk remains.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 6dfba21 and d14908f.

Files selected for processing: 11
  • .changeset/repeat-install-records-extend-node-path.md
  • pnpm/crates/cli/tests/suite/modules_dir.rs
  • pnpm/crates/package-manager/src/install/prepare_modules_state/up_to_date.rs
  • pnpm/crates/package-manager/src/optimistic_repeat_install.rs
  • pnpm/crates/package-manager/src/optimistic_repeat_install/settings.rs
  • pnpm/crates/package-manager/src/optimistic_repeat_install/settings/install_policy.rs
  • pnpm/crates/package-manager/src/optimistic_repeat_install/tests/settings_classification.rs
  • pnpm/crates/workspace-state/src/lib.rs
  • pnpm11/deps/status/test/checkDepsStatus.test.ts
  • pnpm11/workspace/state/src/types.ts
  • pnpm11/workspace/state/src/validation.ts

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

@garnet-runtime-review

garnet-runtime-review Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Nothing new recorded

0 of 1 recorded job changed
Garnet records 1 of 19 TS CI jobs
At d14908f, compared with the last 10 recorded runs on main (latest 6dfba21)
Recorded at the kernel (best-effort capture)

TS CI / Test / ubuntu (24.0.0, 2) / Node 24 / chunk 2/3 · nothing new

Workload · 6dfba21 → d14908f

  bash
  ├─ rustup
  │  └─ dualstack.k.sni.global.fastly[.]net
  ├─ MainThread › pn › dash › node › pn › node
  │  ├─ node
  │  │  ├─ git
  │  │  │  ├─ git › git › git-remote-http › git
  │  │  │  │  └─ github[.]com
  │  │  │  └─ 192.168.127[.]1
  │  │  ├─ codeload.github[.]com
  │  │  ├─ github[.]com
  │  │  └─ registry.npmjs[.]org
  │  ├─ pnpr
  │  │  └─ registry.npmjs[.]org
  │  └─ registry.npmjs[.]org
  ├─ gh
  │  └─ api.github[.]com
  └─ node
     ├─ git
     │  ├─ git › git › git-remote-http
     │  │  └─ github[.]com
     │  └─ 192.168.127[.]1
     └─ pn
        ├─ dash › node › pn
        │  ├─ dash › pn › dash › dash › dash › node
        │  │  ├─ codeload.github[.]com
        │  │  └─ registry.npmjs[.]org
        │  └─ node › node
        │     ├─ pacquet
        │     │  └─ registry.npmjs[.]org
        │     ├─ codeload.github[.]com
        │     ├─ github[.]com
        │     └─ registry.npmjs[.]org
        └─ nodejs[.]org

  node › pnpm
  ├─ nodejs[.]org
  └─ unofficial-builds.nodejs[.]org

  MainThread
  ├─ pnpm
  │  ├─ dash › node › dash › node
  │  │  └─ nodejs[.]org
  │  ├─ git
  │  │  ├─ git › git › git-remote-http
  │  │  │  └─ github[.]com
  │  │  └─ 192.168.127[.]1
  │  ├─ dualstack.k.sni.global.fastly[.]net
  │  └─ registry.npmjs[.]org
  ├─ blacksmith.blob.core.windows[.]net
  └─ registry.npmjs[.]org

Runner & GitHub's own traffic · blacksmith-8vcpu-ubuntu-2404 · Linux X64

  MainThread
  └─ productionresultssa31.blob.core[.]windows (github infra)

  node
  └─ productionresultssa16.blob.core[.]windows (github infra)

  systemd
  ├─ bash › blacksmithd
  │  └─ 192.168.127[.]1
  ├─ chronyd
  │  ├─ 104.131.155[.]175
  │  ├─ 107.141.134[.]168
  │  ├─ 169[.]254[.]169[.]123
  │  ├─ 185.125.190[.]56
  │  ├─ 185.125.190[.]57
  │  ├─ 185.125.190[.]58
  │  ├─ 204.2.134[.]162
  │  ├─ 206.210.192[.]99
  │  ├─ 208.70.148[.]101
  │  ├─ 23.157.100[.]123
  │  ├─ 23.168.24[.]210
  │  ├─ 45.83.234[.]123
  │  └─ 91.189.91[.]157
  ├─ nginx › nginx
  │  ├─ 140.82.112[.]21
  │  ├─ 140.82.112[.]22
  │  ├─ 140.82.113[.]21
  │  ├─ 140.82.113[.]22
  │  ├─ 140.82.114[.]21
  │  ├─ 140.82.114[.]22
  │  ├─ 192.168.127[.]1
  │  └─ 8.8.8[.]8
  ├─ snapd
  │  └─ api.snapcraft[.]io
  ├─ sudo
  │  ├─ blacksmithd
  │  │  └─ 192.168.127[.]1
  │  └─ sudo
  │     └─ 192.168.127[.]1
  └─ systemd-resolve
     └─ 8.8.8[.]8

Job log · Full record in Garnet ↗


How to read this
bash › curl                 ← ancestry as captured, then the process that acted
└─ example[.]com            ← what it reached

Read down: what ran, then what it reached. + only in this commit · − only in the compared run · unmarked in both. Runner & GitHub's own traffic is activity outside your steps and never counts. · Docs ↗

Recorded by Garnet · Add it to your CI ↗

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     12.2±0.29ms    30.8 MB/sec    1.14     13.8±0.49ms    27.1 MB/sec
packument/parse                                  1.03     43.3±1.33µs  1533.0 MB/sec    1.00     42.0±0.41µs  1578.7 MB/sec
tarball/download_dependency                      1.27  903.3±135.95µs     4.7 MB/sec    1.00   708.6±43.43µs     6.0 MB/sec
tarball_batch/cold_store_many_medium_tarballs    1.04   215.7±10.22ms 74.2 KElem/sec    1.00    207.1±5.42ms 77.3 KElem/sec
version_pick/repeated_ranges_file                1.00      4.8±0.13ms  6.5 KElem/sec    1.05      5.0±0.15ms  6.2 KElem/sec
version_pick/repeated_ranges_raw                 1.00      4.7±0.08ms  6.6 KElem/sec    1.07      5.1±0.12ms  6.2 KElem/sec
version_pick/wildcard_lowest                     1.00     37.2±0.64µs 26.3 KElem/sec    1.07     39.8±0.89µs 24.5 KElem/sec
workspace_resolution/hoist_heavy                 1.00   245.1±13.20ms        ? ?/sec    1.35   330.1±19.18ms        ? ?/sec
workspace_sort/chained_projects                  1.00     14.4±2.77ms        ? ?/sec    1.80     25.9±2.08ms        ? ?/sec

@github-actions

github-actions Bot commented Nov 3, 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 2565.60 ms 2411.71 ms -6.0% 128.28 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1443.25 ms 1395.56 ms -3.3% 72.16 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 210.92 ms 215.43 ms 2.1% 10.55 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 233.92 ms 235.42 ms 0.6% 11.70 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 10.53 ms 10.88 ms 3.3% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 10.10 ms 10.63 ms 5.3% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 11.10 ms 11.49 ms 3.6% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 10.47 ms 12.02 ms 14.8% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2609.11 ms 2660.58 ms 2.0% 130.46 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1591.89 ms 1601.70 ms 0.6% 79.59 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 535.80 ms 563.75 ms 5.2% 26.79 ms Inconclusive (overlapping samples)
isolated-fresh-install-hot-cache-hot-store pnpr 328.50 ms 316.25 ms -3.7% 16.43 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 2191.05 ms 2142.78 ms -2.2% 109.55 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 487.21 ms 488.53 ms 0.3% 24.36 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 370.47 ms 347.88 ms -6.1% 18.52 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 121.84 ms 126.78 ms 4.1% 6.09 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 345.73 ms 335.14 ms -3.1% 17.29 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 98.43 ms 88.65 ms -9.9% 4.92 ms Within tolerance
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet 98.13 ms 105.58 ms 7.6% 4.91 ms Inconclusive (overlapping samples)
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4389.82 ms 4453.72 ms 1.5% 219.49 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3613.59 ms 3504.86 ms -3.0% 180.68 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 256.88 ms 263.34 ms 2.5% 12.84 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 250.70 ms 270.34 ms 7.8% 12.53 ms Inconclusive (overlapping samples)
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet 1365.74 ms 1481.06 ms 8.4% 68.29 ms Inconclusive (overlapping samples)
cargo-repeat-install-hot-cache-hot-store pacquet 36.31 ms 34.64 ms -4.6% 2.00 ms Within tolerance

Same-run syscall check

Each install runs 2 more times per revision, untimed, under strace --follow-forks --summary-only. A file syscall regresses when HEAD's fewest calls exceed main's most by more than 2% of main or 50 calls, whichever is larger. mkdir and mkdirat count only the calls that created a directory, since concurrent installs fail a varying number with EEXIST. A syscall whose identical runs differ by more than that tolerance is reported unstable and not gated, unless HEAD's fewest calls also exceed main's most by more than the tolerance plus that difference. Each scenario lists its largest change relative to its tolerance and every row that is not within tolerance.

Scenario Engine Syscall main calls (max) HEAD calls (min) Change Tolerance Identical-run spread Result
isolated-fresh-restore-cold-cache-cold-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr readlink 15308 15324 +0.1% 306 52 Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet readlink 15302 15313 +0.1% 306 43 Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr access 11 11 +0.0% 50 0 Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr access 8 8 +0.0% 50 0 Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr access 8 8 +0.0% 50 0 Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet readlink 16641 16278 -2.2% 332 400 Unstable (identical runs differ by 400, not gated)
isolated-fresh-install-cold-cache-cold-store pnpr access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet readlink 15599 15631 +0.2% 311 76 Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet statx 1740 1742 +0.1% 50 2 Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr access 8 8 +0.0% 50 0 Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr access 11 11 +0.0% 50 0 Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr access 11 11 +0.0% 50 0 Within tolerance
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet access 8 8 +0.0% 50 0 Within tolerance
cargo-repeat-install-hot-cache-hot-store pacquet access 22 22 +0.0% 50 0 Within tolerance

Integrated-Benchmark Report (Linux)

Commit: d14908f257ba

Compared against main at: 6dfba2131038

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked, injected, and Cargo workspace scenarios compare 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.452 ± 0.155 2.294 2.765 1.73 ± 0.15
pacquet@main 2.578 ± 0.140 2.307 2.760 1.82 ± 0.15
pnpr@HEAD 1.468 ± 0.148 1.305 1.723 1.04 ± 0.12
pnpr@main 1.417 ± 0.086 1.300 1.516 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.45196845248,
      "stddev": 0.15476307004308534,
      "median": 2.4117074498799997,
      "user": 2.3269051999999997,
      "system": 1.78936336,
      "min": 2.29399942438,
      "max": 2.76540749638
    },
    {
      "command": "pacquet@main",
      "mean": 2.5779854233800004,
      "stddev": 0.13992662610290071,
      "median": 2.5656043338799996,
      "user": 2.6751464999999994,
      "system": 2.09827166,
      "min": 2.30657341038,
      "max": 2.75997145738
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.46753140758,
      "stddev": 0.1481835428122521,
      "median": 1.39556298738,
      "user": 2.0490428,
      "system": 1.6483295599999999,
      "min": 1.30464584538,
      "max": 1.7233431623800002
    },
    {
      "command": "pnpr@main",
      "mean": 1.41661640838,
      "stddev": 0.08589426465209585,
      "median": 1.44325016538,
      "user": 1.8632310000000003,
      "system": 1.44140776,
      "min": 1.29975877438,
      "max": 1.51573617238
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 218.9 ± 9.8 209.8 242.8 1.04 ± 0.07
pacquet@main 210.7 ± 10.1 201.4 235.0 1.00
pnpr@HEAD 239.0 ± 15.5 221.0 266.9 1.13 ± 0.09
pnpr@main 232.9 ± 11.1 217.4 252.5 1.11 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2188553781,
      "stddev": 0.009766252468038415,
      "median": 0.2154346625,
      "user": 0.24687528000000003,
      "system": 0.5537992999999999,
      "min": 0.20981659800000002,
      "max": 0.242768079
    },
    {
      "command": "pacquet@main",
      "mean": 0.21072461159999997,
      "stddev": 0.010147295392990396,
      "median": 0.21092102100000001,
      "user": 0.25604338000000004,
      "system": 0.5303781999999998,
      "min": 0.201405315,
      "max": 0.23501064600000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.2389859895,
      "stddev": 0.015469924084773544,
      "median": 0.23541624249999998,
      "user": 0.26441098,
      "system": 0.5555594,
      "min": 0.220955176,
      "max": 0.266901427
    },
    {
      "command": "pnpr@main",
      "mean": 0.23286362720000003,
      "stddev": 0.011080788169912375,
      "median": 0.23392139950000002,
      "user": 0.24698688,
      "system": 0.5650476,
      "min": 0.217442629,
      "max": 0.252457242
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 10.9 ± 0.9 9.2 13.4 1.05 ± 0.13
pacquet@main 10.8 ± 1.4 9.4 27.3 1.04 ± 0.16
pnpr@HEAD 10.7 ± 1.1 9.0 14.7 1.03 ± 0.14
pnpr@main 10.4 ± 0.9 9.0 13.0 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.010949937292000006,
      "stddev": 0.0009469867352826925,
      "median": 0.01087552798,
      "user": 0.006779675999999999,
      "system": 0.0051474672800000025,
      "min": 0.009205870980000001,
      "max": 0.01344862498
    },
    {
      "command": "pacquet@main",
      "mean": 0.010802765854015742,
      "stddev": 0.0014047079051879134,
      "median": 0.01052676198,
      "user": 0.00654658771653543,
      "system": 0.005183991811023623,
      "min": 0.009405950980000001,
      "max": 0.027257727980000004
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.010736749504344575,
      "stddev": 0.0011225639071436172,
      "median": 0.01063112198,
      "user": 0.006266505393258424,
      "system": 0.005415078951310861,
      "min": 0.00901516098,
      "max": 0.01470780598
    },
    {
      "command": "pnpr@main",
      "mean": 0.010408345028951053,
      "stddev": 0.0008513791654921294,
      "median": 0.01009766198,
      "user": 0.006354309510489514,
      "system": 0.004970806503496506,
      "min": 0.008968390980000001,
      "max": 0.01301955498
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 11.6 ± 1.0 9.9 15.1 1.09 ± 0.13
pacquet@main 11.2 ± 1.0 9.3 13.8 1.06 ± 0.13
pnpr@HEAD 12.3 ± 1.6 9.6 18.1 1.16 ± 0.18
pnpr@main 10.6 ± 0.9 9.1 13.6 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.011575067958031081,
      "stddev": 0.0010434821818632715,
      "median": 0.0114921853,
      "user": 0.006691156165803109,
      "system": 0.005887109222797933,
      "min": 0.0098512133,
      "max": 0.015117820300000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.011181091385585588,
      "stddev": 0.0010464011742481632,
      "median": 0.0110950303,
      "user": 0.006946534054054051,
      "system": 0.005292713873873872,
      "min": 0.009318922299999999,
      "max": 0.0138098693
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.012317367785576917,
      "stddev": 0.0016479185640452232,
      "median": 0.0120190033,
      "user": 0.0074877203846153845,
      "system": 0.005983645000000004,
      "min": 0.0096459363,
      "max": 0.0181383113
    },
    {
      "command": "pnpr@main",
      "mean": 0.010594396934259268,
      "stddev": 0.0008644512635050568,
      "median": 0.0104707833,
      "user": 0.006054618888888891,
      "system": 0.005508312962962963,
      "min": 0.0091312643,
      "max": 0.0136276983
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.651 ± 0.045 2.570 2.732 1.67 ± 0.12
pacquet@main 2.635 ± 0.071 2.563 2.760 1.66 ± 0.13
pnpr@HEAD 1.621 ± 0.107 1.461 1.771 1.02 ± 0.10
pnpr@main 1.584 ± 0.111 1.430 1.750 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.65092463674,
      "stddev": 0.04480444723734527,
      "median": 2.6605751524400003,
      "user": 2.8313658199999994,
      "system": 1.7327409599999999,
      "min": 2.5698705524400003,
      "max": 2.7322781494400004
    },
    {
      "command": "pacquet@main",
      "mean": 2.63509589164,
      "stddev": 0.07124880709805763,
      "median": 2.60911334444,
      "user": 2.7749611199999995,
      "system": 1.7372578599999997,
      "min": 2.5629280484400003,
      "max": 2.76003448644
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6213116059400001,
      "stddev": 0.10676027806319738,
      "median": 1.6017041554400002,
      "user": 2.28767832,
      "system": 1.7181070600000001,
      "min": 1.46073018244,
      "max": 1.77124210844
    },
    {
      "command": "pnpr@main",
      "mean": 1.5837198363400002,
      "stddev": 0.11111036220510347,
      "median": 1.59188800094,
      "user": 2.1819028199999995,
      "system": 1.6187126599999995,
      "min": 1.42983741944,
      "max": 1.75020897944
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 559.6 ± 32.0 513.2 617.3 1.74 ± 0.13
pacquet@main 535.0 ± 27.5 504.4 592.6 1.66 ± 0.11
pnpr@HEAD 322.0 ± 14.5 309.1 354.7 1.00
pnpr@main 333.3 ± 23.7 301.7 386.0 1.04 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.55960306724,
      "stddev": 0.03197209816039043,
      "median": 0.5637524622400001,
      "user": 0.8306505,
      "system": 1.24382618,
      "min": 0.51323271224,
      "max": 0.61725222124
    },
    {
      "command": "pacquet@main",
      "mean": 0.5350416169400001,
      "stddev": 0.02753629914256135,
      "median": 0.53580229174,
      "user": 0.7789516,
      "system": 1.1745193799999998,
      "min": 0.5044165162400001,
      "max": 0.5926131962400001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.32197023634000005,
      "stddev": 0.014481434466226848,
      "median": 0.31624864274000003,
      "user": 0.29341239999999996,
      "system": 0.62354028,
      "min": 0.30905119124,
      "max": 0.35469582224
    },
    {
      "command": "pnpr@main",
      "mean": 0.33333121524000003,
      "stddev": 0.023662060882192373,
      "median": 0.32850070124,
      "user": 0.31685369999999996,
      "system": 0.6494109800000001,
      "min": 0.30172466624000005,
      "max": 0.38596503524000003
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.141 ± 0.095 1.979 2.295 4.43 ± 0.38
pacquet@main 2.226 ± 0.105 2.116 2.402 4.61 ± 0.40
pnpr@HEAD 0.500 ± 0.042 0.440 0.581 1.03 ± 0.12
pnpr@main 0.483 ± 0.035 0.416 0.542 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.14112061928,
      "stddev": 0.09466720831637843,
      "median": 2.14278256348,
      "user": 1.77159954,
      "system": 1.4769371599999999,
      "min": 1.9791505629800001,
      "max": 2.29513613798
    },
    {
      "command": "pacquet@main",
      "mean": 2.2263693358800003,
      "stddev": 0.10480616786237591,
      "median": 2.19104850048,
      "user": 1.8566133400000002,
      "system": 1.5257828599999996,
      "min": 2.1162108549800003,
      "max": 2.40177045898
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.5000149159800001,
      "stddev": 0.04216901968407856,
      "median": 0.48852608598,
      "user": 0.48137104,
      "system": 0.9018511599999999,
      "min": 0.44015925598,
      "max": 0.58143093498
    },
    {
      "command": "pnpr@main",
      "mean": 0.48334139018,
      "stddev": 0.03543629315142818,
      "median": 0.48721286798,
      "user": 0.47484323999999994,
      "system": 0.85022826,
      "min": 0.41556140998,
      "max": 0.54194131098
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 349.3 ± 16.4 325.3 376.2 2.87 ± 0.25
pacquet@main 371.0 ± 22.0 323.0 402.0 3.05 ± 0.28
pnpr@HEAD 126.6 ± 6.5 115.2 139.8 1.04 ± 0.09
pnpr@main 121.7 ± 8.7 107.4 137.8 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.34927857106,
      "stddev": 0.016418298075335035,
      "median": 0.34787824646000004,
      "user": 0.40036584,
      "system": 0.23988705999999999,
      "min": 0.32525747896,
      "max": 0.37622060596
    },
    {
      "command": "pacquet@main",
      "mean": 0.37096839316,
      "stddev": 0.022043506336899922,
      "median": 0.37046733496000006,
      "user": 0.40729234000000003,
      "system": 0.25489185999999997,
      "min": 0.32296297896000004,
      "max": 0.40195279496
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.12658396268727276,
      "stddev": 0.006483019229912759,
      "median": 0.12678007646,
      "user": 0.06367271272727273,
      "system": 0.028347284545454546,
      "min": 0.11524936996000001,
      "max": 0.13983254896000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.12170126761000004,
      "stddev": 0.008707155102888374,
      "median": 0.12184105846000001,
      "user": 0.05152544000000001,
      "system": 0.03604950999999999,
      "min": 0.10741284596000002,
      "max": 0.13781397596
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 338.0 ± 26.6 304.9 389.9 1.04 ± 0.15
pacquet@main 324.8 ± 39.7 267.9 376.2 1.00
pnpm@HEAD 5730.8 ± 432.0 5004.8 6451.5 17.64 ± 2.53
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.33800318856000006,
      "stddev": 0.026597249559995054,
      "median": 0.33513794656000007,
      "user": 0.3797724733333333,
      "system": 0.06847642444444445,
      "min": 0.30491668656000004,
      "max": 0.3898795855600001
    },
    {
      "command": "pacquet@main",
      "mean": 0.32483393167111113,
      "stddev": 0.0397095406141975,
      "median": 0.34573316056000003,
      "user": 0.3702018066666667,
      "system": 0.058356202222222216,
      "min": 0.26788052356000003,
      "max": 0.37617208956000003
    },
    {
      "command": "pnpm@HEAD",
      "mean": 5.730813847226667,
      "stddev": 0.43203469595275984,
      "median": 5.65795275956,
      "user": 8.88020425111111,
      "system": 0.5285877577777778,
      "min": 5.00479767656,
      "max": 6.45152084256
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 92.4 ± 8.3 83.3 116.8 1.00
pacquet@main 98.4 ± 7.6 87.2 113.6 1.06 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.09244661162814817,
      "stddev": 0.008307122378035554,
      "median": 0.08864747748,
      "user": 0.0850445837037037,
      "system": 0.04835861037037036,
      "min": 0.08334965948,
      "max": 0.11680841048000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.09835879123757575,
      "stddev": 0.007649965018726706,
      "median": 0.09842890448000001,
      "user": 0.0899530618181818,
      "system": 0.053700724848484864,
      "min": 0.08717839748,
      "max": 0.11361600048
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 105.1 ± 6.2 92.4 114.9 1.04 ± 0.10
pacquet@main 100.8 ± 8.2 90.4 120.9 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.10508155497857145,
      "stddev": 0.006154944079566503,
      "median": 0.1055771748,
      "user": 0.03796210285714285,
      "system": 0.07547324571428571,
      "min": 0.0924482633,
      "max": 0.1149471883
    },
    {
      "command": "pacquet@main",
      "mean": 0.10077181846129032,
      "stddev": 0.008235955598331075,
      "median": 0.0981285523,
      "user": 0.03935447612903226,
      "system": 0.0693095729032258,
      "min": 0.0903796543,
      "max": 0.1208539763
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.495 ± 0.119 4.371 4.791 1.27 ± 0.04
pacquet@main 4.398 ± 0.052 4.345 4.528 1.25 ± 0.03
pnpr@HEAD 3.527 ± 0.073 3.443 3.670 1.00
pnpr@main 3.594 ± 0.130 3.430 3.795 1.02 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.49519933048,
      "stddev": 0.11926585347093904,
      "median": 4.45372482878,
      "user": 2.0038612000000002,
      "system": 1.65243618,
      "min": 4.37134874028,
      "max": 4.7911236952800005
    },
    {
      "command": "pacquet@main",
      "mean": 4.39795756658,
      "stddev": 0.05229073473289926,
      "median": 4.38982123328,
      "user": 1.994437,
      "system": 1.64304308,
      "min": 4.34523342828,
      "max": 4.527831278280001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.52720788298,
      "stddev": 0.07349172628946707,
      "median": 3.50485999628,
      "user": 1.9111532999999998,
      "system": 1.61159538,
      "min": 3.4433635202799997,
      "max": 3.6700020952799997
    },
    {
      "command": "pnpr@main",
      "mean": 3.59406371488,
      "stddev": 0.12975132392217748,
      "median": 3.61359413378,
      "user": 1.8689553000000003,
      "system": 1.55591918,
      "min": 3.43002963528,
      "max": 3.79542904128
    }
  ]
}

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 260.7 ± 20.5 233.1 285.5 1.04 ± 0.11
pacquet@main 262.4 ± 24.2 243.7 328.0 1.04 ± 0.12
pnpr@HEAD 268.0 ± 15.3 245.2 289.4 1.07 ± 0.10
pnpr@main 251.1 ± 17.7 227.2 278.6 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.26070856236,
      "stddev": 0.020519948576765982,
      "median": 0.26334007516,
      "user": 0.3413468,
      "system": 0.26339855999999995,
      "min": 0.23310166016,
      "max": 0.28547021016
    },
    {
      "command": "pacquet@main",
      "mean": 0.26237645626000006,
      "stddev": 0.02422444984738487,
      "median": 0.25687802766,
      "user": 0.3357585,
      "system": 0.26664225999999996,
      "min": 0.24373358216000002,
      "max": 0.32798070916
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.26802071346,
      "stddev": 0.01529902169702992,
      "median": 0.27034172416,
      "user": 0.3291237,
      "system": 0.26177286000000005,
      "min": 0.24515465816,
      "max": 0.28935232716000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.25113803134181817,
      "stddev": 0.017733764815197672,
      "median": 0.25069636316,
      "user": 0.3206950454545454,
      "system": 0.25285633272727265,
      "min": 0.22718988016000002,
      "max": 0.27860693916
    }
  ]
}

Scenario: Store only: unlocked direct deps, cold cache + hot store

Store-only install (enableModulesDir: false, per-file store index, trusted lockfile) against a lockfile missing the direct dependencies that have peers, with the metadata cache wiped per iteration: the install resolves those from the registry, reuses their subtrees from the lockfile and checks the store, linking nothing. Direct installs only.

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.467 ± 0.108 1.306 1.606 1.07 ± 0.09
pacquet@main 1.366 ± 0.051 1.296 1.452 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.4674702066600003,
      "stddev": 0.10768190540540021,
      "median": 1.48105971106,
      "user": 0.9116912599999999,
      "system": 0.40819428,
      "min": 1.30557304156,
      "max": 1.60570266056
    },
    {
      "command": "pacquet@main",
      "mean": 1.36587831686,
      "stddev": 0.05067507587028109,
      "median": 1.36573863706,
      "user": 0.8163654599999999,
      "system": 0.34989817999999995,
      "min": 1.29573596056,
      "max": 1.45191861156
    }
  ]
}

Scenario: Cargo: repeat install, hot cache + hot store

Frozen repeat install of a Cargo workspace (cargo.enabled: true) whose crates are already materialized in <storeDir>/v11/crates/ and linked into .pnpm/crates/crates-io. Direct installs only.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 35.6 ± 4.1 29.4 51.5 1.00
pacquet@main 37.0 ± 4.3 30.3 48.3 1.04 ± 0.17
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.035622874419393935,
      "stddev": 0.0041157030327735045,
      "median": 0.03464032198,
      "user": 0.025418098787878783,
      "system": 0.02141564848484849,
      "min": 0.029433810980000003,
      "max": 0.05145244198
    },
    {
      "command": "pacquet@main",
      "mean": 0.036984335191267606,
      "stddev": 0.004266015566059849,
      "median": 0.03630632198,
      "user": 0.027206783380281683,
      "system": 0.021528335211267603,
      "min": 0.030330011980000002,
      "max": 0.04825919198
    }
  ]
}

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.78%. Comparing base (6dfba21) to head (d14908f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17622   +/-   ##
=======================================
  Coverage   92.78%   92.78%           
=======================================
  Files        2062     2062           
  Lines      266025   266041   +16     
=======================================
+ Hits       246823   246850   +27     
+ Misses      19202    19191   -11     

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

@zkochan
zkochan marked this pull request as ready for review November 3, 2026 17:41
Copilot AI balanced review requested due to automatic review settings November 3, 2026 17:41

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

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 was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Rewrite bin shims when extendNodePath changes

🐞 Bug fix 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Record extendNodePath so repeat installs detect bin shims made under a different setting.
• Prevent v12’s frozen-tree shortcut from retaining stale shims; preserve fast paths for unchanged
 defaults.
• Test setting changes through workspace YAML and environment overrides.
Diagram

graph TD
  Config["extendNodePath config"] --> State["Workspace state"] --> Repeat{"Repeat gate"} --> Frozen{"Frozen-tree gate"} --> Install["Full install"] --> Shims["Bin shims"]
  Repeat --> Fast["Fast path"]
  Frozen --> Fast
  Repeat --> Install
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Regenerate bin shims on every repeat install
  • ➕ Avoids a new recorded setting and cross-CLI state handling.
  • ➖ Adds unnecessary filesystem work to otherwise unchanged installs.
  • ➖ Does not express why an existing tree is stale.
2. Record the setting in .modules.yaml
  • ➕ Keeps shim-related information alongside the installed modules layout.
  • ➖ Requires both CLIs to change a separate persistence format and its consistency checks.
  • ➖ Does not reuse the existing workspace-state setting comparison.

Recommendation: Keep the PR’s workspace-state approach. It detects precisely when shims need rewriting, preserves the default fast path for older states, and lets both CLIs compare the same setting.

Files changed (11) +97 / -10

Bug fix (7) +39 / -9
up_to_date.rsInvalidate the frozen-tree shortcut for stale shims +7/-3

Invalidate the frozen-tree shortcut for stale shims

• Makes v12’s frozen-tree check compare recorded and current 'extendNodePath' values before declaring an install up to date.

pnpm/crates/package-manager/src/install/prepare_modules_state/up_to_date.rs

optimistic_repeat_install.rsExpose the recorded-setting comparison to install checks +3/-2

Expose the recorded-setting comparison to install checks

• Re-exports the 'extendNodePath' comparison helper for the frozen-tree check.

pnpm/crates/package-manager/src/optimistic_repeat_install.rs

settings.rsExpose the install-policy comparison helper +1/-0

Expose the install-policy comparison helper

• Re-exports the new recorded 'extendNodePath' comparison from the install-policy settings module.

pnpm/crates/package-manager/src/optimistic_repeat_install/settings.rs

install_policy.rsRecord and compare extendNodePath in v12 +20/-3

Record and compare extendNodePath in v12

• Records 'extendNodePath' only when false and treats an absent value as the true default. Adds drift detection for the repeat-install gate and a comparison for the frozen-tree gate.

pnpm/crates/package-manager/src/optimistic_repeat_install/settings/install_policy.rs

lib.rsAdd extendNodePath to persisted workspace settings +4/-0

Add extendNodePath to persisted workspace settings

• Adds an optional, backward-compatible 'extend_node_path' field to the Rust workspace-state settings format.

pnpm/crates/workspace-state/src/lib.rs

types.tsInclude extendNodePath in v11 workspace settings +3/-1

Include extendNodePath in v11 workspace settings

• Adds 'extendNodePath' to the settings checked against workspace state and marks it optional for previously written states.

pnpm11/workspace/state/src/types.ts

validation.tsNormalize an absent extendNodePath to its default +1/-0

Normalize an absent extendNodePath to its default

• Treats an unrecorded 'extendNodePath' as true when v11 compares workspace settings, avoiding unnecessary installs for older states at the default.

pnpm11/workspace/state/src/validation.ts

Tests (3) +51 / -1
modules_dir.rsTest bin-shim rewrites across setting changes +48/-0

Test bin-shim rewrites across setting changes

• Adds a registry-bin installation test in a custom modules directory. It checks shim contents after toggling 'extendNodePath' through workspace YAML and environment overrides.

pnpm/crates/cli/tests/suite/modules_dir.rs

settings_classification.rsClassify extendNodePath as a recorded install setting +1/-1

Classify extendNodePath as a recorded install setting

• Changes the classification test from 'Unseen' to 'Recorded', with a config toggle for verifying detection.

pnpm/crates/package-manager/src/optimistic_repeat_install/tests/settings_classification.rs

checkDepsStatus.test.tsTest v11 setting drift and legacy defaults +2/-0

Test v11 setting drift and legacy defaults

• Adds cases confirming that v11 detects a changed 'extendNodePath' value and treats an unrecorded value as the true default.

pnpm11/deps/status/test/checkDepsStatus.test.ts

Documentation (1) +7 / -0
repeat-install-records-extend-node-path.mdDocument the bin-shim fix for affected packages +7/-0

Document the bin-shim fix for affected packages

• Adds patch changesets for '@pnpm/workspace.state', 'pacquet', and 'pnpm', describing the corrected repeat-install behavior.

.changeset/repeat-install-records-extend-node-path.md

@qodo-code-review

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 tweak Display settings with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Auto-approved notes - no code review findings
- 'auto_approve_for_no_suggestions' flag enabled

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.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Nov 3, 2026
@zkochan
zkochan merged commit 2315dce into main Nov 3, 2026
76 checks passed
@zkochan
zkochan deleted the fix/record-extend-node-path branch November 3, 2026 17:49
zkochan pushed a commit to kairosci/pnpm that referenced this pull request Nov 3, 2026
pnpm#17622 records extendNodePath in the workspace state. Add a
v11 e2e test that flips PNPM_CONFIG_EXTEND_NODE_PATH between installs
and checks that the command shim loads a plugin from a custom modules
directory only while the setting is on.

Related to pnpm/tasks#219.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
zkochan added a commit that referenced this pull request Nov 3, 2026
…ll (#17623)

#17622 records extendNodePath in the workspace state. Add a v11
e2e test that flips PNPM_CONFIG_EXTEND_NODE_PATH between repeat installs
of a registry package with a bin, and checks that the shim sets NODE_PATH
only while the setting is on.

The test fails on a bundle with extendNodePath removed from the recorded
workspace-state settings.

Related to pnpm/tasks#219.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Zoltan Kochan <[email protected]>
Jwcjwc12 added a commit to duct-tape-and-markdown/flume that referenced this pull request Nov 28, 2026
pnpm shim: landed, but conditional. Re-probed before ruling: this
checkout's own .bin/vitest exports no NODE_PATH, while every provisioned
worktree's does, both on pnpm 10.26. pnpm documents extend-node-path
(default true) as what writes it, and a shim keeps its form across a repeat
install (pnpm/pnpm#17622). So the page states the condition, which is also
why the vacuous case looked lane-dependent. The structural-arming remedy
holds either way.

node -e: states the condition (option parsing ends at the first non-option
positional), re-measured on node 22.21. The unconditional remedy produced a
phantom entry. Rejected: keeping -- as a convention, which leaves an inert
-- reading as load-bearing.

tsImport: split the re-transform (every call, both manifests) from the
re-evaluation (ESM only). Rejected: keeping it at the one src/ site, which
leaves the page wrong for the next reader.

The comment shrinks the rulings leave are build's, filed as one inbox
record.

Edited by the interactive session under John's direction (2026-11-27:
rule the parked questions and land the edits, following the temper session).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019hAZHGzu9zRhZDtvqvZJk8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet product: pnpm@11 reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants