Repository navigation
fix(install): rewrite the bin shims after extendNodePath changes - #17622
Conversation
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]>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Nothing new recorded
TS CI / Test / ubuntu (24.0.0, 2) / Node 24 / chunk 2/3 · nothing new
How to read thisbash › curl ← ancestry as captured, then the process that acted └─ example[.]com ← what it reached Recorded by Garnet · Add it to your CI ↗ |
Micro-Benchmark ResultsLinux |
Same-run regression checkHEAD 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.
Same-run syscall checkEach install runs 2 more times per revision, untimed, under
Integrated-Benchmark Report (Linux)Commit: Compared against main at: 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
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
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
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
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
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
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
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
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
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
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
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
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 storeSame 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.
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 storeStore-only install (
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 storeFrozen repeat install of a Cargo workspace (
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
PR Summary by QodoRewrite bin shims when extendNodePath changes
AI Description
Diagram
High-Level Assessment
Files changed (11)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
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]>
…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]>
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
Summary
A repeat
pnpm installafter anextendNodePathchange reports "Already up to date" and leaves the bin shims with theNODE_PATHof the previous setting. This happens in both CLIs, whether the change comes frompnpm-workspace.yamlorPNPM_CONFIG_EXTEND_NODE_PATH. A review on #17315 surfaced it. pnpm/tasks#219 tracks it, and the Config classification test listedextend_node_pathasUnseen.The setting changes neither the lockfile nor
.modules.yaml, and the workspace state did not record it:Changes:
extendNodePathin the workspace state while it is off, and compare it in the install gate. It isOptionalSettingKeyin v11, and its unset equivalent istrue, the default. This followsruntimefrom fix(install): link the runtime after a --no-runtime install #17545.supportedArchitectures(recorded_extend_node_path_matches).extend_node_pathfromUnseentoRecorded.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: falsegets one full install, which rewrites the shims.Verification
modulesDir, and a registry package with a bin ([email protected]from npm). Before, togglingfalsetotrueleft the shim withoutexport NODE_PATHin 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.extendNodePath: false.modules_dir::repeat_install_rewrites_registry_bins_when_extend_node_path_changestoggles through yaml and env. It fails without the recording and, separately, without the frozen-tree comparison.checkDepsStatuscases for a changed and an unrecorded-defaultextendNodePath. Each fails with the key or its unset equivalent removed.pnpm-package-manager+pnpm-workspace-state: 1191 passed.pnpm-clirepeat_install/modules_dir/global_virtual_store/oracle: 294 passed. Oracle + hoist withPNPM_V11_BUNDLE: 251 passed.@pnpm/deps.statusand@pnpm/workspace.statejest 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_changespassed before this change only because itsfile:dependencies fail the frozen-tree check (has_directory_snapshot). The new test uses a registry dependency.Squash Commit Body
Checklist
are implemented in every affected version.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-opus-5-5).
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit
extendNodePathsetting changes, including when an environment override changes its value.extendNodePathwhen checking whether the workspace is up to date.