Repository navigation
feat(napi): add returnListOfDepsRequiringBuild install option - #13532
Conversation
The napi install result populated depsRequiringBuild from the ignored- builds accumulation only, so an embedder that allows dependency builds to run (Bit) always received an empty list and wiped its recorded bit.depsRequiringBuild lockfile block on every install. Mirror the TypeScript engine's returnListOfDepsRequiringBuild option: when set, the fresh-resolve path reports every non-skipped package whose files carry install scripts, regardless of the allow-build policy, through a sink threaded into the install pipeline. Installs served from the frozen-lockfile path leave the field undefined so the embedder keeps its previously recorded list, matching the TS engine, which only computes the list from a fresh resolve's fetch results. Co-Authored-By: Claude Fable 5 <[email protected]>
The singular is already listed; the plural appears in the changeset for the napi returnListOfDepsRequiringBuild option. Co-Authored-By: Claude Fable 5 <[email protected]>
📝 WalkthroughWalkthroughThe NAPI install API adds ChangesDependency build reporting
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Embedder
participant NAPI
participant PackageManager
participant FreshLockfileInstall
Embedder->>NAPI: Enable returnListOfDepsRequiringBuild
NAPI->>PackageManager: Pass optional build sink
PackageManager->>FreshLockfileInstall: Forward sink on fresh resolution
FreshLockfileInstall-->>NAPI: Record requiring-build dependency paths
NAPI-->>Embedder: Return depsRequiringBuild
Possibly related PRs
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 QodoAdd
AI Description
Diagram
High-Level Assessment
Files changed (20)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains, and no prior inline Greptile thread was available to anchor an eligible follow-up finding. Reviews (4): Last reviewed commit: "refactor(napi): align the depsRequiringB..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/napi/src/install.rs`:
- Around line 257-284: Add focused test cases to validate the NAPI install()
function's return value for the returnListOfDepsRequiringBuild field. Create
tests that cover sorted nonempty dependency outputs, explicit empty lists
(confirming an empty tree has no build-needing packages), behavior differences
between blocked and permitted builds, frozenLockfile repeat install scenarios,
and lockfileOnly mode behavior where the field should return undefined. Ensure
these tests exercise the result path shown in the deps_requiring_build match
expression that selects between the sink-returned list and the fallback
stats-based list.
In `@pnpm/crates/napi/src/install/tests.rs`:
- Around line 227-272: Expand
return_list_of_deps_requiring_build_reports_fresh_resolves_only to cover
multiple install-script dependencies and assert their reported entries are
alphabetically ordered, then add a separate install variant without
dangerously_allow_all_builds or an explicit allow-list entry to verify
blocked-but-not-skipped packages still populate DepsRequiringBuildSink. Preserve
the existing fresh-resolution and frozen-path assertions.
🪄 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: 12b821bf-ec32-4361-922a-4db59f1d0792
📒 Files selected for processing (20)
.changeset/tidy-moons-repeat.mdcspell.jsonpnpm/crates/cli/src/cli_args/dedupe.rspnpm/crates/cli/src/cli_args/deploy.rspnpm/crates/cli/src/cli_args/fetch.rspnpm/crates/cli/src/cli_args/import.rspnpm/crates/cli/src/cli_args/install.rspnpm/crates/cli/src/cli_args/link.rspnpm/crates/cli/src/cli_args/prune.rspnpm/crates/cli/src/cli_args/rebuild.rspnpm/crates/napi/src/install.rspnpm/crates/napi/src/install/tests.rspnpm/crates/package-manager/src/add.rspnpm/crates/package-manager/src/install.rspnpm/crates/package-manager/src/install/tests.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm/crates/package-manager/src/remove.rspnpm/crates/package-manager/src/update.rspnpm/npm/napi/index.d.tspnpr/crates/pnpr/src/resolver/resolve.rs
Micro-Benchmark ResultsLinux |
Code Review by Qodo
Context used✅ Compliance rules (platform):
32 rules 1. dbg! left in test
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13532 +/- ##
=======================================
Coverage 87.91% 87.92%
=======================================
Files 550 550
Lines 96399 96449 +50
=======================================
+ Hits 84752 84803 +51
+ Misses 11647 11646 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Extract the result assembly into deps_requiring_build_result so the empty-list-versus-uncomputed distinction and the sorted output are testable without the napi threadsafe-function symbols that the addon entry point needs (a test binary cannot link them). Cover, per CodeRabbit review on #13532: sorted multi-entry output, an explicit empty list, the pre-option blocked-builds fallback, packages whose builds the default policy blocked, and the three runs that compute no list (repeat install, frozenLockfile, lockfileOnly). Co-Authored-By: Claude Fable 5 <[email protected]>
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/napi/src/install/tests.rs`:
- Around line 230-294: Extend the install-level coverage around
return_list_of_deps_requiring_build_reports_every_script_bearing_package and the
existing install fixtures. Add a fresh-install fixture with no script-bearing
packages and assert the sink reports a computed empty list, then add a
script-bearing package made non-installable and assert it is excluded while
other eligible packages remain. Preserve the distinction between computed Some
results and an uncomputed None result.
🪄 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: e3388019-7d13-40f3-87cf-509d3caca6c8
📒 Files selected for processing (2)
pnpm/crates/napi/src/install.rspnpm/crates/napi/src/install/tests.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- pnpm/crates/napi/src/install.rs
|
Code review by qodo was updated up to the latest commit f88f20d |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Assert the empty list end to end (a tree whose packages carry no install scripts) and that a script-bearing package this install skips stays out, rather than only constructing the empty set in the helper test. Drop the skipped-snapshot filter from the sink fill. It could never match: CreateVirtualStore keeps both cache-key passes free of skipped snapshots, and a cold snapshot whose fetch failed records the failure instead of a requiresBuild entry, so the map holds only what the install put on disk. State that invariant where the list is built instead of implying a case that cannot occur. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Code review by qodo was updated up to the latest commit 50bce22 |
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": 3.05004748768,
"stddev": 0.16182310830547936,
"median": 3.06762515048,
"user": 3.300314,
"system": 2.36489896,
"min": 2.78173534198,
"max": 3.29229538998,
"times": [
3.1188541789800004,
3.0573694869800003,
3.07679887998,
3.05845142098,
3.29229538998,
2.83222207798,
3.20434159298,
2.78173534198,
2.92100638098,
3.15740012598
]
},
{
"command": "pacquet@main",
"mean": 2.8114996095800002,
"stddev": 0.2126725272124156,
"median": 2.8006786259800003,
"user": 2.9143777999999996,
"system": 2.11940496,
"min": 2.4742743759800003,
"max": 3.1912469379800004,
"times": [
3.1912469379800004,
2.8147523149800002,
2.7175715189800003,
2.7866049369800003,
3.0834920409800004,
2.84488100198,
2.76157806398,
2.5695282509800004,
2.87106665298,
2.4742743759800003
]
},
{
"command": "pnpr@HEAD",
"mean": 1.63686778368,
"stddev": 0.1674474011513326,
"median": 1.62216168548,
"user": 1.6338192,
"system": 1.4894844599999997,
"min": 1.39769831998,
"max": 1.8865668339800001,
"times": [
1.63494059598,
1.39769831998,
1.59736363398,
1.82085285998,
1.7351775069800002,
1.77861476298,
1.60938277498,
1.8865668339800001,
1.45112385998,
1.45695668798
]
},
{
"command": "pnpr@main",
"mean": 1.5486793641800003,
"stddev": 0.0965614750213917,
"median": 1.5479552279800002,
"user": 1.6873047999999997,
"system": 1.6321703599999995,
"min": 1.40148323598,
"max": 1.69503520198,
"times": [
1.45856503898,
1.69503520198,
1.40148323598,
1.67341482098,
1.5513079009800002,
1.54460255498,
1.56687700998,
1.44310840798,
1.62167586398,
1.53072360598
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.35052581204000005,
"stddev": 0.014797158196567135,
"median": 0.34959276644000004,
"user": 0.28833622,
"system": 0.6859304199999998,
"min": 0.33357520894000003,
"max": 0.38292265894,
"times": [
0.35839872994,
0.33942034394000004,
0.35470036394000004,
0.33357520894000003,
0.33544022494000003,
0.34210981494000003,
0.35491461794,
0.38292265894,
0.34448516894000003,
0.35929098794000003
]
},
{
"command": "pacquet@main",
"mean": 0.35168548984,
"stddev": 0.023009895481728746,
"median": 0.35251827694000004,
"user": 0.28570182,
"system": 0.69130272,
"min": 0.29935045494,
"max": 0.38123792394,
"times": [
0.37071376094,
0.35716081794000004,
0.35334342494000004,
0.38123792394,
0.34320662794,
0.35169312894,
0.34467388094,
0.34094925394000003,
0.29935045494,
0.37452562394
]
},
{
"command": "pnpr@HEAD",
"mean": 0.36230663864,
"stddev": 0.04761558553964392,
"median": 0.34733640344000005,
"user": 0.29772731999999996,
"system": 0.66769302,
"min": 0.31317062894000003,
"max": 0.45977993594,
"times": [
0.45977993594,
0.42622960494,
0.37939646194000004,
0.33204550294,
0.33237688194000004,
0.32226361794,
0.31317062894000003,
0.35846590294,
0.33620690394,
0.36313094494000003
]
},
{
"command": "pnpr@main",
"mean": 0.36698163674,
"stddev": 0.013762354454344594,
"median": 0.36847458844000003,
"user": 0.30140231999999995,
"system": 0.6951853200000001,
"min": 0.33527407694,
"max": 0.38654476594000003,
"times": [
0.36943207594,
0.36204904594000004,
0.33527407694,
0.36061783294,
0.36751710094,
0.38654476594000003,
0.37921057494000004,
0.37585916894000004,
0.36375356694,
0.36955815794
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.95098181766,
"stddev": 0.058458297314754715,
"median": 2.93763607236,
"user": 2.8053571799999997,
"system": 2.2149423599999998,
"min": 2.88510507786,
"max": 3.06840995186,
"times": [
2.91374293086,
2.89772469786,
2.91325430886,
3.06840995186,
2.9057495538600002,
3.00479783186,
2.96809103886,
2.88510507786,
2.99141357086,
2.96152921386
]
},
{
"command": "pacquet@main",
"mean": 2.7663002514600006,
"stddev": 0.04045766209109048,
"median": 2.76152141436,
"user": 2.41817868,
"system": 1.9046718599999999,
"min": 2.69541648786,
"max": 2.82041409686,
"times": [
2.82041409686,
2.74959947586,
2.79838670486,
2.7905918508600003,
2.7308432158600002,
2.7403419488600003,
2.77344335286,
2.81666777986,
2.69541648786,
2.74729760086
]
},
{
"command": "pnpr@HEAD",
"mean": 1.69519609006,
"stddev": 0.12827517209526965,
"median": 1.67788939486,
"user": 1.78275598,
"system": 1.74146106,
"min": 1.56839978286,
"max": 1.98449991686,
"times": [
1.60390443886,
1.69903605486,
1.65674273486,
1.56839978286,
1.80010350186,
1.59349684886,
1.70461774686,
1.5815852168600002,
1.98449991686,
1.75957465786
]
},
{
"command": "pnpr@main",
"mean": 1.7652887198600002,
"stddev": 0.1470649467011214,
"median": 1.78358663436,
"user": 1.62936868,
"system": 1.6025011599999999,
"min": 1.5166168078600002,
"max": 1.96863773186,
"times": [
1.80704937986,
1.8751121188600002,
1.55588514486,
1.76012388886,
1.96863773186,
1.68354929586,
1.84431292486,
1.9065132238600002,
1.73508668186,
1.5166168078600002
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.5096791193600001,
"stddev": 0.07898994862568326,
"median": 0.50210642206,
"user": 0.72171592,
"system": 0.86133566,
"min": 0.41888556706,
"max": 0.64227804006,
"times": [
0.50387264406,
0.53011070906,
0.50034020006,
0.52496052206,
0.63953381306,
0.64227804006,
0.45963198206000005,
0.43217577306000005,
0.41888556706,
0.44500194306
]
},
{
"command": "pacquet@main",
"mean": 0.45026005656000007,
"stddev": 0.0353238208986657,
"median": 0.4609060085600001,
"user": 0.6262165199999998,
"system": 0.76392336,
"min": 0.38475767206000006,
"max": 0.48738042106000007,
"times": [
0.40777575306,
0.45336691406000007,
0.47977067506000004,
0.46429573306000005,
0.45751628406000006,
0.46607281606000006,
0.48738042106000007,
0.38475767206000006,
0.48529713706000005,
0.41636716006
]
},
{
"command": "pnpr@HEAD",
"mean": 0.3506449560600001,
"stddev": 0.012163421585390839,
"median": 0.35017016206000007,
"user": 0.23598032,
"system": 0.6095497599999999,
"min": 0.33332208806,
"max": 0.37032023206000003,
"times": [
0.36170329406,
0.34122636306000004,
0.34299539906000004,
0.36075174606000004,
0.33731063306000003,
0.34610526906000005,
0.35423505506,
0.37032023206000003,
0.35847948106000005,
0.33332208806
]
},
{
"command": "pnpr@main",
"mean": 0.38971749086,
"stddev": 0.024397976480447656,
"median": 0.39530386656000005,
"user": 0.28567712,
"system": 0.6664764599999999,
"min": 0.35561839206,
"max": 0.41900420806000005,
"times": [
0.37947618506,
0.36120344206000005,
0.39132344606,
0.39928428706,
0.41754624806,
0.40960744606000005,
0.41900420806000005,
0.40483055406,
0.35561839206,
0.35928070006
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.8347296624200002,
"stddev": 0.028087287424848027,
"median": 1.83501675262,
"user": 1.02964914,
"system": 0.9269649799999998,
"min": 1.7864674976200001,
"max": 1.8833775256200003,
"times": [
1.82358832762,
1.8833775256200003,
1.8421944096200003,
1.85404629662,
1.8112066646200002,
1.8622788436200002,
1.8278390956200001,
1.8139214256200002,
1.7864674976200001,
1.84237653762
]
},
{
"command": "pacquet@main",
"mean": 1.85618770452,
"stddev": 0.02215930908252592,
"median": 1.8510202591200002,
"user": 1.07186584,
"system": 0.9861319799999999,
"min": 1.8279976056200002,
"max": 1.8980710796200002,
"times": [
1.84937123062,
1.8604851476200002,
1.8980710796200002,
1.8690697736200002,
1.84793365662,
1.8526692876200002,
1.8835826246200003,
1.8396150756200003,
1.83308156362,
1.8279976056200002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.36918809672,
"stddev": 0.014326878195306373,
"median": 0.36721269012,
"user": 0.25487114,
"system": 0.6539296799999998,
"min": 0.34973323662000005,
"max": 0.39301237562,
"times": [
0.35750788662000005,
0.35983117762000005,
0.36095760562,
0.39301237562,
0.37933473762000003,
0.38616787262,
0.37346777462,
0.34973323662000005,
0.35647984462000004,
0.37538845562000006
]
},
{
"command": "pnpr@main",
"mean": 0.36785810882000003,
"stddev": 0.021110646844300404,
"median": 0.36892849012000006,
"user": 0.25674993999999995,
"system": 0.65568698,
"min": 0.33431670362000004,
"max": 0.39684931662000006,
"times": [
0.33431670362000004,
0.34413921562000005,
0.39684931662000006,
0.35962806562000005,
0.34940116362,
0.36621379262000003,
0.37164318762000004,
0.37962870562000006,
0.38219466562000004,
0.39456627162
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2570126041363637,
"stddev": 0.010663323106448526,
"median": 0.2610452215,
"user": 0.2652949018181818,
"system": 0.10289517272727272,
"min": 0.23611636550000004,
"max": 0.2679073075,
"times": [
0.2557838465,
0.23611636550000004,
0.2659322825,
0.2641916735,
0.2610452215,
0.2674821995,
0.2492123185,
0.2679073075,
0.2644210285,
0.2512249925,
0.24382140950000003
]
},
{
"command": "pacquet@main",
"mean": 0.24778221760000002,
"stddev": 0.025098172254825243,
"median": 0.23845835950000002,
"user": 0.24878561999999999,
"system": 0.10283609999999999,
"min": 0.22134554150000002,
"max": 0.2820704575,
"times": [
0.2820704575,
0.2803253675,
0.24275630250000002,
0.2811721915,
0.23018852150000002,
0.22904079450000003,
0.2552985735,
0.23416041650000002,
0.22146400950000003,
0.22134554150000002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.10605549431481484,
"stddev": 0.0050252729049745076,
"median": 0.1060958785,
"user": 0.028465349629629624,
"system": 0.01959393703703704,
"min": 0.09853658150000001,
"max": 0.11656010050000001,
"times": [
0.1011644985,
0.1026379805,
0.1016219945,
0.10861161750000001,
0.1107248645,
0.1071538825,
0.11054701750000001,
0.1121049365,
0.1123115895,
0.10050532150000001,
0.11439098650000001,
0.11656010050000001,
0.10036494650000001,
0.10885963150000001,
0.1118158125,
0.10092237750000001,
0.1012862575,
0.1007377225,
0.1053322785,
0.1089437065,
0.10325856150000001,
0.1063299505,
0.10124601450000001,
0.1060958785,
0.10869922450000001,
0.1027346125,
0.09853658150000001
]
},
{
"command": "pnpr@main",
"mean": 0.10507338731481483,
"stddev": 0.005949145691506574,
"median": 0.10413391350000001,
"user": 0.029355682962962953,
"system": 0.0175939,
"min": 0.0949743665,
"max": 0.11859146150000001,
"times": [
0.1021732505,
0.0976824845,
0.0949743665,
0.1113032075,
0.1071455045,
0.11319625750000001,
0.10413391350000001,
0.11859146150000001,
0.1050554885,
0.10261344750000001,
0.10864744750000001,
0.1096315365,
0.11587154150000001,
0.10581596650000001,
0.1027895905,
0.1087011575,
0.10838547650000001,
0.09837767750000001,
0.10005298750000001,
0.1016273475,
0.10742554350000001,
0.09957463350000001,
0.1120383625,
0.10281873050000001,
0.09999308150000001,
0.0969634585,
0.10139753650000001
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.68608097756,
"stddev": 0.12390009569702831,
"median": 4.6664791697600005,
"user": 2.82202448,
"system": 2.05481348,
"min": 4.57606889726,
"max": 4.99136032926,
"times": [
4.75353354726,
4.57606889726,
4.71601523326,
4.99136032926,
4.64891580326,
4.70678753526,
4.57752493426,
4.59597884126,
4.61058211826,
4.68404253626
]
},
{
"command": "pacquet@main",
"mean": 4.77067336286,
"stddev": 0.20783409539360453,
"median": 4.670990098760001,
"user": 3.0298792800000003,
"system": 2.32492968,
"min": 4.62669549526,
"max": 5.24940233426,
"times": [
4.67147341126,
4.62916338726,
4.63401536626,
4.84918105926,
5.00972448226,
5.24940233426,
4.62669549526,
4.654238518260001,
4.670506786260001,
4.71233278826
]
},
{
"command": "pnpr@HEAD",
"mean": 3.8325858105600004,
"stddev": 0.1265127964134564,
"median": 3.81406275526,
"user": 2.08575658,
"system": 1.8923819800000001,
"min": 3.6408627892600003,
"max": 4.04510221526,
"times": [
3.7982335602600004,
3.87349518226,
3.8298919502600004,
3.97216447026,
4.04510221526,
3.78766769026,
3.6408627892600003,
3.68658898426,
3.75621296726,
3.9356382962600005
]
},
{
"command": "pnpr@main",
"mean": 3.7794824491599996,
"stddev": 0.09949996671040845,
"median": 3.7672769837600004,
"user": 2.15141288,
"system": 1.9329062799999999,
"min": 3.6470556392600004,
"max": 3.9584531812600003,
"times": [
3.7932844142600004,
3.6972524732600003,
3.9584531812600003,
3.68421828026,
3.8600768492600004,
3.7137865762600004,
3.8758936902600003,
3.6470556392600004,
3.7412695532600004,
3.82353383426
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13532 |
| 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,568.40 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 349.73 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 333.32 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 98.54 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,397.70 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,640.86 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 313.17 ms |
Carry the out-slot on EngineMode::Install instead of a fourth positional parameter, so an unrelated mode cannot be paired with a sink and the enum doc's claim about per-mode payloads holds again. Rename the accessor to take_deps_requiring_build, matching take_stats next to it and naming the take() it performs. Clone the Option<Arc<_>> through Arc::clone so the refcount bump is visible; clippy::clone_on_ref_ptr does not see through Option. Import DepsRequiringBuildSink, Arc, and Path rather than qualifying them inline, drop the call-site comment that repeated the sink's own documentation, shrink the fill-site comment that re-derived CreateVirtualStore's internals, log the sink before the non-assert_eq assertion, and rewrite the added prose without em dashes per the writing-style guide. Co-Authored-By: Claude Fable 5 <[email protected]>
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 @.changeset/tidy-moons-repeat.md:
- Line 2: The changeset file currently targets "`@pnpm/napi`" separately, but
according to the fixed release group configuration, Rust/N-API changes must use
"pacquet" as the package identifier since pacquet and pnpm/napi publish
together. Replace "`@pnpm/napi`": minor with pacquet: minor in the changeset to
correctly identify this change to the Rust stack.
🪄 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: 7344c80f-bd2d-423f-bda7-197c2aed4650
📒 Files selected for processing (5)
.changeset/tidy-moons-repeat.mdpnpm/crates/napi/src/install.rspnpm/crates/napi/src/install/tests.rspnpm/crates/package-manager/src/install.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
🚧 Files skipped from review as they are similar to previous changes (4)
- pnpm/crates/napi/src/install/tests.rs
- pnpm/crates/package-manager/src/install.rs
- pnpm/crates/napi/src/install.rs
- pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
|
Code review by qodo was updated up to the latest commit c832d48 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
… again beta.3 is the first release carrying `returnListOfDepsRequiringBuild` (pnpm/pnpm#13532), so the option this branch already passes now takes effect: a fresh resolve reports every package whose files carry install scripts instead of only the blocked ones. Verified in this repo, where the block had already been wiped to `[]` on master: a fresh resolve restores all twelve entries, and a repeat install leaves them untouched. Drop three version bridges the bump makes unnecessary. The `InstallOptions` intersection for `returnListOfDepsRequiringBuild` and the `ReadPackageHook` cast for the `resolvedDir` parameter are both in the published typings now, and `explicitSettings` is no longer optional, so getNetworkConfig can read it without a structural cast. The lockfile shrinks by about 6700 lines. 704 of the 758 removed keys carry peer suffixes, which is beta.3 deduplicating peer variants rather than dropping packages; install and compile both pass against the result. Co-Authored-By: Claude Fable 5 <[email protected]>
…lls (#10551) ## Summary After the pnpm-v12/napi migration (#10508), every `bit install` wiped the `bit.depsRequiringBuild` block from `pnpm-lock.yaml`: ```diff bit: - depsRequiringBuild: - - '@apollo/[email protected]' - - '@parcel/[email protected]' - ... + depsRequiringBuild: [] ``` Root cause: the migration dropped the `returnListOfDepsRequiringBuild: true` install option (the napi engine did not implement it), so `installResult.depsRequiringBuild` only carried *blocked* builds. Bit allows dependency builds to run, so the list was always empty — and lynx wrote that empty list over the recorded block on every install. The fix: - Preserve the previously recorded list whenever the engine returns no list (`depsRequiringBuild` undefined): frozen-path repeat installs, and engines that predate the option. Verified against the currently pinned `@pnpm/napi` 12.0.0-beta.2 — a repeat install in this repo now leaves the block byte-identical. - Pass `returnListOfDepsRequiringBuild: true` again. Engine support was added in pnpm/pnpm#13532, so the next `@pnpm/napi` release reports the full list (every package whose files carry install scripts, regardless of the allow-build policy) on fresh resolves — the same semantics the pre-migration TypeScript engine had. --- Written by an agent (Claude Code, claude-fable-5). --------- Co-authored-by: Claude Fable 5 <[email protected]>
Summary
Bit hit a regression after migrating to the napi engine (teambit/bit#10508): every
bit installwiped thebit.depsRequiringBuildblock frompnpm-lock.yaml. The napiInstallResult.depsRequiringBuildonly carried blocked builds (accumulated frompnpm:ignored-scriptsevents), while the TypeScript engine'sreturnListOfDepsRequiringBuildoption — which the pre-migration Bit passed — reports every package whose files carry install scripts, regardless of the allow-build policy. Bit allows dependency builds to run, so the napi list was always empty, and Bit overwrote its recorded block with[]on every install.This PR implements
returnListOfDepsRequiringBuildin the napi binding with the TypeScript engine's semantics:requiresBuild(from the store-index-backedrequires_build_by_snapshotmap) into a sink threaded throughInstall→InstallWithFreshLockfile, and the install result returns the sorted list — even when empty.lockfileOnlyruns) leavedepsRequiringBuildundefined, matching the TS engine, where only a fresh resolve computes the list (the frozen path returns nodepsRequiringBuild), so the embedder keeps its previously recorded list.requiresBuildoff a package it never fetched.The Bit-side consumer change is teambit/bit#10551.
Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting. (The TypeScript engine already hasreturnListOfDepsRequiringBuild; this ports it to the napi binding.)pnpm changeset) if this PR changes any published package.Written by an agent (Claude Code, claude-fable-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
Documentation
Tests