Repository navigation
fix(install): honor removal overrides for optional peers - #15199
Conversation
|
💖 Thanks for opening this pull request! 💖 |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pnpm/pnpm/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughRemoval overrides now delete matching entries from optional peer metadata in the TypeScript and Rust implementations. Workspace tests verify that a removed optional peer is not resolved from a sibling package. Other Rust changes update names, imports, literals, formatting, and comments without changing behavior. ChangesOptional peer removal
Rust and Windows maintenance
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Assessment against linked issues
Suggested labels: Merge Risk: ⚪ Minimal · up to This change should prevent a removed optional peer from being reintroduced through a sibling workspace dependency. The reported latency alert has no established repeatable impact, so no actionable merge risk is demonstrated. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
pnpm11/hooks/read-package-hook/src/createVersionsOverrider.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. 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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15199 +/- ##
=======================================
Coverage 91.56% 91.56%
=======================================
Files 1387 1387
Lines 186702 186705 +3
=======================================
+ Hits 170953 170957 +4
+ Misses 15749 15748 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Integrated-Benchmark Report (Linux)Commit: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.45955312124,
"stddev": 0.15070628848007334,
"median": 2.46659966794,
"user": 1.5964066399999999,
"system": 1.7566002600000001,
"min": 2.2818583284400002,
"max": 2.7238514414400004
},
{
"command": "pacquet@main",
"mean": 2.49149325864,
"stddev": 0.14608119755036503,
"median": 2.49198207294,
"user": 1.4142243399999999,
"system": 1.5489536599999996,
"min": 2.30702176744,
"max": 2.71842397544
},
{
"command": "pnpr@HEAD",
"mean": 1.4999828120400003,
"stddev": 0.14397642826128348,
"median": 1.5179508424400003,
"user": 1.3090546399999998,
"system": 1.47549476,
"min": 1.30002728244,
"max": 1.6797078934400003
},
{
"command": "pnpr@main",
"mean": 1.3868435995400001,
"stddev": 0.13583425045385905,
"median": 1.32018713244,
"user": 1.2605203399999998,
"system": 1.36795136,
"min": 1.29220058744,
"max": 1.70305388244
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
Confirmation (reversed target order)
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.34530758502,
"stddev": 0.04861199071069593,
"median": 0.32257207402,
"user": 0.36959632,
"system": 0.76804784,
"min": 0.27226021952,
"max": 0.41304333152
},
{
"command": "pacquet@main",
"mean": 0.27682838742000004,
"stddev": 0.01367312868264414,
"median": 0.28199580602,
"user": 0.31463001999999995,
"system": 0.64109044,
"min": 0.25126064252,
"max": 0.29048202352
},
{
"command": "pnpr@HEAD",
"mean": 0.29643894542,
"stddev": 0.012362242272034692,
"median": 0.29889170152,
"user": 0.30817752,
"system": 0.63070134,
"min": 0.27738943452,
"max": 0.31515990652
},
{
"command": "pnpr@main",
"mean": 0.30050868791999996,
"stddev": 0.01650156062705543,
"median": 0.30237836302,
"user": 0.31766651999999995,
"system": 0.63382114,
"min": 0.27405342152,
"max": 0.32026495552
}
],
"confirmation": {
"results": [
{
"command": "pnpr@main",
"mean": 0.34476869258000004,
"stddev": 0.03664307339427342,
"median": 0.33269812528000003,
"user": 0.38853396,
"system": 0.7214579999999999,
"min": 0.30692080528000004,
"max": 0.40206307028000005
},
{
"command": "pnpr@HEAD",
"mean": 0.30003272918000007,
"stddev": 0.02534098130211673,
"median": 0.30282029978,
"user": 0.31929646,
"system": 0.6505124,
"min": 0.26366532328000003,
"max": 0.34579576228000003
},
{
"command": "pacquet@main",
"mean": 0.31322724668,
"stddev": 0.03577807487391683,
"median": 0.30028409778,
"user": 0.35990776,
"system": 0.6757132999999999,
"min": 0.26002437328000005,
"max": 0.37880580828000004
},
{
"command": "pacquet@HEAD",
"mean": 0.29947258208000005,
"stddev": 0.019089481100911923,
"median": 0.29596474078,
"user": 0.34148806,
"system": 0.6829476999999999,
"min": 0.27377449428,
"max": 0.33960987928
}
]
}
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.008830175709638557,
"stddev": 0.001246030434472137,
"median": 0.008721518300000002,
"user": 0.005216464819277108,
"system": 0.004187371084337351,
"min": 0.006745738300000001,
"max": 0.014126149300000002
},
{
"command": "pacquet@main",
"mean": 0.008038777701215801,
"stddev": 0.0011055817003817177,
"median": 0.007729795300000002,
"user": 0.004315199209726442,
"system": 0.004300408389057747,
"min": 0.006563619300000001,
"max": 0.012870538300000001
},
{
"command": "pnpr@HEAD",
"mean": 0.007859731992737441,
"stddev": 0.0009786671047786082,
"median": 0.007528925800000001,
"user": 0.004463614748603349,
"system": 0.003950227932960897,
"min": 0.006643697300000001,
"max": 0.0127449793
},
{
"command": "pnpr@main",
"mean": 0.007938601914457832,
"stddev": 0.0010410414499875396,
"median": 0.0075798658,
"user": 0.004479359397590362,
"system": 0.0040049755421686754,
"min": 0.0065094453000000005,
"max": 0.012656109300000001
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.00936180154765958,
"stddev": 0.001904894696834323,
"median": 0.00881660542,
"user": 0.0055752017021276565,
"system": 0.00432569680851064,
"min": 0.00668392292,
"max": 0.017110429920000003
},
{
"command": "pacquet@main",
"mean": 0.012727823214117655,
"stddev": 0.0024248174036169403,
"median": 0.01221933492,
"user": 0.007711124278074869,
"system": 0.005762502673796793,
"min": 0.00908032992,
"max": 0.02013887992
},
{
"command": "pnpr@HEAD",
"mean": 0.011297327410196076,
"stddev": 0.0013097595485336083,
"median": 0.011130395920000001,
"user": 0.006190433137254903,
"system": 0.005805583333333331,
"min": 0.00888825992,
"max": 0.01532736192
},
{
"command": "pnpr@main",
"mean": 0.010262856627964594,
"stddev": 0.0012366328115597071,
"median": 0.01002907142,
"user": 0.00619595132743363,
"system": 0.004692668141592918,
"min": 0.00772693292,
"max": 0.016272025920000002
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.5153214927,
"stddev": 0.052466681360747724,
"median": 2.5002486949,
"user": 1.9197682599999997,
"system": 1.6094347800000002,
"min": 2.4495881669,
"max": 2.6154705929
},
{
"command": "pacquet@main",
"mean": 2.4997711466999997,
"stddev": 0.042590493308160185,
"median": 2.4851849999,
"user": 1.8737521599999998,
"system": 1.6480835800000002,
"min": 2.4467140479,
"max": 2.5737059779
},
{
"command": "pnpr@HEAD",
"mean": 1.4941264257,
"stddev": 0.10937054480017411,
"median": 1.4537100754,
"user": 1.1790454599999998,
"system": 1.34365398,
"min": 1.3684692109,
"max": 1.7108705089
},
{
"command": "pnpr@main",
"mean": 1.5270819339000001,
"stddev": 0.11538507649012308,
"median": 1.4957886204,
"user": 1.1771369600000001,
"system": 1.29200178,
"min": 1.3879399849,
"max": 1.7202741279
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.46350872146000005,
"stddev": 0.0387268673298308,
"median": 0.46115014086000006,
"user": 0.67877032,
"system": 0.85171826,
"min": 0.41468393786,
"max": 0.51973263086
},
{
"command": "pacquet@main",
"mean": 0.46729597526000005,
"stddev": 0.02224179098212125,
"median": 0.4615631478600001,
"user": 0.68352762,
"system": 0.8413543599999999,
"min": 0.43344227286000003,
"max": 0.5042038988599999
},
{
"command": "pnpr@HEAD",
"mean": 0.27447539586,
"stddev": 0.009253336465290902,
"median": 0.27648007786000006,
"user": 0.22435352000000003,
"system": 0.51645186,
"min": 0.26130463386,
"max": 0.28787026886000006
},
{
"command": "pnpr@main",
"mean": 0.29063895326,
"stddev": 0.006055647273179718,
"median": 0.28849141636000003,
"user": 0.23912351999999998,
"system": 0.5591940599999999,
"min": 0.28493172386000004,
"max": 0.30181630286000005
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.67465984176,
"stddev": 0.045658969979070194,
"median": 1.6711840425600002,
"user": 0.93861122,
"system": 1.06004436,
"min": 1.61983229956,
"max": 1.7722621065600002
},
{
"command": "pacquet@main",
"mean": 1.73624739736,
"stddev": 0.048178758353573235,
"median": 1.73474528156,
"user": 1.07460082,
"system": 1.1048547599999998,
"min": 1.64985883756,
"max": 1.8361435105600001
},
{
"command": "pnpr@HEAD",
"mean": 0.32524919186,
"stddev": 0.011552017593259457,
"median": 0.32188191756000006,
"user": 0.29058222,
"system": 0.6285566599999999,
"min": 0.31139645356000006,
"max": 0.34216436356
},
{
"command": "pnpr@main",
"mean": 0.32577774186,
"stddev": 0.013648952636884142,
"median": 0.33077838006000004,
"user": 0.28446982000000004,
"system": 0.62633016,
"min": 0.30076787356,
"max": 0.34078408456000003
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2069265418866667,
"stddev": 0.011589198709424556,
"median": 0.20978564782000003,
"user": 0.20861047333333332,
"system": 0.07587548666666666,
"min": 0.18734694382000003,
"max": 0.22294305282000002
},
{
"command": "pacquet@main",
"mean": 0.19442403032000005,
"stddev": 0.015267645167921002,
"median": 0.19262862182,
"user": 0.19117748285714284,
"system": 0.06783666285714285,
"min": 0.17487769382,
"max": 0.23129940482000003
},
{
"command": "pnpr@HEAD",
"mean": 0.08883547041375002,
"stddev": 0.002119328126824325,
"median": 0.08849539682,
"user": 0.029346058750000004,
"system": 0.014775862499999995,
"min": 0.08559911582,
"max": 0.09454230482
},
{
"command": "pnpr@main",
"mean": 0.09195050188249998,
"stddev": 0.006205267170443149,
"median": 0.08942901832,
"user": 0.030901683749999995,
"system": 0.015049551250000001,
"min": 0.08573681482,
"max": 0.10899654782
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6791575846466666,
"stddev": 0.10708893155251353,
"median": 0.72229272598,
"user": 0.7036477622222221,
"system": 0.1650382777777778,
"min": 0.45142525898,
"max": 0.7902154829800001
},
{
"command": "pacquet@main",
"mean": 0.627377199868889,
"stddev": 0.10453442822414177,
"median": 0.6358820379800001,
"user": 0.6475965399999999,
"system": 0.16138949999999996,
"min": 0.43277716598000004,
"max": 0.7800914559800001
},
{
"command": "pnpm@HEAD",
"mean": 3.016318548757778,
"stddev": 0.10440777836202715,
"median": 3.02954701798,
"user": 4.670372873333334,
"system": 0.20029083333333333,
"min": 2.83551939698,
"max": 3.1587443789800003
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.1813219997466667,
"stddev": 0.008499421085818328,
"median": 0.18235138588000002,
"user": 0.13704463999999997,
"system": 0.08876544,
"min": 0.16297118888,
"max": 0.19199498088000003
},
{
"command": "pacquet@main",
"mean": 0.17423585029176472,
"stddev": 0.007669259686344121,
"median": 0.17613231888000003,
"user": 0.13015581647058821,
"system": 0.08600099294117647,
"min": 0.16126846188000002,
"max": 0.18594502288
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.6090722023,
"stddev": 0.20714421262346575,
"median": 4.6272929524,
"user": 1.7804235799999997,
"system": 1.8642856600000002,
"min": 4.3411937249,
"max": 4.8915884809
},
{
"command": "pacquet@main",
"mean": 4.4028672377,
"stddev": 0.1534115867417098,
"median": 4.3408293789000005,
"user": 1.42418818,
"system": 1.54703626,
"min": 4.294823693900001,
"max": 4.6929760679
},
{
"command": "pnpr@HEAD",
"mean": 3.5078769275,
"stddev": 0.13653003947931144,
"median": 3.4722079728999997,
"user": 1.4230134799999998,
"system": 1.46879676,
"min": 3.3661373569,
"max": 3.7409464959
},
{
"command": "pnpr@main",
"mean": 3.5476980027,
"stddev": 0.15206735413451478,
"median": 3.4844331929,
"user": 1.5778860799999999,
"system": 1.61978426,
"min": 3.3781054209,
"max": 3.8416383149
}
]
}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.
Confirmation (reversed target order)
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.14406283370947368,
"stddev": 0.015496606726918993,
"median": 0.14232163492,
"user": 0.17674082210526318,
"system": 0.14750711894736837,
"min": 0.12541554092,
"max": 0.17409170992
},
{
"command": "pacquet@main",
"mean": 0.19392830468923078,
"stddev": 0.01563947512509944,
"median": 0.18995896592,
"user": 0.23704182615384614,
"system": 0.20077607846153844,
"min": 0.17257087792,
"max": 0.22380657092
},
{
"command": "pnpr@HEAD",
"mean": 0.1933676935866667,
"stddev": 0.02499020833733006,
"median": 0.20709366442,
"user": 0.22238431333333333,
"system": 0.1929752066666666,
"min": 0.14277916292,
"max": 0.21922033492
},
{
"command": "pnpr@main",
"mean": 0.14421772842000002,
"stddev": 0.0044367754172184954,
"median": 0.14292174042,
"user": 0.16973397999999998,
"system": 0.14020348444444444,
"min": 0.13731937792,
"max": 0.15522811492
}
],
"confirmation": {
"results": [
{
"command": "pnpr@main",
"mean": 0.14478990767764705,
"stddev": 0.010235084090853254,
"median": 0.13957159156,
"user": 0.17279693529411763,
"system": 0.14584308588235295,
"min": 0.13482950356,
"max": 0.16975694356
},
{
"command": "pnpr@HEAD",
"mean": 0.14622896122666662,
"stddev": 0.009191183262322912,
"median": 0.14531770406,
"user": 0.18647225555555558,
"system": 0.13659265777777777,
"min": 0.13155663156,
"max": 0.16208847456
},
{
"command": "pacquet@main",
"mean": 0.12458752986000002,
"stddev": 0.010720069555308345,
"median": 0.12242507106,
"user": 0.15697645000000005,
"system": 0.13460478,
"min": 0.11320461356,
"max": 0.15871766856
},
{
"command": "pacquet@HEAD",
"mean": 0.16443208056,
"stddev": 0.03568322628629298,
"median": 0.15127260356,
"user": 0.20072629999999997,
"system": 0.15854753000000002,
"min": 0.12391556356,
"max": 0.25644690756000005
}
]
}
} |
Draft status: performance check under investigationThe original local push checks, TypeScript CI matrix and Rust CI on Windows, Linux and macOS passed on c443628. The PR remains a draft because the Bencher report raised three latency alerts. The same-run artifact gives these minimum latencies (HEAD / main):
The same HEAD client through pnpr measured 5.275 ms minimum in the hot-repeat scenario; direct cold-cache repeats measured 5.956 / 5.917 ms. Those controls do not establish the cause of the hot-repeat difference. The Bencher thresholds use historical main results, not just this run's main comparison. Both revisions were built with the same release command after binary cache misses. The benchmark merge tree matches the PR head exactly. I have not classified the alerts as noise or changed any thresholds. A controlled same-revision benchmark repeat is still needed before this performance gate can be considered clear; this account has no upstream write permission, which GitHub requires for reruns. Written by an agent (Codex, GPT-6). |
PR Summary by QodoHonor removal overrides for optional peer metadata
AI Description
Diagram
High-Level Assessment
Files changed (22)
|
Code Review by Qodo
1. The fix includes unrelated lint churn
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Remove matching peer metadata with an explicit removal override so a sibling workspace dependency cannot recreate the removed optional peer. Apply the fix to both affected implementations and preserve cached TypeScript manifests by cloning the metadata container before editing it. Add unit and workspace regression coverage. Replace a private rustdoc link with plain text so strict Windows documentation checks can run. Closes pnpm#15008.
Address the existing diagnostics exposed by the required checks on Windows. Keep the filesystem helpers, process cleanup and test behavior unchanged while clarifying names, literals, imports and documentation. Move a test-only import into its external test module and reduce the junction test's closure nesting. Spawn all workers before joining them, preserving its barrier synchronization and assertions. Correct the new regressions' trailing commas and remove their temporary debugging output. Keep these validation corrections separate from the optional-peer removal implementation for review.
c443628 to
f79b4e5
Compare
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
Code review by qodo was updated up to the latest commit f79b4e5 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Congrats on merging your first pull request! 🎉🎉🎉 |
Remove optional peer metadata when a removal override deletes the peer, preventing a sibling workspace dependency from reintroducing it. Fix both affected implementations, preserve cached TypeScript manifests, and add unit and workspace regressions. Repair violations exposed by required checks without relaxing them or changing runtime behavior. Closes pnpm#15008. --------- Co-authored-by: JoyceLeo326 <[email protected]> Co-authored-by: Zoltan Kochan <[email protected]>
…ly in peerDependenciesMeta (#16682) The resolver treats a peerDependenciesMeta entry with optional: true and no peerDependencies entry as an optional "*" peer. The versions overrider only iterated peerDependencies, so a removal override never reached such a peer and a sibling workspace project could still satisfy it. Both overriders now also match each peerDependenciesMeta name that peerDependencies does not declare against the overrides as "*", and drop the meta entry when the chosen override is "-". In pacquet the apply_to_arc fast path checks the same entries, so the manifest is cloned and rewritten. The workspace regression tests from #15199 now also run against @pnpm.e2e/abc-optional-peers-meta-only. Fixes #16681 --------- Co-authored-by: Zoltan Kochan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
An optional peer removed by
"ws>utf-8-validate": "-"can reappear when a sibling workspace supplies it. The override deletes the peer dependency but leaves optional metadata that recreates it.Both TypeScript and Rust now remove the matching metadata. TypeScript clones the metadata container to preserve cached manifests. Regressions cover selectors, legitimate metadata-only peers and sibling dependencies.
Closes #15008.
The 22-file scope includes prerequisite repairs for existing documentation and lint violations exposed by the required checks on Windows. A separate commit isolates the additional lint repairs. They preserve runtime behavior and check settings; the concurrent junction test still starts all 32 workers before joining.
Validation
On the rebased source, Windows validation passed:
New unit regressions failed before the fix and passed afterward. Before rebasing, broader selections were 792/793 Rust (one unchanged fixture blocked by independently reproduced Windows OS 1314) and 27/28 TypeScript (upstream HTTP 503/504). These are not full-suite passes.
The original push hook completed successfully, including strict full-workspace documentation checks, Dylint, spelling and TOML formatting.
Squash Commit Body
Checklist
already linked to it solves it.
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 (Codex, GPT-6).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
"-") now remove optional peer dependency metadata as well as the dependency itself. This prevents an optional peer removed by an override from being supplied by another package in the workspace.