Repository navigation
fix(setup): remove leftover v10-layout shims so self-update stops re-warning - #13140
Conversation
…warning pnpm setup migrated PATH to $PNPM_HOME/bin but left the v10 shims (pnpm/pn/pnpx/pnx and .cmd/.ps1 siblings) at the top of PNPM_HOME. self-update's v10-layout detector keyed off file existence alone, so the warning fired on every self-update — even on dangling shims whose install target had been garbage-collected. Cleanup: setup unlinks the v10 shim names after PATH migration succeeds (TS CLI + pacquet). Hardening: hasLegacyHomeDirShim skips a shim whose cmd-shim-target marker points at a missing path (TS only; pacquet has no v10-detection branch yet — note in changeset). Closes pnpm#12496.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesLegacy shim cleanup and detection
Estimated code review effort: 3 (Moderate) | ~20 minutes Assessment against linked issues
Sequence Diagram(s)sequenceDiagram
participant User
participant setup_handler
participant PNPM_HOME
participant selfUpdate_handler
User->>setup_handler: run setup
setup_handler->>PNPM_HOME: migrate PATH and remove legacy shims
User->>selfUpdate_handler: run self-update
selfUpdate_handler->>PNPM_HOME: inspect legacy shim target
PNPM_HOME-->>selfUpdate_handler: active or dangling target
selfUpdate_handler-->>User: continue without false legacy-layout warning
Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13140 +/- ##
========================================
Coverage 85.65% 85.66%
========================================
Files 505 505
Lines 83565 83720 +155
========================================
+ Hits 71580 71717 +137
- Misses 11985 12003 +18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.4435627886800004,
"stddev": 0.13496556588816375,
"median": 2.39366418748,
"user": 1.4881593599999998,
"system": 1.2366663,
"min": 2.3301299349800004,
"max": 2.7558966279800003,
"times": [
2.4216307189800004,
2.36569765598,
2.55513536598,
2.7558966279800003,
2.5026700549800003,
2.33424752198,
2.4722042349800004,
2.3351447439800004,
2.3301299349800004,
2.36287102698
]
},
{
"command": "pacquet@main",
"mean": 2.4816294795800005,
"stddev": 0.1539082227694789,
"median": 2.42734622798,
"user": 1.5081439600000002,
"system": 1.2465327,
"min": 2.34354442898,
"max": 2.76250281698,
"times": [
2.76250281698,
2.55531663598,
2.37079629898,
2.7050562509800002,
2.3598818979800003,
2.34354442898,
2.35570909698,
2.5216959819800002,
2.48389615698,
2.3578952299800005
]
},
{
"command": "pnpr@HEAD",
"mean": 1.46067369288,
"stddev": 0.13806814406836143,
"median": 1.37844176698,
"user": 1.0473896600000001,
"system": 1.1028663,
"min": 1.33132321698,
"max": 1.64676874098,
"times": [
1.35037959998,
1.35093624398,
1.33132321698,
1.64676874098,
1.34797727998,
1.34646228798,
1.58267880298,
1.63292419598,
1.61133926998,
1.40594728998
]
},
{
"command": "pnpr@main",
"mean": 1.55088388348,
"stddev": 0.14464708286638012,
"median": 1.50874535198,
"user": 1.03991486,
"system": 1.1041351000000001,
"min": 1.37927172798,
"max": 1.78431856498,
"times": [
1.45895058298,
1.46560695098,
1.78431856498,
1.40492779798,
1.7826502639800001,
1.37927172798,
1.53507722998,
1.4824134739800001,
1.57464234198,
1.64097989998
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25027581896,
"stddev": 0.0053007386228003375,
"median": 0.24923084066,
"user": 0.192318,
"system": 0.5278281,
"min": 0.24281993966,
"max": 0.25977116566,
"times": [
0.25977116566,
0.25219305766000005,
0.25325855766000005,
0.24493352766,
0.24792134766,
0.25025867566000004,
0.24820300566,
0.24659444666000002,
0.24281993966,
0.25680446566000004
]
},
{
"command": "pacquet@main",
"mean": 0.24454590966000006,
"stddev": 0.01084907623638518,
"median": 0.24902188966,
"user": 0.2027628,
"system": 0.5080446,
"min": 0.22462480866,
"max": 0.25463636566000003,
"times": [
0.25005216866,
0.25463636566000003,
0.24646097566000003,
0.24212996566,
0.24913896466000002,
0.25393510866,
0.24890481466,
0.25006066366,
0.22551526066000002,
0.22462480866
]
},
{
"command": "pnpr@HEAD",
"mean": 0.26230677416,
"stddev": 0.005781213346467913,
"median": 0.26231119466,
"user": 0.1999743,
"system": 0.5339712999999999,
"min": 0.25470619666000005,
"max": 0.27179162366000004,
"times": [
0.25756983366,
0.25625573466000007,
0.26603558666000005,
0.26078799466,
0.27179162366000004,
0.25470619666000005,
0.26383439466,
0.25813562566000003,
0.26428441866,
0.26966633266000006
]
},
{
"command": "pnpr@main",
"mean": 0.25944016016000004,
"stddev": 0.006572019666336615,
"median": 0.25552016416,
"user": 0.21419479999999996,
"system": 0.5294831999999999,
"min": 0.25440001166000004,
"max": 0.27314615766000006,
"times": [
0.27314615766000006,
0.25551225966,
0.25440001166000004,
0.25490727366000004,
0.25493351266000003,
0.26816018566000005,
0.26249599166000004,
0.25519389166000006,
0.26012424866000006,
0.25552806866000005
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.6706211369600004,
"stddev": 0.01803069848576222,
"median": 2.66909642296,
"user": 1.60174656,
"system": 1.24297194,
"min": 2.63116564296,
"max": 2.69344930996,
"times": [
2.6690904569600002,
2.65569657896,
2.69344930996,
2.66760976596,
2.6691023889600003,
2.63116564296,
2.6888084459600003,
2.6858956069600004,
2.66828465296,
2.67710851996
]
},
{
"command": "pacquet@main",
"mean": 2.6853937011599998,
"stddev": 0.02088337105914983,
"median": 2.6794656254600002,
"user": 1.56146026,
"system": 1.29280314,
"min": 2.65496444396,
"max": 2.72962452996,
"times": [
2.67960193096,
2.67655498096,
2.68431599096,
2.6792060389600003,
2.7093329709600003,
2.6913181879600003,
2.72962452996,
2.6793293199600003,
2.6696886169600003,
2.65496444396
]
},
{
"command": "pnpr@HEAD",
"mean": 1.55276850626,
"stddev": 0.15332714500389588,
"median": 1.51736129796,
"user": 0.9569843599999999,
"system": 1.13411484,
"min": 1.37902990096,
"max": 1.76185560196,
"times": [
1.52435302396,
1.76185560196,
1.69803786296,
1.5103695719599999,
1.38727753096,
1.7531852699600001,
1.38695197996,
1.66000887396,
1.37902990096,
1.46661544596
]
},
{
"command": "pnpr@main",
"mean": 1.5988327364600001,
"stddev": 0.16682383270736764,
"median": 1.64624481196,
"user": 1.00821046,
"system": 1.0927831399999999,
"min": 1.37434622196,
"max": 1.79722887796,
"times": [
1.3949917569599999,
1.42099409796,
1.79722887796,
1.37434622196,
1.62808392896,
1.47900443796,
1.68557167896,
1.78960816596,
1.66440569496,
1.75409250296
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.53882348536,
"stddev": 0.005594996456020315,
"median": 0.5397302932600001,
"user": 0.6458452400000001,
"system": 0.6512298,
"min": 0.53079416526,
"max": 0.54778416726,
"times": [
0.5349238122600001,
0.54261529026,
0.53998179026,
0.54778416726,
0.54206211226,
0.54412872026,
0.53173726426,
0.53472873526,
0.5394787962600001,
0.53079416526
]
},
{
"command": "pacquet@main",
"mean": 0.53545582916,
"stddev": 0.011690687112880505,
"median": 0.53415953876,
"user": 0.64141954,
"system": 0.6607841999999999,
"min": 0.5195932332600001,
"max": 0.55247718026,
"times": [
0.5195932332600001,
0.52209864226,
0.52691426726,
0.53334452026,
0.54900610926,
0.53497455726,
0.54254592126,
0.54667957426,
0.55247718026,
0.52692428626
]
},
{
"command": "pnpr@HEAD",
"mean": 0.29157208816,
"stddev": 0.005109286110618197,
"median": 0.29311249476,
"user": 0.17057394,
"system": 0.5242343999999999,
"min": 0.28188211826000004,
"max": 0.29950581826,
"times": [
0.28906257726,
0.29419368326,
0.29425306426000003,
0.29222673226,
0.29399825726,
0.29528647326,
0.28579008826,
0.28188211826000004,
0.28952206926,
0.29950581826
]
},
{
"command": "pnpr@main",
"mean": 0.28187516256,
"stddev": 0.004982894959559012,
"median": 0.28080630426,
"user": 0.18573434,
"system": 0.49471049999999994,
"min": 0.27710195126000003,
"max": 0.29221500126,
"times": [
0.27860256526,
0.29221500126,
0.27717650026,
0.28181805726000003,
0.28095002926,
0.28901136126,
0.28210807126000004,
0.27910550926,
0.27710195126000003,
0.28066257926
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.8365592000200004,
"stddev": 0.012953410987122427,
"median": 1.83618859862,
"user": 0.84848882,
"system": 0.71971064,
"min": 1.82045049962,
"max": 1.86156352062,
"times": [
1.84210221262,
1.83538635462,
1.84246842862,
1.83567236062,
1.86156352062,
1.8475673736199998,
1.82061570562,
1.8367048366199998,
1.82045049962,
1.82306070762
]
},
{
"command": "pacquet@main",
"mean": 1.8270758607200002,
"stddev": 0.008717821698615928,
"median": 1.8278109706199999,
"user": 0.8468211200000001,
"system": 0.71559634,
"min": 1.80756424862,
"max": 1.8364045166199998,
"times": [
1.8256356696199998,
1.8239297986199998,
1.80756424862,
1.8364045166199998,
1.83062143562,
1.82782425562,
1.83598943762,
1.83494051962,
1.82779768562,
1.8200510396199998
]
},
{
"command": "pnpr@HEAD",
"mean": 0.28563397812,
"stddev": 0.0031928073454845353,
"median": 0.28563474262,
"user": 0.18173762,
"system": 0.4985007399999999,
"min": 0.28179924062,
"max": 0.29016094162,
"times": [
0.28196253662000004,
0.28614766962000004,
0.28179924062,
0.28340173762000004,
0.28556246162000004,
0.28884157462000004,
0.29016094162,
0.29001245162,
0.28274414362000005,
0.28570702362
]
},
{
"command": "pnpr@main",
"mean": 0.28270979312000005,
"stddev": 0.009963477877680206,
"median": 0.28260047912,
"user": 0.16727782,
"system": 0.49370383999999995,
"min": 0.26804105362,
"max": 0.29815091462000004,
"times": [
0.28320152162,
0.29815091462000004,
0.26878464862,
0.26804105362,
0.28199943662000004,
0.27584864462,
0.28884281662000005,
0.29501572062000003,
0.28167680062,
0.28553637362
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.32013433622,
"stddev": 0.00956752456981565,
"median": 0.32223865512000005,
"user": 0.32419172,
"system": 0.041995879999999985,
"min": 0.30647737462,
"max": 0.34010859262000004,
"times": [
0.34010859262000004,
0.32004267862,
0.30647737462,
0.32287242862000004,
0.32229391362000004,
0.30850737362,
0.31207460762,
0.32218339662,
0.32394941962,
0.32283357662
]
},
{
"command": "pacquet@main",
"mean": 0.3171206274200001,
"stddev": 0.006553866765432177,
"median": 0.31440630712,
"user": 0.31162772,
"system": 0.05233858,
"min": 0.31045704962000004,
"max": 0.32849458662000003,
"times": [
0.32554847062000003,
0.31131457162000004,
0.32449413162,
0.31517744962,
0.31304072062,
0.31256939562,
0.31363516462,
0.31647473362,
0.31045704962000004,
0.32849458662000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.0834984736825,
"stddev": 0.0019856067092504136,
"median": 0.08279890412,
"user": 0.020716451249999993,
"system": 0.007193418749999999,
"min": 0.08029236862,
"max": 0.08784966162,
"times": [
0.08784966162,
0.08419917262,
0.08252881662,
0.08232704862,
0.08221666162,
0.08387159562,
0.08656487162,
0.08255804162000001,
0.08068457662,
0.08234960162,
0.08243189562,
0.08271609862,
0.08229158162,
0.08196201362,
0.08578759262,
0.08369215062,
0.08325801562,
0.08029236862,
0.08303386562000001,
0.08213841462,
0.08461011362,
0.08772799362,
0.08459545562,
0.08375665162,
0.08695688762,
0.08149885462,
0.08328479562,
0.08211651362,
0.08260277462,
0.08723673262000001,
0.08192862962,
0.08288170962000001
]
},
{
"command": "pnpr@main",
"mean": 0.08292653485529414,
"stddev": 0.0017489845675834398,
"median": 0.08255329812000001,
"user": 0.01939133176470588,
"system": 0.008240367058823528,
"min": 0.08108740162,
"max": 0.08741355262,
"times": [
0.08384711162,
0.08589225862000001,
0.08108740162,
0.08261437762,
0.08280940362,
0.08709282262,
0.08184115562000001,
0.08187092262000001,
0.08281634662000001,
0.08196491862000001,
0.08224500462,
0.08123496862,
0.08185925062,
0.08357337762,
0.08111516262,
0.08196648162,
0.08353752062,
0.08143084662,
0.08314014462000001,
0.08741355262,
0.08162200562000001,
0.08249221862,
0.08221776262,
0.08295897462,
0.08126518562,
0.08358425862,
0.08564897262,
0.08354536562,
0.08689035162,
0.08172217362,
0.08268151362000001,
0.08148311362,
0.08272943362,
0.08130782562
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.52753808132,
"stddev": 0.13316691728101782,
"median": 4.450046909019999,
"user": 1.6840373000000004,
"system": 1.30592724,
"min": 4.4208486230199995,
"max": 4.7334547980199995,
"times": [
4.71335711202,
4.45798245602,
4.4421113620199995,
4.43999407902,
4.7334547980199995,
4.42701419102,
4.70569648602,
4.43264616002,
4.50227554602,
4.4208486230199995
]
},
{
"command": "pacquet@main",
"mean": 4.617542483319999,
"stddev": 0.13449148073124578,
"median": 4.623088194019999,
"user": 1.6344138000000001,
"system": 1.3453456400000001,
"min": 4.40822414902,
"max": 4.858067474019999,
"times": [
4.6903006740199995,
4.858067474019999,
4.74843406402,
4.40822414902,
4.6024556380199995,
4.61408669902,
4.63208968902,
4.646411920019999,
4.44475723702,
4.53059728902
]
},
{
"command": "pnpr@HEAD",
"mean": 3.5519719301199997,
"stddev": 0.12877354253588713,
"median": 3.5016038380200003,
"user": 1.1682046,
"system": 1.22211864,
"min": 3.4397556540200003,
"max": 3.80301669502,
"times": [
3.5550357050200003,
3.46409624102,
3.51167446502,
3.4506093360200003,
3.49153321102,
3.4397556540200003,
3.4537911990200003,
3.60305180202,
3.80301669502,
3.74715499302
]
},
{
"command": "pnpr@main",
"mean": 3.51466243762,
"stddev": 0.09900665874095785,
"median": 3.4631618905200003,
"user": 1.1404139000000002,
"system": 1.2413449399999998,
"min": 3.4420629440200003,
"max": 3.7438662510200005,
"times": [
3.5988936160200002,
3.4591473720200003,
3.7438662510200005,
3.4420629440200003,
3.4560938070200002,
3.4430395120200004,
3.4666497830200003,
3.45967399802,
3.4875885880200004,
3.58960850502
]
}
]
} |
|
| Branch | pr/13140 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,379.03 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 281.80 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 281.88 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 80.29 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,331.32 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,439.76 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 254.71 ms |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Confidence Score: 5/5Safe to merge — the changes are narrowly scoped to setup cleanup and a detection heuristic, both guarded by tests that exercise the key edge cases. The cleanup path runs only after a successful addDirToEnvPath call, so a failed PATH migration cannot leave the home directory in a partially-cleaned state. The dangling-shim detector correctly handles both absolute and relative cmd-shim-target values, as confirmed by the two new test cases. The Rust and TypeScript implementations agree on the same 12 shim names, using the same constant imported directly in both test suites. No existing behavior is removed — the cleanup is best-effort, and the detection logic is strictly more conservative (fewer false positives) than the previous file-existence check. No files require special attention. Reviews (3): Last reviewed commit: "fix(self-update): resolve relative legac..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm11/engine/pm/commands/src/self-updater/selfUpdate.ts`:
- Line 294: Update the shim target existence check in the surrounding
self-update logic to resolve relative target paths against pnpmHomeDir before
calling fs.existsSync. Preserve absolute targets and the existing dangling-shim
behavior while ensuring relative cmd-shim targets are evaluated from the shim’s
directory rather than the current working directory.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c43a5410-9716-430e-9b50-b20dea06ed10
📒 Files selected for processing (7)
.changeset/cleanup-legacy-homedir-shims.mdpnpm/crates/cli/src/cli_args/setup.rspnpm/crates/cli/src/cli_args/setup/tests.rspnpm11/engine/pm/commands/src/self-updater/selfUpdate.tspnpm11/engine/pm/commands/src/setup/setup.tspnpm11/engine/pm/commands/test/self-updater/selfUpdate.test.tspnpm11/engine/pm/commands/test/setup/setup.test.ts
Per PR review: the duplicated list in setup.test.ts would silently drift if a new alias were added to the source const. Import the const directly, matching the Rust test's pattern.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
1 similar comment
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Summary
Closes #12496.
pnpm setupmigrated PATH to$PNPM_HOME/binbut left the v10-layout shims (pnpm/pn/pnpx/pnx, plus.cmd/.ps1siblings) at the top ofPNPM_HOME.self-update's v10-layout detector keyed off file existence alone, so the warning fired on everyself-update— including on dangling shims whose install target had been garbage-collected. Runningpnpm setupdid not silence it.This change:
addDirToEnvPathsucceeds, best-effort unlink the 12 legacy shim names atpnpmHomeDir. Fresh v11 installs have nothing to clean up; existing v10→v11 migrations get the leftover shims removed.hasLegacyHomeDirShimreads the# cmd-shim-target=<path>marker on the POSIXpnpmshim; if the marker points at a missing path, the shim was GC'd and is treated as absent. The warning can no longer fire on dead shim files.Parity
Per the cardinal rule, the user-visible change (setup cleanup) lands in both stacks in this PR. The dangling-shim hardening is TS-only because pacquet's
self-updatehas not yet ported the v10-layout detection branch at all (nohasLegacyHomeDirShimequivalent). When pacquet ports the detection, it should port the dangling-shim check too.Squash Commit Body
Checklist
.changeset/cleanup-legacy-homedir-shims.md) — patch onpnpmandpacquet.@pnpm/engine.pm.commands(setup + self-updater suites).cargo nextest run -p pacquet-cli setup(31/31).eslint,cargo clippy --all-targets --workspace -- -D warnings,cargo fmt --check,taplo format --check,cspell,typos.cargo doc --no-deps --workspace --all-featuresclean.pnpm --filter pnpm run compilebefore invoking e2e).Written by an agent (opencode, zai-coding-plan/glm-5.2).
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
pnpm setup/pacquet setupto remove leftover legacy v10 command shims after switching to the v11PNPM_HOME/binlayout.pnpm self-updateto stop warning when legacy shims are dangling (their install targets no longer exist).self-updatecorrectly ignoring dangling legacy shims (including Windows variants).