Repository navigation
Conversation
…ve siblings `run_link_phase` returned early under `virtual_store_only` before reaching `LinkVirtualStoreBins`, while `run_build_phase` still ran dependency lifecycle scripts under that mode. A `postinstall` that invokes a sibling dependency's bin — `unrs-resolver` calling `napi-postinstall`, for instance — therefore died with `command not found` (exit 127) under `pnpm fetch`, because `pnpm_executor::extend_path`'s ancestor-`.bin` walk had no `.bin` to find. `pnpm install --frozen-lockfile` against the same lockfile worked: it does not set `virtual_store_only`. The per-slot bin pass now runs under `virtual_store_only` too. Its links live inside the virtual store, which is exactly what that mode materializes; only the importer-facing passes (prune, direct-dependency symlinks, root components, hoisting, sidecars) stay skipped. The TypeScript CLI is unaffected — its `buildModules` links a dep node's bins itself right before running the node's scripts — so it gets the matching regression test only, plus the `allowBuilds` widening that test needs on `FetchCommandOptions`. Closes #14174
|
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)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
ChangesFetch virtual-store bin linking
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change makes dependency build scripts resolve sibling binaries during fetch without changing importer-facing installation behavior; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant FetchCommand
participant LinkPhase
participant LifecycleScript
FetchCommand->>LinkPhase: run virtual_store_only linking
LinkPhase->>LinkPhase: create virtual-store dependency bin links
LinkPhase->>LifecycleScript: expose sibling dependency bin
LifecycleScript->>LifecycleScript: run allowed build script
Assessment against linked issues
Suggested labels: ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
PR Summary by QodoFix fetch lifecycle scripts resolving sibling dependency bins
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Code Review by Qodo
1. Hoist helpers are unrelated
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (3): Last reviewed commit: "refactor(deps-restorer): name the link p..." | Re-trigger Greptile |
`linking.rs` was 38% comment lines. Much of that was prose the code, the types, or the callee's own docs already carried: - the `LinkPhaseInputs` doc enumerated the fields that document themselves right below it; - the `link_root_component_members` call site re-explained the callee and closed with a sentence describing a `project_manifests` → importer-id mapping that this call site does not perform; - the `run_hoisted_linker` call site restated both `HoistedLinkerOutput` field docs, including the paragraph its own "see `BuildModules::pkg_roots_by_key`" pointer already delegated; - the hoist-pass guard was documented against a condition that lives in `compute_hoist_plan`, not here; - the public-hoist stash rationale appeared twice, at the declaration and again at the assignment; - two comments sat above the wrong binding, describing a statement one or two lines further down. Gate and ordering rationale is kept — why a pass is skipped under `nodeLinker: hoisted` or `virtualStoreOnly`, why reconciliation precedes relinking, why the hoist plan is computed before `SymlinkDirectDependencies` — since none of it is recoverable from the code and all of it is what a refactor silently breaks. Comment lines 192 → 117; code lines unchanged at 301. Stripping comments from both revisions yields identical files.
|
Code review by qodo was updated up to the latest commit 1188c20 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Micro-Benchmark ResultsLinux |
…ting them Follow-up to the comment pass: replace prose with names and structure where a name can carry what the comment said. - `write_hoist_links` takes over the hoist-plan materialization, so the `let mut publicly_hoisted_for_post_build` + assign-40-lines-later pattern collapses into one destructuring `let`, and the GVS caveat moves onto the function it constrains. - `relink_importer_bins_after_hoisting` replaces a bare block whose only job was to scope one variable; its "why re-walk" note is now the function's contract. - The two gates become `has_virtual_store` and `links_importer_tree`, which say what `!is_hoisted` and `!is_hoisted && !virtual_store_only` meant. - `LinkPhaseOutput::empty()` replaces the four-field empty literal and the sentence explaining that every field is empty. - The public-hoist / pnpm/pacquet#342 rationale moves onto `LinkPhaseOutput::publicly_hoisted_for_post_build`, the public field it describes, instead of sitting on a local. - The `run_hoisted_linker` call site loses its comment: the function is named, documented, and the `if is_hoisted` branch reads as itself. Also corrects a false invariant introduced in the previous commit: the private-hoist target is not always `<root>/node_modules/.pnpm/node_modules` — `virtualStoreDir` is a user-settable path. What GVS does not do is move it, which is the part worth stating. Comment lines 117 -> 102 on top of the previous 192 -> 117.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14178 +/- ##
==========================================
- Coverage 88.67% 88.64% -0.03%
==========================================
Files 679 679
Lines 115540 116155 +615
==========================================
+ Hits 102454 102967 +513
- Misses 13086 13188 +102 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Notes on the two remaining Qodo compliance findings, both about changesets. "Published TS package omitted" — addressed in d9d3b97. "
Rule 713436 is a generic "always declare pnpm" check that does not model that Two changesets keeps both release notes accurate rather than merging a Rust fix Separately, thanks for the private-hoist catch (finding 4) — that comment was Written by an agent (Claude Code, claude-opus-5). |
|
Code review by qodo was updated up to the latest commit d9d3b97 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
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. 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.3918956104199998,
"stddev": 0.14104272786521854,
"median": 2.31378780292,
"user": 1.3728550599999996,
"system": 1.46813058,
"min": 2.27891514292,
"max": 2.65888568892
},
{
"command": "pacquet@main",
"mean": 2.4745616570199997,
"stddev": 0.17418942106372215,
"median": 2.46710369992,
"user": 1.3826361600000001,
"system": 1.4433204800000001,
"min": 2.27907406192,
"max": 2.67984054892
},
{
"command": "pnpr@HEAD",
"mean": 1.45424035552,
"stddev": 0.13569025122573813,
"median": 1.3827730789200001,
"user": 1.34601676,
"system": 1.4245689799999999,
"min": 1.30390489792,
"max": 1.6454825449200001
},
{
"command": "pnpr@main",
"mean": 1.5084384619200002,
"stddev": 0.13223368843540753,
"median": 1.47998166592,
"user": 1.4959436599999998,
"system": 1.4633712799999996,
"min": 1.3372743789200001,
"max": 1.7192777889200002
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.32145391632,
"stddev": 0.01703117712648456,
"median": 0.31480174952,
"user": 0.25781102,
"system": 0.5704859799999998,
"min": 0.29548925302,
"max": 0.34325325002
},
{
"command": "pacquet@main",
"mean": 0.31725058222,
"stddev": 0.013048536034784916,
"median": 0.31726625102,
"user": 0.25795561999999994,
"system": 0.54303228,
"min": 0.29868050102,
"max": 0.33951538402
},
{
"command": "pnpr@HEAD",
"mean": 0.32724994012,
"stddev": 0.01863234699142704,
"median": 0.32896723701999997,
"user": 0.26635222000000003,
"system": 0.5582279800000001,
"min": 0.30656483902,
"max": 0.35927275702
},
{
"command": "pnpr@main",
"mean": 0.31542454782,
"stddev": 0.018642055286270418,
"median": 0.31904500402,
"user": 0.25518872,
"system": 0.5329738799999999,
"min": 0.28406912002,
"max": 0.33995116402
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.007951707559534883,
"stddev": 0.0010087457745923056,
"median": 0.0077325634200000005,
"user": 0.004344473023255812,
"system": 0.0036755802790697637,
"min": 0.006527689420000001,
"max": 0.01239658942
},
{
"command": "pacquet@main",
"mean": 0.007928301386542751,
"stddev": 0.0010412129943060144,
"median": 0.00761349942,
"user": 0.004551608996282531,
"system": 0.0034470587360594766,
"min": 0.006320739420000001,
"max": 0.01158385142
},
{
"command": "pnpr@HEAD",
"mean": 0.00827955087733788,
"stddev": 0.0008766486736008474,
"median": 0.00832178942,
"user": 0.0045470803412969345,
"system": 0.0038000070989761127,
"min": 0.00610874142,
"max": 0.01106964542
},
{
"command": "pnpr@main",
"mean": 0.008363745380122701,
"stddev": 0.0010822869691874321,
"median": 0.008146335420000001,
"user": 0.004676737730061351,
"system": 0.003760193496932515,
"min": 0.00625357342,
"max": 0.01341141542
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.008086905469195408,
"stddev": 0.0010098255831996973,
"median": 0.007913410860000001,
"user": 0.004672814559386973,
"system": 0.0034517709578544054,
"min": 0.0059544288599999995,
"max": 0.012276341860000001
},
{
"command": "pacquet@main",
"mean": 0.008062965243685806,
"stddev": 0.0012925664093111093,
"median": 0.008000114860000001,
"user": 0.004495865861027189,
"system": 0.0036021387311178234,
"min": 0.005613067859999999,
"max": 0.012652277860000002
},
{
"command": "pnpr@HEAD",
"mean": 0.00795015067602374,
"stddev": 0.001157940301285396,
"median": 0.00805846386,
"user": 0.004306232047477746,
"system": 0.0036826166172106833,
"min": 0.00578726486,
"max": 0.011842304860000001
},
{
"command": "pnpr@main",
"mean": 0.007834962079858157,
"stddev": 0.0009941612103558037,
"median": 0.007802999360000001,
"user": 0.004546948936170215,
"system": 0.003330508510638296,
"min": 0.005736941860000001,
"max": 0.01175589286
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.8647786752800006,
"stddev": 0.04743389716022515,
"median": 2.8458779415800004,
"user": 2.00636992,
"system": 1.5457700599999997,
"min": 2.80932231958,
"max": 2.95689662858
},
{
"command": "pacquet@main",
"mean": 2.8531636812800003,
"stddev": 0.04182201778936097,
"median": 2.86985265858,
"user": 1.9747811199999998,
"system": 1.5651881599999997,
"min": 2.7784717595800004,
"max": 2.8984549845800003
},
{
"command": "pnpr@HEAD",
"mean": 1.51942589558,
"stddev": 0.12657258704714652,
"median": 1.4777122620799998,
"user": 1.15500442,
"system": 1.3932802599999998,
"min": 1.41328795258,
"max": 1.78935602958
},
{
"command": "pnpr@main",
"mean": 1.48847628008,
"stddev": 0.06475844291691243,
"median": 1.50258590358,
"user": 1.14819152,
"system": 1.3687142599999997,
"min": 1.39849689658,
"max": 1.57914267858
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.4338541148800001,
"stddev": 0.030547472326440256,
"median": 0.43480773538,
"user": 0.4820576,
"system": 0.6506973199999999,
"min": 0.38916724888,
"max": 0.49583535588
},
{
"command": "pacquet@main",
"mean": 0.41867897967999995,
"stddev": 0.02135080620886848,
"median": 0.41064597888,
"user": 0.46810809999999997,
"system": 0.61982272,
"min": 0.39427845588,
"max": 0.45646511988
},
{
"command": "pnpr@HEAD",
"mean": 0.35506572698000005,
"stddev": 0.025413955186627545,
"median": 0.34618617788,
"user": 0.23447219999999996,
"system": 0.5502952200000001,
"min": 0.32617043287999997,
"max": 0.40173089088
},
{
"command": "pnpr@main",
"mean": 0.36128410698,
"stddev": 0.033466762081200675,
"median": 0.35198162388,
"user": 0.2599117,
"system": 0.52176132,
"min": 0.33296733688,
"max": 0.44170803788
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.9468859038000002,
"stddev": 0.02204683117456033,
"median": 1.9441097069,
"user": 0.8045290799999998,
"system": 0.7582244200000001,
"min": 1.9107865984,
"max": 1.9911597404
},
{
"command": "pacquet@main",
"mean": 1.9784965771,
"stddev": 0.0596175548208481,
"median": 1.9514359594000001,
"user": 0.8402662799999998,
"system": 0.7964999199999999,
"min": 1.8983230064,
"max": 2.0741221984
},
{
"command": "pnpr@HEAD",
"mean": 0.37687723139999996,
"stddev": 0.027517082962688223,
"median": 0.38314626790000006,
"user": 0.24904948,
"system": 0.55380372,
"min": 0.3358532724,
"max": 0.40983643540000003
},
{
"command": "pnpr@main",
"mean": 0.38646565060000004,
"stddev": 0.03843052408814558,
"median": 0.37771219040000004,
"user": 0.26763968,
"system": 0.5526351199999999,
"min": 0.3403487714,
"max": 0.4681093744
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25470474234,
"stddev": 0.01696652234026932,
"median": 0.25705830934,
"user": 0.20845362909090906,
"system": 0.07002266545454547,
"min": 0.22450867034,
"max": 0.27820290434000006
},
{
"command": "pacquet@main",
"mean": 0.2566342976127273,
"stddev": 0.02669535202858637,
"median": 0.25144688434,
"user": 0.20704790181818178,
"system": 0.06513121090909091,
"min": 0.22084899334,
"max": 0.30268349034
},
{
"command": "pnpr@HEAD",
"mean": 0.10881939567333337,
"stddev": 0.0036949665361411385,
"median": 0.10846014634000001,
"user": 0.035560275555555555,
"system": 0.014806712592592593,
"min": 0.10256885534000001,
"max": 0.11813946634000001
},
{
"command": "pnpr@main",
"mean": 0.10956263616608697,
"stddev": 0.004908024703576728,
"median": 0.10816187634,
"user": 0.035235024347826084,
"system": 0.01530485913043478,
"min": 0.10139409734,
"max": 0.12159616234000001
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.7858333936466667,
"stddev": 0.1452274203194059,
"median": 0.7308037539800001,
"user": 0.7826036022222222,
"system": 0.14646005111111107,
"min": 0.61348147598,
"max": 0.97227496798
},
{
"command": "pacquet@main",
"mean": 0.8500627523133333,
"stddev": 0.1361161440019607,
"median": 0.85463855998,
"user": 0.8634978244444445,
"system": 0.15984038444444443,
"min": 0.68019380498,
"max": 1.04595563298
},
{
"command": "pnpm@HEAD",
"mean": 3.4256479926466668,
"stddev": 0.13788434297424884,
"median": 3.41833809398,
"user": 5.202604491111111,
"system": 0.3265946066666667,
"min": 3.21219622198,
"max": 3.67475475298
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.39841411782,
"stddev": 0.10396555603432807,
"median": 4.35955686312,
"user": 1.42446144,
"system": 1.4789384399999999,
"min": 4.30327116912,
"max": 4.62694194912
},
{
"command": "pacquet@main",
"mean": 4.490617095819999,
"stddev": 0.14860212313563234,
"median": 4.45805890312,
"user": 1.51984474,
"system": 1.6122688399999998,
"min": 4.34216833612,
"max": 4.76812465612
},
{
"command": "pnpr@HEAD",
"mean": 3.46090956062,
"stddev": 0.09368351014809605,
"median": 3.4373439366199996,
"user": 1.34226004,
"system": 1.41147614,
"min": 3.3806406921199996,
"max": 3.7061968841199997
},
{
"command": "pnpr@main",
"mean": 3.5095114865199997,
"stddev": 0.151484966809873,
"median": 3.46724196062,
"user": 1.32459714,
"system": 1.4110120400000001,
"min": 3.3610147201199996,
"max": 3.80276583212
}
]
}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. Comparable to that scenario head-to-head.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.17059493816000001,
"stddev": 0.006455311189973632,
"median": 0.16846234316000003,
"user": 0.19471860000000002,
"system": 0.19965516857142857,
"min": 0.16470693016000001,
"max": 0.18948290116000002
},
{
"command": "pacquet@main",
"mean": 0.16914208129333333,
"stddev": 0.003979251505796161,
"median": 0.16898986016,
"user": 0.2050996333333333,
"system": 0.19045737333333335,
"min": 0.16227659316,
"max": 0.17542935216000002
},
{
"command": "pnpr@HEAD",
"mean": 0.20115623416,
"stddev": 0.026864665137818537,
"median": 0.19433419816000003,
"user": 0.22176956666666664,
"system": 0.2142341733333334,
"min": 0.17489731216,
"max": 0.26824099116
},
{
"command": "pnpr@main",
"mean": 0.17762460616000003,
"stddev": 0.003961635438304524,
"median": 0.17780987416000002,
"user": 0.20893050000000002,
"system": 0.18339010666666664,
"min": 0.16803028516000001,
"max": 0.18293317316000002
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/14178 |
| 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) |
|---|---|---|
| gvs-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 174.90 ms |
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,413.29 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 335.85 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 326.17 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 102.57 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,303.90 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,380.64 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 306.56 ms |
| isolated-linker.repeat-install.cold-cache.hot-store | 📈 view plot | 5.79 ms |
| isolated-linker.repeat-install.hot-cache.hot-store | 📈 view plot | 6.11 ms |
Summary
pnpm fetchin 12.0.0-rc.11 failed any dependencypostinstallthat invokes asibling dependency's bin — the reporter hit it with
unrs-resolvercallingnapi-postinstall, which killed every Docker multi-stage build whose fetcherstage touches oxlint/eslint tooling:
pnpm install --frozen-lockfileagainst the same lockfile succeeded.In the Rust CLI,
run_link_phasereturned early undervirtual_store_only(which
pnpm fetchsets) before reachingLinkVirtualStoreBins, whilerun_build_phasestill ran dependency lifecycle scripts under that mode. Thescripts therefore ran with no
node_modules/.binforpnpm_executor::extend_path's ancestor walk to find.The per-slot bin pass now runs under
virtual_store_onlytoo: its links liveinside the virtual store, which is exactly what that mode materializes. Only
the importer-facing passes — prune, direct-dependency symlinks, root
components, hoisting, and the module-resolution sidecars — stay skipped, so
fetchstill leaves the project untouched.The TypeScript CLI is unaffected: its
buildModuleslinks a dep node's binsitself right before running that node's scripts, which is why pnpm 11.11.0
worked. It gets the matching regression test only (plus the one-word
allowBuildswidening onFetchCommandOptionsthat the test needs to compile).Closes #14174
Second commit: comment cleanup in
linking.rslinking.rswas 38% comment lines, and touching it for this fix surfaced howmuch of that prose the code and the callees' own docs already carried — a call
site restating
HoistedLinkerOutput's field docs, a rationale duplicated atboth the declaration and the assignment, two comments sitting above the wrong
binding, and one sentence describing a mapping the call site does not perform.
The second commit removes those. Gate and ordering rationale stays: why a pass
is skipped under
nodeLinker: hoistedorvirtualStoreOnly, whyreconciliation precedes relinking, why the hoist plan is computed before
SymlinkDirectDependencies. Comment lines 192 → 117, code lines unchanged at301 — stripping comments from both revisions yields identical files.
Squash Commit Body
Checklist
already linked to it solves it.
pnpm/port, or the description notes what still needs porting.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).
Summary by CodeRabbit
Bug Fixes
pnpm fetchnow links dependency binaries in the virtual store, allowing permitted lifecycle scripts to invoke sibling commands.Tests