Repository navigation
Conversation
A package may declare `bundleDependencies: true` instead of a name list, which npm and pnpm both read as "every entry of `dependencies` ships inside this tarball". pacquet's lockfile writer only understood the list form, so the boolean was dropped from `packages:` — and the lockfile type could not represent it at all, which made a `pnpm-lock.yaml` written by pnpm 11 for such a package fail to parse. The field's presence is also the signal that a package carries a populated `node_modules` of its own, which the installer needs in order to link the bins that come with it. pacquet never linked those bins for either spelling: bundled packages are not lockfile children, so nothing in the per-slot bin walk ever saw them, and `<slot>/node_modules/<pkg>` was left without a `.bin` entry that pnpm 11 writes. Model the field as the `string[] | boolean` union pnpm records, read it through one shared constructor, and give a bundling slot a second bin pass over the package's own `node_modules`. Ports the upstream `bundledDependencies` install suite (`installing/deps-installer/test/install/bundledDependencies.ts`), which had no pacquet counterpart. It covers both manifest spellings, the boolean form across a frozen reinstall, and `false`. Refs #13326
The hoisted linker populates each `<parent>/node_modules/.bin` from the graph nodes at that level. Packages a tarball ships in its own `node_modules` are not graph nodes, so the pass never reached them and `has_bundled_dependencies` — computed off the lockfile row and stored on every node — had no reader at all. Give a bundling node the same second bin pass upstream's `linkAllBins` runs, over the package's own `node_modules`.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughBundled dependency metadata now preserves list and boolean forms in the lockfile. Isolated and hoisted linkers discover binaries from bundled packages’ internal ChangesBundled dependency support
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant PackageManager
participant Lockfile
participant BinLinker
participant PackageFilesystem
PackageManager->>Lockfile: read bundled_dependencies metadata
PackageManager->>BinLinker: provide bundling set
BinLinker->>PackageFilesystem: inspect bundled package node_modules
PackageFilesystem-->>BinLinker: return bundled binaries
BinLinker->>PackageFilesystem: create node_modules/.bin links
✨ 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 lockfile + bin linking for bundledDependencies (incl. boolean form)
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (5): Last reviewed commit: "test(cli): prove the hoisted bundled-bin..." | Re-trigger Greptile |
Micro-Benchmark ResultsLinux |
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13406 +/- ##
==========================================
+ Coverage 87.53% 87.55% +0.01%
==========================================
Files 542 544 +2
Lines 93294 93389 +95
==========================================
+ Hits 81665 81763 +98
+ Misses 11629 11626 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
`is_path_executable` is `#[cfg(unix)]`, so the ported suite failed to compile on Windows. Windows has no executable bit — the shim writer emits `.cmd` and `.ps1` siblings there instead — so assert the shim's existence everywhere and its executable bit only on Unix. Also pin `BundledDependencies::from_manifest` with unit tests, including the two shapes a reviewer is most likely to want changed: an empty list is recorded, matching what `pnpm install` writes for a package declaring `"bundledDependencies": []`, and a `false` under the preferred key falls through to the legacy spelling rather than vetoing it. Both round trip through the lockfile.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm/crates/cli/tests/bundled_dependencies.rs (1)
98-115: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winUnverified parity: hoisted linker's bundling signal vs. boolean
bundleDependencies: trueform, with no test to catch a mismatch. The isolated linker treats a package as bundling viabundled_dependencies.is_some()(true for both list and boolean forms), while the hoisted linker usesnode.has_bundled_dependencies, whose population isn't visible in this review and isn't exercised by any test with the boolean form.
pnpm/crates/cli/tests/bundled_dependencies.rs#L98-L115: extendbundled_bins_are_linked_under_the_hoisted_linker(or add a case) to also installpkg-with-bundle-dependencies-trueundernodeLinker: hoistedand assert its bin is linked.pnpm/crates/package-manager/src/link_hoisted_modules.rs#L255-L268: confirmDependenciesGraphNode::has_bundled_dependenciesis derived from "field present regardless of shape," matchingBundledDependencies::from_manifest(...).is_some(), so the new hoisted test above actually passes.As per path instructions ("REVIEW_GUIDE.md": "Tests—regression/e2e coverage must assert the actual lockfile field preservation and bin-link placement (including boolean/array/false forms and frozen reinstalls)" and "AGENTS.md": "pacquet (Rust) and the TypeScript pnpm CLI must be implemented together and kept behaviorally identical").
🤖 Prompt for 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. In `@pnpm/crates/cli/tests/bundled_dependencies.rs` around lines 98 - 115, Extend bundled_bins_are_linked_under_the_hoisted_linker in pnpm/crates/cli/tests/bundled_dependencies.rs:98-115 to install pkg-with-bundle-dependencies-true with nodeLinker set to hoisted and assert its bundled bin is linked, preserving coverage for the existing package. In pnpm/crates/package-manager/src/link_hoisted_modules.rs:255-268, update the DependenciesGraphNode::has_bundled_dependencies derivation to treat the bundled-dependencies field as present regardless of whether it is an array or boolean, matching BundledDependencies::from_manifest(...).is_some().
🤖 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.
Nitpick comments:
In `@pnpm/crates/cli/tests/bundled_dependencies.rs`:
- Around line 98-115: Extend bundled_bins_are_linked_under_the_hoisted_linker in
pnpm/crates/cli/tests/bundled_dependencies.rs:98-115 to install
pkg-with-bundle-dependencies-true with nodeLinker set to hoisted and assert its
bundled bin is linked, preserving coverage for the existing package. In
pnpm/crates/package-manager/src/link_hoisted_modules.rs:255-268, update the
DependenciesGraphNode::has_bundled_dependencies derivation to treat the
bundled-dependencies field as present regardless of whether it is an array or
boolean, matching BundledDependencies::from_manifest(...).is_some().
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d72845ff-4842-4af9-8832-c9c426f8a9ff
📒 Files selected for processing (8)
.changeset/bundled-dependencies-true.mdpnpm/crates/cli/tests/bundled_dependencies.rspnpm/crates/env-installer/src/manifest_lockfile.rspnpm/crates/lockfile/src/package_metadata.rspnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rspnpm/crates/package-manager/src/link_bins.rspnpm/crates/package-manager/src/link_hoisted_modules.rspnpm/plans/TEST_PORTING.md
The hoisted linker reaches the bundling signal through `DependenciesGraphNode::has_bundled_dependencies` rather than the lockfile row the isolated linker reads, so the two shapes need separate coverage there. Narrowing that derivation to the name-list form now fails the test.
|
Code review by qodo was updated up to the latest commit 6dc760b |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
On Windows nothing makes the extensionless shim invocable on its own — the `.cmd` and `.ps1` launchers written beside it do. Asserting only the shim's existence there would let a regression that stops emitting them pass as a linked bin.
|
Code review by qodo was updated up to the latest commit c82892d |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Thanks — three findings, addressed in "Windows shims untested" — fixed. "Empty bundle list treated bundled" — declining, with evidence. Recording the empty list is what pnpm 11 does, so dropping it would create the divergence rather than remove one. packages:
empty-bundle@file:pkg.tgz:
resolution: {integrity: sha512-9DWMwILV36mc/…, tarball: file:pkg.tgz}
version: 1.0.0
bundledDependencies: []The referenced #13346 precedent is about CodeRabbit's hoisted-linker nitpick — partially applied. The derivation was already shape-agnostic ( Written by an agent (Claude Code, claude-opus-5). |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
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.51119193248,
"stddev": 0.16063976737172167,
"median": 2.47730886638,
"user": 1.6439339399999997,
"system": 1.32260736,
"min": 2.34763042838,
"max": 2.75489593038,
"times": [
2.38159550338,
2.34763042838,
2.34817800838,
2.39319957438,
2.56141815838,
2.63840703438,
2.75489593038,
2.70107677738,
2.36359030638,
2.62192760338
]
},
{
"command": "pacquet@main",
"mean": 2.4695472693800005,
"stddev": 0.11725034769442531,
"median": 2.4459926898799997,
"user": 1.6376576399999998,
"system": 1.2767208599999997,
"min": 2.35193370538,
"max": 2.72726542238,
"times": [
2.55952500038,
2.56814288638,
2.38487038538,
2.35193370538,
2.44255448438,
2.36557239238,
2.72726542238,
2.45647361538,
2.38970390638,
2.44943089538
]
},
{
"command": "pnpr@HEAD",
"mean": 1.53353391588,
"stddev": 0.1264802145738599,
"median": 1.50137195588,
"user": 1.19897714,
"system": 1.12152226,
"min": 1.36398566538,
"max": 1.74626982538,
"times": [
1.60001261238,
1.36398566538,
1.48940573538,
1.74626982538,
1.7124095643800001,
1.43071769938,
1.59541286138,
1.44033783138,
1.51333817638,
1.44344918738
]
},
{
"command": "pnpr@main",
"mean": 1.55236459318,
"stddev": 0.1442350867376007,
"median": 1.55088066088,
"user": 1.1899991399999998,
"system": 1.13221136,
"min": 1.3512023903800001,
"max": 1.74960479838,
"times": [
1.5125968253800002,
1.58916449638,
1.47321494538,
1.63368948138,
1.3512023903800001,
1.36838857338,
1.74960479838,
1.44466674038,
1.7371698103800002,
1.66394787038
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25073253310000004,
"stddev": 0.004009322076334034,
"median": 0.2514398641,
"user": 0.19946585999999997,
"system": 0.5003151799999999,
"min": 0.24594856210000002,
"max": 0.25704037910000005,
"times": [
0.2469535291,
0.24594856210000002,
0.25612273310000006,
0.2506846971,
0.2522751751,
0.2521950311,
0.25248613410000004,
0.25704037910000005,
0.2464315071,
0.24718758310000002
]
},
{
"command": "pacquet@main",
"mean": 0.24932510189999996,
"stddev": 0.006714424060014539,
"median": 0.2472618411,
"user": 0.20211036,
"system": 0.50932798,
"min": 0.2424051201,
"max": 0.26505389110000005,
"times": [
0.2519434601,
0.26505389110000005,
0.2424051201,
0.24671412310000002,
0.2427563151,
0.2450762341,
0.2543879231,
0.2468651191,
0.25039027010000003,
0.2476585631
]
},
{
"command": "pnpr@HEAD",
"mean": 0.26438091700000005,
"stddev": 0.006914765350008099,
"median": 0.2614803976000001,
"user": 0.20121926,
"system": 0.51159718,
"min": 0.2550244481,
"max": 0.27632850910000006,
"times": [
0.2550244481,
0.26028443810000007,
0.25953989410000006,
0.27632850910000006,
0.26267635710000004,
0.2717628731,
0.26779705910000007,
0.2601864601,
0.27110919210000006,
0.25909993910000007
]
},
{
"command": "pnpr@main",
"mean": 0.26615996080000004,
"stddev": 0.003109080603748466,
"median": 0.26555140410000005,
"user": 0.21379186,
"system": 0.49760398000000006,
"min": 0.2604312241,
"max": 0.27105799810000003,
"times": [
0.2676337831,
0.26513108910000005,
0.2674473191,
0.27031652010000007,
0.27105799810000003,
0.26597171910000006,
0.26442047110000005,
0.2647710401,
0.26441844410000004,
0.2604312241
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7627622071800007,
"stddev": 0.01371224656658172,
"median": 2.7652750517799998,
"user": 1.84006262,
"system": 1.36048804,
"min": 2.7386488667799997,
"max": 2.77933272378,
"times": [
2.75119168878,
2.75314100478,
2.76672659578,
2.77424731978,
2.77756102478,
2.76382350778,
2.77933272378,
2.7723989697799998,
2.7386488667799997,
2.75055036978
]
},
{
"command": "pacquet@main",
"mean": 2.7387918991799998,
"stddev": 0.016925085673010643,
"median": 2.73476881178,
"user": 1.86300652,
"system": 1.29232754,
"min": 2.70637692678,
"max": 2.76465098578,
"times": [
2.7530618317799997,
2.75931822378,
2.73461057878,
2.76465098578,
2.73492704478,
2.73426139178,
2.72808268778,
2.73112639078,
2.70637692678,
2.7415029297799998
]
},
{
"command": "pnpr@HEAD",
"mean": 1.56406685478,
"stddev": 0.153990465789278,
"median": 1.50700458778,
"user": 1.17557612,
"system": 1.1566545399999997,
"min": 1.4281476577799999,
"max": 1.84104299178,
"times": [
1.84104299178,
1.45785477578,
1.55615439978,
1.4281476577799999,
1.4321390997799999,
1.4476785907799998,
1.7316841247800001,
1.42874359778,
1.58229776778,
1.73492554178
]
},
{
"command": "pnpr@main",
"mean": 1.6762080650799998,
"stddev": 0.14198967046418803,
"median": 1.68743994178,
"user": 1.17773982,
"system": 1.15730954,
"min": 1.46303853078,
"max": 1.86855914278,
"times": [
1.86855914278,
1.5102034307799999,
1.6925534897799999,
1.6335779067799998,
1.85978286378,
1.46303853078,
1.53289558678,
1.7839928187799998,
1.7351504867799998,
1.68232639378
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5939411783,
"stddev": 0.010228697899014207,
"median": 0.5908989249000001,
"user": 0.69684346,
"system": 0.6812757800000001,
"min": 0.5839868524,
"max": 0.6102368494000001,
"times": [
0.6030409724000001,
0.5947541304,
0.5842090204000001,
0.5870437194000001,
0.6072005854000001,
0.5858944714000001,
0.6102368494000001,
0.5844876294000001,
0.5839868524,
0.5985575524000001
]
},
{
"command": "pacquet@main",
"mean": 0.5795149936,
"stddev": 0.01463519570919841,
"median": 0.5761742049,
"user": 0.70129206,
"system": 0.6638950799999999,
"min": 0.5601469504000001,
"max": 0.6087853344,
"times": [
0.5722283874,
0.5682969484000001,
0.5751595904000001,
0.5601469504000001,
0.6087853344,
0.5986058334000001,
0.5693411934000001,
0.5812369654,
0.5771888194000001,
0.5841599134000001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.2986604379,
"stddev": 0.007130824887414514,
"median": 0.2978018399000001,
"user": 0.19925915999999996,
"system": 0.4893331799999999,
"min": 0.28954395340000005,
"max": 0.30847589940000003,
"times": [
0.30071964940000007,
0.29291506140000007,
0.30674429640000006,
0.30567604740000004,
0.28954395340000005,
0.29353232840000004,
0.29488403040000005,
0.30340728540000006,
0.30847589940000003,
0.29070582740000006
]
},
{
"command": "pnpr@main",
"mean": 0.30433140129999997,
"stddev": 0.006256309140693784,
"median": 0.30413477040000003,
"user": 0.19151586,
"system": 0.5022093799999999,
"min": 0.29597254840000004,
"max": 0.31365370840000006,
"times": [
0.30984418140000003,
0.2993342124,
0.3093614954,
0.29597254840000004,
0.2963234564,
0.3036237574,
0.3101924924,
0.31365370840000006,
0.30464578340000004,
0.30036237740000005
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.90581104922,
"stddev": 0.015522316910315243,
"median": 1.90543867412,
"user": 0.9335902399999998,
"system": 0.7741174199999998,
"min": 1.88083708612,
"max": 1.92382747212,
"times": [
1.91644170412,
1.89331398212,
1.92223453312,
1.91264906412,
1.89630626112,
1.88083708612,
1.89822828412,
1.89159315712,
1.92382747212,
1.92267894812
]
},
{
"command": "pacquet@main",
"mean": 1.8948159347199998,
"stddev": 0.009327455664683295,
"median": 1.89505008812,
"user": 0.9438118400000001,
"system": 0.77531232,
"min": 1.87382545712,
"max": 1.90455764812,
"times": [
1.89887261412,
1.9044694361199999,
1.89635513312,
1.89153769612,
1.89209764312,
1.90381628012,
1.90455764812,
1.88888239612,
1.89374504312,
1.87382545712
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30014028172,
"stddev": 0.008357376824990104,
"median": 0.29946205912,
"user": 0.17697863999999996,
"system": 0.5136155199999999,
"min": 0.28939932312,
"max": 0.31309162412,
"times": [
0.29609729712,
0.29044685612000004,
0.29244348012000004,
0.30282682112000003,
0.29598390812,
0.30483285812,
0.30898964912000004,
0.31309162412,
0.30729100012000005,
0.28939932312
]
},
{
"command": "pnpr@main",
"mean": 0.30069986932000003,
"stddev": 0.004507199350818047,
"median": 0.30193278112,
"user": 0.19500153999999997,
"system": 0.49706031999999994,
"min": 0.29288933112000004,
"max": 0.30707129912000003,
"times": [
0.30390681212000004,
0.29288933112000004,
0.29961319012000004,
0.30707129912000003,
0.29780989812,
0.30362629412000003,
0.30116912712000005,
0.30269643512,
0.30377608312000004,
0.29444022312
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.36571942252,
"stddev": 0.008547263710353305,
"median": 0.36448685432000005,
"user": 0.35833136,
"system": 0.06755448000000001,
"min": 0.35498852132000003,
"max": 0.38395601632000004,
"times": [
0.36981112032,
0.35563104132,
0.36663321832,
0.37319735132000004,
0.36335032132,
0.36065292632,
0.36418393732000004,
0.35498852132000003,
0.38395601632000004,
0.36478977132
]
},
{
"command": "pacquet@main",
"mean": 0.37176958232,
"stddev": 0.010467598929014199,
"median": 0.37072211032,
"user": 0.35942265999999995,
"system": 0.07085388,
"min": 0.35596573732000003,
"max": 0.39293999232000004,
"times": [
0.36026945232,
0.37260446832000005,
0.37307655032000003,
0.39293999232000004,
0.36883180332000004,
0.36883975232000005,
0.37687589932000004,
0.35596573732000003,
0.36711240632000003,
0.38117976132000003
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08867432448129033,
"stddev": 0.0038109092947860284,
"median": 0.08726943632,
"user": 0.020828343870967745,
"system": 0.011012174193548387,
"min": 0.08531644032,
"max": 0.10444958932000001,
"times": [
0.08922382932,
0.08968239932000001,
0.09515218732000001,
0.08788666632,
0.08583963832000001,
0.08632993432000001,
0.08672489432000001,
0.08649509232000001,
0.08983107832000001,
0.08753103332,
0.08642726832,
0.08871273132,
0.09036270732000001,
0.09052824932,
0.08647021732,
0.09185586532000001,
0.08726943632,
0.08551783232,
0.10444958932000001,
0.08758264032,
0.08705128732,
0.08647673632000001,
0.08725484032000001,
0.08673227432000001,
0.08605196632,
0.08989502032,
0.09017268932000001,
0.08531644032,
0.08571279032000001,
0.08629142732,
0.09407529632
]
},
{
"command": "pnpr@main",
"mean": 0.08874133832000002,
"stddev": 0.002407513958840812,
"median": 0.08876656132,
"user": 0.0211287975,
"system": 0.010991623750000002,
"min": 0.08493338432000001,
"max": 0.09330954732,
"times": [
0.08634440032,
0.08493338432000001,
0.08596674532000001,
0.08754682032000001,
0.08730828532000001,
0.09088621632,
0.09071041832000001,
0.09330954732,
0.09167522032,
0.08936681532,
0.08674947732,
0.08569623832,
0.09239224732000001,
0.08960429532000001,
0.09168083932000001,
0.08545402132,
0.08710884632,
0.09144323232000001,
0.09077053932000001,
0.08846502732,
0.08906809532000001,
0.08610410132,
0.08636082132,
0.08833283132000001,
0.08997929232,
0.09086130432,
0.08612041832,
0.09027328932,
0.08798150932000001,
0.08578475232,
0.08936410632000001,
0.09207968732
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.52840329178,
"stddev": 0.1510704555639454,
"median": 4.44680996708,
"user": 1.8357266600000002,
"system": 1.4349689799999998,
"min": 4.42360624408,
"max": 4.83486941508,
"times": [
4.4368786700800005,
4.447164030080001,
4.83486941508,
4.42360624408,
4.43787401408,
4.4464559040800005,
4.747693868080001,
4.450775618080001,
4.43854759808,
4.62016755608
]
},
{
"command": "pacquet@main",
"mean": 4.4877442504800005,
"stddev": 0.13388761276231373,
"median": 4.44617460608,
"user": 1.7887362600000003,
"system": 1.4358067799999998,
"min": 4.4083368300800005,
"max": 4.86158963308,
"times": [
4.43540346108,
4.4489075940800005,
4.4083368300800005,
4.44607238708,
4.44627682508,
4.5063840420800005,
4.42064244308,
4.443383063080001,
4.86158963308,
4.46044622608
]
},
{
"command": "pnpr@HEAD",
"mean": 3.6020590949799995,
"stddev": 0.15187763588866204,
"median": 3.53979814958,
"user": 1.3031517599999998,
"system": 1.2541222799999998,
"min": 3.4454432810799998,
"max": 3.87763098108,
"times": [
3.87763098108,
3.62419843008,
3.6978508300799997,
3.4645507480799997,
3.48514857908,
3.52383851808,
3.52054367108,
3.8256281300799997,
3.4454432810799998,
3.55575778108
]
},
{
"command": "pnpr@main",
"mean": 3.4908471515799997,
"stddev": 0.05868962646084603,
"median": 3.46414416408,
"user": 1.26152856,
"system": 1.30496078,
"min": 3.43410455508,
"max": 3.61369957008,
"times": [
3.45479286508,
3.53139319708,
3.61369957008,
3.47971458408,
3.45941963608,
3.46886869208,
3.43410455508,
3.56204119608,
3.45915842408,
3.4452787960799998
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13406 |
| 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,428.15 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 289.40 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 289.54 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 85.32 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,363.99 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,445.44 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 255.02 ms |
Investigating pnpm#13326 showed its reproduction already matches pnpm 11 byte for byte, fixed by eab73b3 (pnpm#13374) filtering bundled names out of `extract_children`. Porting the upstream `bundledDependencies` install suite — which had no pacquet counterpart, and is why the original defect shipped — surfaced two gaps that fix did not cover. A manifest may declare `bundleDependencies: true` instead of a name list, which npm and pnpm both read as "every entry of `dependencies` ships inside this tarball". The lockfile writer only understood the list form, and `PackageMetadata::bundled_dependencies` was typed `Option<Vec<String>>`, so the boolean could neither be written nor read back — a `pnpm-lock.yaml` written by pnpm 11 for such a package failed to parse. Model the field as the `string[] | boolean` union pnpm records, behind one shared `BundledDependencies::from_manifest` that both the install and env-installer writers call. The field's presence is also what tells the installer a package carries a populated `node_modules` of its own whose bins belong in that package's `node_modules/.bin`. Bundled packages are not lockfile children, so neither linker reached them: the isolated path's per-slot walk iterates `snapshot.dependencies`, and the hoisted path iterates graph nodes — `has_bundled_dependencies` was computed and stored on every hoisted node but had no reader. Both paths now run the second bin pass upstream's `linkAllBins` and `building/during-install` run. No platform gate is added to the resolver. The issue asks for one, but pnpm 11 resolves the subtree of a platform-incompatible optional package too (`[email protected]` on Linux, `@img/sharp-darwin-arm64`'s libvips edge), and `skip_optional_dependency_that_does_not_support_the_current_os` already asserts pacquet matches that. Related to pnpm#13326
Summary
While investigating #13326 I found the reported divergence was already fixed — but the audit of the code that fixed it turned up two gaps in the same area that it did not cover, plus a whole upstream test suite with no pnpm 12 counterpart.
What #13326 turned out to be. The issue reports that pnpm 12 resolves the dependency subtree of a platform-incompatible optional package (
@tailwindcss/oxide-wasm32-wasiand six transitive packages). Running its exact reproduction against pnpm11.17.0and a HEAD build of pnpm 12 now produces byte-identicalpnpm-lock.yaml; the fix waseab73b3994(#13374), which taughtextract_childrento drop names a manifest declares inbundledDependencies— and@tailwindcss/oxide-wasm32-wasibundles exactly those six.The issue's stated expectation — that pnpm 11 skips resolving the subtree of a platform-incompatible optional package — does not hold. On Linux x64, pnpm 11 resolves the full 36-package subtree of the
darwin-only[email protected], and records@img/[email protected]with its@img/sharp-libvips-darwin-arm64edge; pnpm 12 matches both exactly. A 12-package sweep of the platform-heavy ecosystem (esbuild, rollup,@parcel/watcher, lightningcss, oxide, sharp,@swc/core, unrs-resolver, oxc-parser,@napi-rs/canvas, dmg-license,@sentry/profiling-node) is identical between the two stacks both natively and undersupportedArchitectures: {os: [darwin], cpu: [arm64]}. So this PR does not add a platform gate to the resolver — that would be a new divergence, and it would fail the existingskip_optional_dependency_that_does_not_support_the_current_ostest.What this PR does fix, both found by porting the upstream
bundledDependenciessuite:bundleDependencies: truewas dropped from the lockfile. A manifest may declare the boolean form instead of a name list, which npm and pnpm both read as "every entry ofdependenciesships inside this tarball". pacquet's writer only understood the list form, andPackageMetadata::bundled_dependencieswas typedOption<Vec<String>>— so the boolean could not even be represented, and apnpm-lock.yamlwritten by pnpm 11 for such a package failed to parse. The field is now modelled as thestring[] | booleanunion pnpm records, read through one sharedBundledDependencies::from_manifestused by both the install writer and the env-installer writer.Bundled bins were never linked. The field's presence is what tells the installer a package carries a populated
node_modulesof its own whose bins belong in that package'snode_modules/.bin(upstream:linkBinsOfPackages+ thehasBundledDependenciesbranch inbuilding/during-installanddeps-restorer). Bundled packages are not lockfile children, so neither pacquet linker ever saw them: the isolated path's per-slot bin walk iteratessnapshot.dependencies, and the hoisted path iterates graph nodes —has_bundled_dependencieswas computed and stored on every hoisted node but had no reader at all. Both paths now get the second bin pass over the package's ownnode_modules.Installing
@pnpm.e2e/[email protected]onmainproduces no.bindirectory inside the package; pnpm 11 writesnode_modules/@pnpm.e2e/pkg-with-bundled-dependencies/node_modules/.bin/hello-world-js-bin.Tests.
installing/deps-installer/test/install/bundledDependencies.tshad no pnpm 12 counterpart, which is why neither gap was caught. It is ported aspnpm/crates/cli/tests/bundled_dependencies.rs, covering both manifest spellings,false, and the boolean form across a frozen reinstall (which is what exercises the lockfile round trip), plus a pacquet-onlynodeLinker: hoistedcase. Each test was verified to fail against the unfixed implementation. The two local-tarball cases from that suite still need.tgzfixtures and are listed as unported inplans/TEST_PORTING.md.Related to #13326
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.(pacquet-only: the TypeScript CLI already records the boolean form and
links bundled bins. No TS change needed.)
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).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
bundledDependencies/bundleDependenciesin package metadata and lockfile output (including booleantrueform and alternate spelling).Bug Fixes
.bindirectory correctly for both isolated and hoisted installs, including when a package includes its ownnode_modules.Tests
Documentation