Repository navigation
refactor(deps-restorer): split the frozen install into its subsystems - #13659
Conversation
`install_frozen_lockfile.rs` carried two subsystems that share nothing with the frozen install beyond being reachable from it: - `build_phase` — running package build scripts once the tree exists - `hoisted` — the flat-`node_modules` linker, its hoist plan, and the runtime-major probes that feed it Both move out, leaving the frozen install itself — its inputs, error type, and output — at 930 lines rather than 1830. Re-exports are explicit and split by the visibility each item already had, so the crate's public surface is unchanged and internal helpers stay internal. Pure code motion: no behaviour change, verified by comparing every content line of the original against the union of the new modules. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
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 (3)
📝 WalkthroughWalkthroughThe frozen lockfile installer now separates lifecycle execution and hoisted linking into ChangesFrozen installer phases
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related issues
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 Qododeps-restorer: split frozen install into hoisted + build-phase modules
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Confidence Score: 5/5The PR appears safe to merge because the subsystem split preserves the existing API and executable behavior. The extracted build-phase and hoisted-linker implementations remain reachable through the same public paths, and no omitted, duplicated, or behavior-changing executable code was found. Reviews (1): Last reviewed commit: "refactor(deps-restorer): split the froze..." | Re-trigger Greptile |
Code Review by Qodo
1. Unneeded pub(crate) helpers
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Micro-Benchmark ResultsLinux |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13659 +/- ##
==========================================
- Coverage 88.07% 88.06% -0.01%
==========================================
Files 596 598 +2
Lines 98812 98815 +3
==========================================
- Hits 87026 87023 -3
- Misses 11786 11792 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.6322107025600006,
"stddev": 0.15066047385963993,
"median": 2.6093163017600003,
"user": 2.23664236,
"system": 1.7225598799999997,
"min": 2.4685903757600003,
"max": 2.94872480176,
"times": [
2.72627178876,
2.7610057567600004,
2.5805000017600004,
2.4685903757600003,
2.94872480176,
2.63813260176,
2.5097620777600005,
2.52599330376,
2.6758593697600004,
2.4872669477600002
]
},
{
"command": "pacquet@main",
"mean": 2.5949490390600003,
"stddev": 0.20926641053135822,
"median": 2.4936075782600002,
"user": 1.9193730600000003,
"system": 1.49803858,
"min": 2.38233756976,
"max": 2.9157599027600005,
"times": [
2.81657271676,
2.7561699867600002,
2.45856607976,
2.4694197417600003,
2.83025408776,
2.9157599027600005,
2.51779541476,
2.39067301776,
2.4119418727600004,
2.38233756976
]
},
{
"command": "pnpr@HEAD",
"mean": 1.57257113156,
"stddev": 0.1857724860225065,
"median": 1.54098659826,
"user": 1.19042136,
"system": 1.2485448799999999,
"min": 1.35829404376,
"max": 1.82045779976,
"times": [
1.60388897776,
1.82045779976,
1.37692001976,
1.76767922476,
1.81716382076,
1.66330211976,
1.47808421876,
1.35829404376,
1.45422051276,
1.38570057776
]
},
{
"command": "pnpr@main",
"mean": 1.5527443745600003,
"stddev": 0.1861240042181152,
"median": 1.51602799076,
"user": 1.18148316,
"system": 1.2252517799999998,
"min": 1.35894793876,
"max": 1.8503542747600001,
"times": [
1.47981375376,
1.75238319476,
1.35894793876,
1.38238927576,
1.37632151976,
1.8503542747600001,
1.36970429676,
1.55224222776,
1.73335746476,
1.6719297987600001
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.29189430278000006,
"stddev": 0.011959503738399728,
"median": 0.29423890128,
"user": 0.22759685999999996,
"system": 0.5830469,
"min": 0.27234241628,
"max": 0.30680227628,
"times": [
0.28044039428,
0.27234241628,
0.29659078628,
0.30171406028000003,
0.30680227628,
0.30287407928,
0.29188701628,
0.27965701528,
0.30222561528,
0.28440936828
]
},
{
"command": "pacquet@main",
"mean": 0.27557862428,
"stddev": 0.014433444630017056,
"median": 0.27007575078,
"user": 0.22192985999999992,
"system": 0.5608891,
"min": 0.25944129828,
"max": 0.30255586828000003,
"times": [
0.26991441128,
0.27572635428000003,
0.25944129828,
0.28353274228,
0.27021815428,
0.30255586828000003,
0.26993334728,
0.26295417128,
0.26466470928,
0.29684518628
]
},
{
"command": "pnpr@HEAD",
"mean": 0.29373770017999995,
"stddev": 0.012584437640949171,
"median": 0.29533262628,
"user": 0.23396925999999998,
"system": 0.5574023,
"min": 0.27002097328,
"max": 0.31240035528,
"times": [
0.29031197228,
0.30351786528,
0.31240035528,
0.30262275628,
0.30130073928,
0.30035328028,
0.28793840028,
0.28771732328,
0.27002097328,
0.28119333628
]
},
{
"command": "pnpr@main",
"mean": 0.33110858628,
"stddev": 0.03105320001244122,
"median": 0.32426853728000005,
"user": 0.26734056,
"system": 0.620335,
"min": 0.29429101428,
"max": 0.39339849028,
"times": [
0.31591239528,
0.31816454828,
0.32362525728,
0.33328216028,
0.39339849028,
0.37494982828,
0.33335489728,
0.32491181728,
0.29429101428,
0.29919545428
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.8693042725,
"stddev": 0.13458763346847302,
"median": 2.8740271330000002,
"user": 2.1209886399999998,
"system": 1.7985679799999996,
"min": 2.6834372555,
"max": 3.0826435324999997,
"times": [
2.7986825695,
2.9178406295,
2.6834372555,
2.7037207905,
2.7661071314999996,
2.8302136365,
2.9287209224999997,
3.0826435324999997,
2.9524052185,
3.0292710384999997
]
},
{
"command": "pacquet@main",
"mean": 2.6669762742,
"stddev": 0.02743739536242991,
"median": 2.659036375,
"user": 1.67117164,
"system": 1.44867528,
"min": 2.6460701204999997,
"max": 2.7390930635,
"times": [
2.6555779305,
2.6465303194999996,
2.6696906444999997,
2.7390930635,
2.6755188185,
2.6543598404999997,
2.6492964115,
2.6624948195,
2.6460701204999997,
2.6711307735
]
},
{
"command": "pnpr@HEAD",
"mean": 1.593210468,
"stddev": 0.11731218014485431,
"median": 1.5627729755000002,
"user": 1.18988894,
"system": 1.22933918,
"min": 1.4774866245,
"max": 1.8397432775,
"times": [
1.5550613215,
1.7338972655000002,
1.5704846295000001,
1.5735568105000002,
1.4774866245,
1.5435752555000002,
1.6568786175,
1.4886815785,
1.4927392995000002,
1.8397432775
]
},
{
"command": "pnpr@main",
"mean": 1.7506978977999998,
"stddev": 0.18289060313963154,
"median": 1.7681589895,
"user": 1.36691584,
"system": 1.4785320800000001,
"min": 1.4672558585,
"max": 1.9764797195000001,
"times": [
1.5259774515,
1.4672558585,
1.6155956375,
1.8691863435000002,
1.9764797195000001,
1.7005366315000001,
1.8357813475,
1.9043074915000002,
1.9600075805000001,
1.6518509165000002
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.62393780438,
"stddev": 0.041537609332489345,
"median": 0.63683469108,
"user": 0.8778638800000002,
"system": 0.9475824599999999,
"min": 0.53313265708,
"max": 0.67262464108,
"times": [
0.64565723708,
0.6371418210800001,
0.57402928708,
0.53313265708,
0.67262464108,
0.62210878908,
0.63812757208,
0.61885609808,
0.63652756108,
0.66117238008
]
},
{
"command": "pacquet@main",
"mean": 0.55041580818,
"stddev": 0.05975631687894652,
"median": 0.53804361308,
"user": 0.77362808,
"system": 0.8444844600000001,
"min": 0.46703824908,
"max": 0.67164393308,
"times": [
0.5394343580800001,
0.51026206308,
0.53665286808,
0.6258370320800001,
0.67164393308,
0.55944971708,
0.56416359608,
0.52101999408,
0.50865627108,
0.46703824908
]
},
{
"command": "pnpr@HEAD",
"mean": 0.40954699998,
"stddev": 0.025606445618877,
"median": 0.40623101858,
"user": 0.32095938000000007,
"system": 0.65252046,
"min": 0.37585538108,
"max": 0.44913423708,
"times": [
0.40024732208,
0.42094286408000003,
0.38648550008,
0.37585538108,
0.41221471508,
0.38765240408,
0.43125492108,
0.44242884808,
0.44913423708,
0.38925380708
]
},
{
"command": "pnpr@main",
"mean": 0.42261590228,
"stddev": 0.039489497777722975,
"median": 0.42156667658,
"user": 0.32297118,
"system": 0.6881125599999999,
"min": 0.37147765608,
"max": 0.47793550208,
"times": [
0.47793550208,
0.47784963008000003,
0.38962134108,
0.41253979908,
0.37147765608,
0.37503653508,
0.43059355408,
0.39774722208,
0.44937395008000003,
0.44398383308
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.079499139,
"stddev": 0.06514765482765475,
"median": 2.0593115528,
"user": 1.3174806399999999,
"system": 1.1434508599999997,
"min": 1.9772520893,
"max": 2.1856381703000003,
"times": [
2.0521488893,
2.0861074623,
2.0305932853,
2.1544873993,
2.0598699463,
2.0587531593,
2.1856381703000003,
2.1515091173000003,
2.0386318713000002,
1.9772520893
]
},
{
"command": "pacquet@main",
"mean": 2.0395641315000006,
"stddev": 0.05525079158207924,
"median": 2.0370800018,
"user": 1.2705244399999998,
"system": 1.11153216,
"min": 1.9385775153,
"max": 2.1207640223,
"times": [
2.0290673643000003,
1.9385775153,
2.0138897393,
2.0450926393,
2.0521122113000003,
2.0892227843,
2.0037182863000003,
1.9982870122999998,
2.1207640223,
2.1049097403
]
},
{
"command": "pnpr@HEAD",
"mean": 0.4226570981000001,
"stddev": 0.027514601586771485,
"median": 0.41843946230000006,
"user": 0.30359443999999997,
"system": 0.7125788599999999,
"min": 0.38695408030000006,
"max": 0.47424790530000005,
"times": [
0.42778854330000005,
0.46239877530000006,
0.41429903630000003,
0.41622903930000005,
0.47424790530000005,
0.41200007530000005,
0.42162000630000007,
0.4206498853,
0.38695408030000006,
0.39038363430000006
]
},
{
"command": "pnpr@main",
"mean": 0.38683382590000004,
"stddev": 0.02627643645296212,
"median": 0.38859124030000003,
"user": 0.26032674,
"system": 0.66853446,
"min": 0.3414111913,
"max": 0.4362417813000001,
"times": [
0.4362417813000001,
0.4006600363000001,
0.40711254830000004,
0.36681254330000007,
0.38999774530000003,
0.38407878130000006,
0.3871847353,
0.39341118030000005,
0.36142771630000003,
0.3414111913
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.19818828862666663,
"stddev": 0.013491826681360215,
"median": 0.19546669245999998,
"user": 0.18352791999999998,
"system": 0.07801846666666666,
"min": 0.18843212646,
"max": 0.23979933446,
"times": [
0.23979933446,
0.19591140646,
0.19442723546,
0.19276261146,
0.18958233746,
0.19535170046,
0.20095603046,
0.19593802646,
0.19382586946,
0.18843212646,
0.19558168446,
0.19569110046
]
},
{
"command": "pacquet@main",
"mean": 0.20610364703142858,
"stddev": 0.024791229785891038,
"median": 0.19712670146,
"user": 0.19274899142857144,
"system": 0.07305265714285714,
"min": 0.17601811946,
"max": 0.26549025746000005,
"times": [
0.19911983446,
0.18995573246,
0.22580065546,
0.19492122746,
0.21906771446,
0.26549025746000005,
0.20255994946,
0.18599991446,
0.17601811946,
0.19413546346,
0.20135885146,
0.19513356846,
0.24608828746,
0.18980148246
]
},
{
"command": "pnpr@HEAD",
"mean": 0.1032501837180645,
"stddev": 0.008954722655407076,
"median": 0.10191995646,
"user": 0.026239565161290317,
"system": 0.016962654838709675,
"min": 0.09156433446000001,
"max": 0.13058352046,
"times": [
0.09159052546,
0.09620941446,
0.09156433446000001,
0.09960894346,
0.10090339846,
0.10948394746000001,
0.10549874346,
0.10958806346000001,
0.10431781346,
0.10224464946,
0.09630162846000001,
0.09984458846000001,
0.10592346446,
0.10136804346,
0.09664662046000001,
0.11510611046000001,
0.10606472046000001,
0.10191995646,
0.10947802546,
0.10678432046000001,
0.11848685346000001,
0.11501439746000001,
0.13058352046,
0.10511317446000001,
0.11007502246,
0.10048295246000001,
0.10150295946000001,
0.09259859846000001,
0.09308896246000001,
0.09166227046000001,
0.09169967146
]
},
{
"command": "pnpr@main",
"mean": 0.0972994768048276,
"stddev": 0.0048976958278798615,
"median": 0.09708707246,
"user": 0.023627782068965517,
"system": 0.015196048275862066,
"min": 0.08613269046000001,
"max": 0.10821237646000001,
"times": [
0.09666851146000001,
0.09810347146000001,
0.09885826646000001,
0.09530651046000001,
0.09442681046000001,
0.08964524146000001,
0.08613269046000001,
0.10821237646000001,
0.09230681646000001,
0.09156169046000001,
0.10189903646000001,
0.10124843846,
0.10566734146000001,
0.09524767946000001,
0.09787664346000001,
0.10130831146000001,
0.09447328746000001,
0.09778446846000001,
0.09393499046,
0.09368140246000001,
0.09708707246,
0.09600675246000001,
0.09972575346000001,
0.09277788646000001,
0.10618721246000001,
0.09781581846000001,
0.10254964446,
0.09817030646000001,
0.09702039546
]
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.1354107515533336,
"stddev": 0.2328965120339256,
"median": 1.10575528722,
"user": 1.0623636799999998,
"system": 0.2352275533333333,
"min": 0.84896267822,
"max": 1.5661349272200003,
"times": [
0.84896267822,
1.5661349272200003,
1.11356388822,
1.10575528722,
1.0113680092200001,
0.92094229122,
1.43456429922,
1.02904427122,
1.18836111222
]
},
{
"command": "pacquet@main",
"mean": 1.0861570353311112,
"stddev": 0.14703210040533898,
"median": 1.05431331822,
"user": 1.024079791111111,
"system": 0.19992955333333332,
"min": 0.8763157392200001,
"max": 1.31819211522,
"times": [
1.16015668322,
1.03383040622,
0.8763157392200001,
1.05431331822,
1.31819211522,
0.89067853422,
1.16402069922,
1.22838559722,
1.04952022522
]
},
{
"command": "pnpm@HEAD",
"mean": 4.3181726559977776,
"stddev": 0.5877335900273787,
"median": 4.23376189022,
"user": 6.661326902222222,
"system": 0.4109761088888889,
"min": 3.73121044622,
"max": 5.26258808522,
"times": [
3.84525847022,
3.73121044622,
3.81630635122,
4.23376189022,
3.91848502822,
4.2343176082200005,
4.61489816022,
5.26258808522,
5.20672786422
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.85911643306,
"stddev": 0.16997815345070338,
"median": 4.82546505926,
"user": 2.81585876,
"system": 2.0098122800000002,
"min": 4.6675379887599995,
"max": 5.167659875759999,
"times": [
4.9506285947599995,
4.686271596759999,
5.167659875759999,
4.726354188759999,
4.76187530176,
4.79648350876,
4.87900502476,
5.100901640759999,
4.85444660976,
4.6675379887599995
]
},
{
"command": "pacquet@main",
"mean": 4.816160765459999,
"stddev": 0.14160390448569488,
"median": 4.8458726172599995,
"user": 2.7434347599999995,
"system": 2.1160218799999995,
"min": 4.61085645676,
"max": 5.002556140759999,
"times": [
4.61085645676,
4.65594791776,
5.002556140759999,
4.9182460697599995,
4.88037355776,
4.91557576676,
4.721958540759999,
4.811371676759999,
4.67319335576,
4.971528171759999
]
},
{
"command": "pnpr@HEAD",
"mean": 3.72827309826,
"stddev": 0.14137091471534405,
"median": 3.68947760026,
"user": 1.67269936,
"system": 1.6746706799999997,
"min": 3.57623858576,
"max": 4.012486494759999,
"times": [
3.94812419276,
4.012486494759999,
3.67428603476,
3.71674946276,
3.6751017847600003,
3.72507761576,
3.57623858576,
3.62461367576,
3.62619971976,
3.70385341576
]
},
{
"command": "pnpr@main",
"mean": 3.6290463003599998,
"stddev": 0.1497698746399139,
"median": 3.58144382876,
"user": 1.62122386,
"system": 1.55622098,
"min": 3.47229928676,
"max": 3.9757937607600002,
"times": [
3.70791674576,
3.74917854676,
3.58541996076,
3.56243259176,
3.9757937607600002,
3.6238012517600002,
3.57746769676,
3.55526759576,
3.48088556676,
3.47229928676
]
}
]
} |
Picks up sixteen commits, most of them module splits: the optimistic repeat-install check (#13661), the frozen install and its build phase (#13659, #13662), `create_virtual_store` (#13649), the tarball crate root (#13652), and the audit command (#13657). Also the move to the `rc` lane and pacquet 12.0.0-rc.0 (#13666, #13667). #13661 split `optimistic_repeat_install.rs` into per-concern modules, moving one of this branch's two `build_workspace_state::<Host>` call sites into the new `deps_status.rs`. The turbofish is re-applied at both of its new homes. # Conflicts: # pnpm/crates/package-manager/src/optimistic_repeat_install.rs
Summary
install_frozen_lockfile.rswas 1830 lines, carrying two subsystems that share nothing with the frozen install beyond being reachable from it:hoistednode_moduleslinker, its hoist plan, and the runtime-major probes that feed itbuild_phaseWhat remains is the frozen install itself — its inputs, error type, and output — at 930 lines.
Re-exports are explicit rather than glob, and split by the visibility each item already had (
pub usefor the public API,pub(crate) usefor the two internal helpers), so the crate's public surface is unchanged and internal helpers stay internal.Squash Commit Body
Split the 1830-line
install_frozen_lockfile.rsintohoisted(the flat-node_moduleslinker and hoist plan) andbuild_phase(build-script execution), leaving the frozen install itself at 930 lines. Pure code motion; the crate's public surface is unchanged.Checklist
rustfmt-reflowed signature that gained a visibility prefix)cargo clippy --workspace --all-targets -D warnings,cargo doc --document-private-items -D warnings, andcargo dylint --allall cleandeps-restorer,package-manager, andcliWritten 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