Repository navigation
Conversation
📝 WalkthroughWalkthroughLockfile metadata parsing now preserves scalar manifest ChangesLibc lockfile preservation
Estimated code review effort: 2 (Simple) | ~10 minutes Assessment against linked issues
Possibly related issues
Suggested labels: Suggested reviewers: ✨ 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 QodoPreserve scalar
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (2): Last reviewed commit: "fix(package-manager): scope scalar metad..." | 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 `@pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs`:
- Around line 600-612: Restrict scalar-string handling in read_string_list to
the libc field only, while preserving array parsing for all callers. Ensure
bundledDependencies and bundleDependencies use array-only behavior so a scalar
manifest value is ignored, and add coverage confirming malformed scalar bundle
metadata does not mark a package as bundled.
🪄 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: c1777390-a3d1-4f54-90eb-db483a128fce
📒 Files selected for processing (3)
.changeset/pacquet-preserve-string-libc.mdpnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rspnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests.rs
Micro-Benchmark ResultsLinux |
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1. Redundant libc array lookup
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13346 +/- ##
==========================================
+ Coverage 87.03% 87.04% +0.01%
==========================================
Files 533 535 +2
Lines 91682 91865 +183
==========================================
+ Hits 79791 79968 +177
- Misses 11891 11897 +6 ☔ 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.526785022320001,
"stddev": 0.17022605153305567,
"median": 2.47340299372,
"user": 1.5422539199999998,
"system": 1.2652332999999998,
"min": 2.3614004427200004,
"max": 2.80326883072,
"times": [
2.7791444227200004,
2.5045906537200002,
2.6537341847200002,
2.3725725857200004,
2.3614004427200004,
2.44221533372,
2.5858604087200003,
2.36434634572,
2.40071701472,
2.80326883072
]
},
{
"command": "pacquet@main",
"mean": 2.5277263268200003,
"stddev": 0.173196224611214,
"median": 2.46979208422,
"user": 1.5044236199999999,
"system": 1.3275178000000003,
"min": 2.3589505717200003,
"max": 2.7658787957200004,
"times": [
2.3589505717200003,
2.7658787957200004,
2.37813151272,
2.6999536557200003,
2.6346215547200003,
2.7619088367200004,
2.40137770272,
2.36303240972,
2.37520176272,
2.53820646572
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5197472255200002,
"stddev": 0.18215364035745754,
"median": 1.42234400172,
"user": 1.03076712,
"system": 1.1228859,
"min": 1.35409923872,
"max": 1.79036471372,
"times": [
1.35409923872,
1.59877294772,
1.44711268272,
1.39757532072,
1.39284381972,
1.78999347572,
1.70128938072,
1.35625242072,
1.36916825472,
1.79036471372
]
},
{
"command": "pnpr@main",
"mean": 1.51051581502,
"stddev": 0.13515378560440033,
"median": 1.49390044622,
"user": 1.0822547200000001,
"system": 1.0888068,
"min": 1.35752181272,
"max": 1.74020304972,
"times": [
1.69387613572,
1.48512482772,
1.59268910672,
1.40917120872,
1.37551561072,
1.38468874072,
1.35752181272,
1.56369159272,
1.50267606472,
1.74020304972
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25374815478,
"stddev": 0.008079634730340861,
"median": 0.25074984688,
"user": 0.20554566,
"system": 0.5082255,
"min": 0.24446830088000002,
"max": 0.27067991488,
"times": [
0.25285480288,
0.24767952888,
0.24808343588,
0.26195525788,
0.24864489088,
0.25715645988,
0.24857431988,
0.24446830088000002,
0.25738463588,
0.27067991488
]
},
{
"command": "pacquet@main",
"mean": 0.25605980518,
"stddev": 0.005807885870067467,
"median": 0.25677814338000005,
"user": 0.20180805999999998,
"system": 0.5394437999999999,
"min": 0.24442679288,
"max": 0.26572327988,
"times": [
0.25481903088,
0.25424669588,
0.26572327988,
0.25620676588,
0.24442679288,
0.25793282588,
0.25734952088,
0.25994734888,
0.25984004688,
0.25010574388
]
},
{
"command": "pnpr@HEAD",
"mean": 0.26729018858,
"stddev": 0.0061699534111929995,
"median": 0.26816095588,
"user": 0.21051786,
"system": 0.5325746,
"min": 0.25514541388,
"max": 0.27430806488,
"times": [
0.26847236088,
0.27430806488,
0.27292854588,
0.26784955088,
0.26222930188,
0.26499240888000003,
0.27278421488,
0.27215640688,
0.26203561688,
0.25514541388
]
},
{
"command": "pnpr@main",
"mean": 0.26851891618,
"stddev": 0.005251681801539492,
"median": 0.26730479888,
"user": 0.20780575999999992,
"system": 0.5389977,
"min": 0.26163797088,
"max": 0.27735611688,
"times": [
0.27735611688,
0.26163797088,
0.26510403788000003,
0.26820623088,
0.26561241188,
0.27048037088,
0.26959820488,
0.26640336688,
0.26383617788,
0.27695427288
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.76937767796,
"stddev": 0.02239824877237479,
"median": 2.76717525936,
"user": 1.66618684,
"system": 1.33496252,
"min": 2.73533528486,
"max": 2.80605710186,
"times": [
2.7466146888600003,
2.80605710186,
2.73533528486,
2.76534806686,
2.75755236686,
2.77568886486,
2.76900245186,
2.77565618286,
2.7591834408600002,
2.80333832986
]
},
{
"command": "pacquet@main",
"mean": 2.7531564006600004,
"stddev": 0.027917336257668318,
"median": 2.75548137436,
"user": 1.6769827399999997,
"system": 1.2871200200000001,
"min": 2.71105814386,
"max": 2.79406197586,
"times": [
2.73787270386,
2.71105814386,
2.77339221286,
2.79406197586,
2.78645641786,
2.76600089686,
2.73365376286,
2.71810514386,
2.75147117086,
2.75949157786
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5972877701600001,
"stddev": 0.16061569922663105,
"median": 1.54650555636,
"user": 1.0414743400000002,
"system": 1.13324982,
"min": 1.43441234586,
"max": 1.8738142178600001,
"times": [
1.43856716486,
1.43441234586,
1.46144257886,
1.56762094586,
1.8738142178600001,
1.64961695586,
1.7112009168600002,
1.82424897086,
1.52539016686,
1.4865634378600001
]
},
{
"command": "pnpr@main",
"mean": 1.64369344136,
"stddev": 0.14962237734034314,
"median": 1.58728139886,
"user": 1.00396214,
"system": 1.13599922,
"min": 1.43254826586,
"max": 1.86642444486,
"times": [
1.53454785786,
1.8221969118599999,
1.5033026138599999,
1.71066211586,
1.81340505286,
1.57928435286,
1.58877858386,
1.43254826586,
1.86642444486,
1.58578421386
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5817932980000001,
"stddev": 0.010695290831516744,
"median": 0.5809552747,
"user": 0.72752116,
"system": 0.66418684,
"min": 0.5626272577,
"max": 0.5984818977,
"times": [
0.5750796147,
0.5984818977,
0.5747960217000001,
0.5850966387000001,
0.5773085287,
0.5973703807,
0.5820763287,
0.5852620907,
0.5798342207,
0.5626272577
]
},
{
"command": "pacquet@main",
"mean": 0.5670866739000001,
"stddev": 0.008835750885004205,
"median": 0.5662748402,
"user": 0.68133346,
"system": 0.6644199399999999,
"min": 0.5559122247,
"max": 0.5787086127000001,
"times": [
0.5775160407000001,
0.5705138987,
0.5561052987,
0.5559122247,
0.5605336207,
0.5756221197000001,
0.5724481197000001,
0.5787086127000001,
0.5614710217000001,
0.5620357817
]
},
{
"command": "pnpr@HEAD",
"mean": 0.3021488445,
"stddev": 0.0030759825057911326,
"median": 0.30137919020000004,
"user": 0.18665866000000003,
"system": 0.53415484,
"min": 0.29791364470000004,
"max": 0.30848446970000004,
"times": [
0.3048321527,
0.30848446970000004,
0.3014612137,
0.3012971667,
0.3012260337,
0.29791364470000004,
0.30452545770000006,
0.2989672427,
0.30071707770000006,
0.30206398570000004
]
},
{
"command": "pnpr@main",
"mean": 0.3001135071,
"stddev": 0.0034053567965104375,
"median": 0.3006706697,
"user": 0.18545375999999997,
"system": 0.54522034,
"min": 0.29509039470000004,
"max": 0.3062220527,
"times": [
0.2959474917,
0.29509039470000004,
0.2996633387,
0.29718175970000005,
0.30246006970000006,
0.3062220527,
0.30173026970000005,
0.29905377470000005,
0.30210791870000003,
0.3016780007
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.8987678091,
"stddev": 0.009311915760526292,
"median": 1.8946511907999999,
"user": 0.89848204,
"system": 0.76860308,
"min": 1.8889546163000002,
"max": 1.9140929723,
"times": [
1.9140929723,
1.8919600693,
1.8889546163000002,
1.8908207612999999,
1.8911610693,
1.9022678902999999,
1.8955301903,
1.8937721912999999,
1.9103615173,
1.9087568133
]
},
{
"command": "pacquet@main",
"mean": 1.8930739491999997,
"stddev": 0.006027248710956463,
"median": 1.8943239773,
"user": 0.91569194,
"system": 0.7327349799999998,
"min": 1.8803715423,
"max": 1.9005941783,
"times": [
1.8971076023,
1.8964359013,
1.8985345323,
1.8918531893000001,
1.8803715423,
1.8867547073,
1.8946129393,
1.9005941783,
1.8904398842999999,
1.8940350152999998
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30150374020000004,
"stddev": 0.006559615126833881,
"median": 0.3000490418,
"user": 0.18830454,
"system": 0.53118368,
"min": 0.2952858553,
"max": 0.3175742293,
"times": [
0.30689486930000004,
0.3007890253,
0.2961661273,
0.3175742293,
0.2952858553,
0.30152122230000006,
0.29796167830000003,
0.2976607733,
0.3018745633,
0.29930905830000004
]
},
{
"command": "pnpr@main",
"mean": 0.2998841119,
"stddev": 0.0042176336901664155,
"median": 0.29971411330000003,
"user": 0.21603714,
"system": 0.50698418,
"min": 0.2937191033,
"max": 0.30971354230000003,
"times": [
0.2979696533,
0.30197146630000005,
0.30159499030000003,
0.2976614953,
0.29998201230000004,
0.2996580133,
0.30971354230000003,
0.2937191033,
0.29977021330000003,
0.2968006293
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.34995630436,
"stddev": 0.014728233516505627,
"median": 0.34664684546,
"user": 0.34379803999999997,
"system": 0.05134141999999999,
"min": 0.33464841546,
"max": 0.38351136146000003,
"times": [
0.33584659546000006,
0.33464841546,
0.34016944046,
0.34003712146000004,
0.35689421946000005,
0.35581316046000006,
0.34488733646,
0.35934903846000005,
0.34840635446000007,
0.38351136146000003
]
},
{
"command": "pacquet@main",
"mean": 0.35240304096,
"stddev": 0.00798781201076042,
"median": 0.34910782696000003,
"user": 0.3414017399999999,
"system": 0.06119912000000001,
"min": 0.34469722046000006,
"max": 0.36455957146000006,
"times": [
0.35154402546,
0.36455957146000006,
0.34469722046000006,
0.36194421046,
0.34667162846000005,
0.34505174646000003,
0.36144821846,
0.35657053246000003,
0.34657425546000004,
0.34496900046000006
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08718974606606064,
"stddev": 0.0009425063329685743,
"median": 0.08731317346000002,
"user": 0.020362261212121206,
"system": 0.009095546666666662,
"min": 0.08486264246000001,
"max": 0.08993168946,
"times": [
0.08695252646000001,
0.08693933146000002,
0.08522248846000001,
0.08682848346000001,
0.08649847446000002,
0.08731317346000002,
0.08627207946000001,
0.08538895046000002,
0.08993168946,
0.08486264246000001,
0.08743219746000001,
0.08761747446000001,
0.08743881846000001,
0.08747757246000001,
0.08721364646000002,
0.08762043046000001,
0.08734430246000001,
0.08764872346000001,
0.08668923246000002,
0.08752382946000001,
0.08865309846000001,
0.08633693146000002,
0.08718171746000002,
0.08784112546000002,
0.08684261046000001,
0.08807670746000001,
0.08757676746000001,
0.08696733346000002,
0.08695864846000001,
0.08757958346000001,
0.08724780146000001,
0.08801812646000001,
0.08776510146000001
]
},
{
"command": "pnpr@main",
"mean": 0.08727546086625002,
"stddev": 0.0013382000672926028,
"median": 0.08719062346,
"user": 0.01945554624999999,
"system": 0.01053251875,
"min": 0.08420192246000001,
"max": 0.09055765546000001,
"times": [
0.08902095046000001,
0.08612980146000002,
0.08526553846000001,
0.08765667846000001,
0.08670527246000001,
0.08795591046000001,
0.09010648646000001,
0.08584204146000002,
0.08698050846000001,
0.08772500646000002,
0.08779980746000002,
0.08725451346000002,
0.08665786346000001,
0.08771704246,
0.08815516446000002,
0.08626106846,
0.08712632246000002,
0.08839722946000002,
0.08566991846000001,
0.08740899346000001,
0.08704532946000001,
0.08689206346000002,
0.08420192246000001,
0.08737813546,
0.08878508646000001,
0.08497956246000002,
0.08769680446000001,
0.08704840646,
0.08699915446,
0.08826777546000002,
0.08712673346000001,
0.09055765546000001
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.54294491026,
"stddev": 0.15332954246900948,
"median": 4.44123870336,
"user": 1.73191192,
"system": 1.31065698,
"min": 4.41684707036,
"max": 4.78990401336,
"times": [
4.6491686233600005,
4.45309337936,
4.42269437836,
4.42938402736,
4.703908092360001,
4.72259973536,
4.78990401336,
4.42440784536,
4.41684707036,
4.4174419373600005
]
},
{
"command": "pacquet@main",
"mean": 4.5377854199600005,
"stddev": 0.1618253006568586,
"median": 4.47259792336,
"user": 1.6816515200000002,
"system": 1.3566876799999998,
"min": 4.42108474036,
"max": 4.88732326736,
"times": [
4.45319103336,
4.791697084360001,
4.48993141936,
4.42108474036,
4.473195560360001,
4.48564229736,
4.451292690360001,
4.45249582036,
4.47200028636,
4.88732326736
]
},
{
"command": "pnpr@HEAD",
"mean": 3.4828485051599998,
"stddev": 0.040876549031726765,
"median": 3.47218637686,
"user": 1.16767262,
"system": 1.1830695799999997,
"min": 3.4376754583599998,
"max": 3.5556258813599997,
"times": [
3.44941732136,
3.5556258813599997,
3.46985475936,
3.52683509136,
3.4376754583599998,
3.44218029436,
3.4745179943599998,
3.51793848936,
3.45018649536,
3.5042532663599997
]
},
{
"command": "pnpr@main",
"mean": 3.5164435783599997,
"stddev": 0.08473695893290097,
"median": 3.48563635186,
"user": 1.1906032199999999,
"system": 1.18265698,
"min": 3.44435970736,
"max": 3.72024125936,
"times": [
3.46814546036,
3.59445741036,
3.46925159736,
3.72024125936,
3.52197980536,
3.52758952636,
3.44435970736,
3.46522871536,
3.50202110636,
3.45116119536
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13346 |
| 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,434.41 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 295.29 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 297.91 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 84.86 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,354.10 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,437.68 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 255.15 ms |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs (1)
600-602: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep the rustdoc focused on the contract.
This private helper’s comment mostly restates its implementation. Remove it or document only the non-obvious behavior, such as malformed or missing metadata returning
None.As per coding guidelines, comments should explain only non-obvious invariants, workarounds, deliberate exceptions, or contracts.
🤖 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/package-manager/src/dependencies_graph_to_lockfile.rs` around lines 600 - 602, Refine or remove the rustdoc for the private JSON-array helper so it documents only the non-obvious contract: missing or malformed metadata, including arrays without string values, returns None. Remove implementation details about reading, flattening, and Vec<String> construction.Source: Coding guidelines
🤖 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/package-manager/src/dependencies_graph_to_lockfile.rs`:
- Around line 600-602: Refine or remove the rustdoc for the private JSON-array
helper so it documents only the non-obvious contract: missing or malformed
metadata, including arrays without string values, returns None. Remove
implementation details about reading, flattening, and Vec<String> construction.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c81a2933-74a3-41a9-895b-2a6de07c0443
📒 Files selected for processing (2)
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rspnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests.rs
|
Code review by qodo was updated up to the latest commit 1e9881c |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
The scalar libc regression test covered the string branch added in #13346, while Codecov identified the array and invalid-value branches as uncovered. Exercise both remaining shapes directly so the parser keeps accepting arrays and rejecting malformed metadata without changing production behavior. Follow-up to #13346.
Registry package manifests may express `libc` as a plain string. Pacquet's dependency-graph-to-lockfile conversion only accepted arrays, so fresh lockfiles silently omitted those platform constraints. Accept both string and array `libc` metadata in that conversion while keeping other manifest list fields array-only. Cover the scalar form with a regression test based on sass-embedded's Linux variants, including a check that malformed scalar bundle metadata remains ignored. Closes pnpm#13324.
The scalar libc regression test covered the string branch added in pnpm#13346, while Codecov identified the array and invalid-value branches as uncovered. Exercise both remaining shapes directly so the parser keeps accepting arrays and rejecting malformed metadata without changing production behavior. Follow-up to pnpm#13346.
The install loaded only the global and project pnpmfiles, so a config dependency plugin's pnpmfile contributed its updateConfig hook and nothing else. Its readPackage, afterAllResolved and custom resolvers never ran, and pnpmfileChecksum left it out. pnpm 11 puts plugin pnpmfiles in the same requireHooks set as the project's. PnpmfileSelection now carries the config dependencies, and find_pnpmfiles returns the global pnpmfile, then the installed plugin pnpmfiles, then the project's own, which is pnpm 11's order. Every consumer of the selection now sees the same set: install, update, deploy, the lockfile freshness checks, the optimistic repeat-install state, and the updateConfig/beforePacking pass. The updateConfig pass used to run plugins ahead of the global pnpmfile and now runs them after it, as pnpm 11 does. The up-to-date fast path already bails out whenever config dependencies exist, so it is unaffected. The workspace state's pnpmfile list now includes plugin pnpmfiles, as pnpm 11's does. A state written before this change therefore triggers one re-validation. Closes pnpm/pnpm#12366. Its env-lockfile items were already fixed by #13382, #13346 and #13436. This was the last lockfile divergence found while verifying them. --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
libcconstraints from registry manifests when pacquet generates a fresh lockfile.libcmetadata in the dependency-graph conversion while keeping other list fields array-only.Closes #13324.
Squash Commit Body
Checklist
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 (Codex, gpt-5).
Summary by CodeRabbit
libcconstraints (for example,"musl") instead of dropping them.libcis captured properly when declared as a string, and that non-array bundled dependency metadata is not serialized.