Skip to content

Commit 827ddf9

Browse files
committed
prepare.cppm: split phase9 into phase9_target_side + phase11_scan
Required by the file-size cap (phase9_target_side_and_scan was ~2600 lines): split right before the modgraph scan begins, matching the design's target_side.cpp / scan.cpp grouping. No new cross-boundary state needed -- everything on both sides already reads and writes through state.<name>, so this split (unlike P4's) needed no further promotion. Golden fixture diff against the baseline is empty; mcpp test: 129/129.
1 parent f748c83 commit 827ddf9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎src/build/prepare.cppm‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2780,7 +2780,7 @@ struct PrepareState {
27802780
// Forward-declared so a phase function defined ahead of prepare_build's own
27812781
// definition (every phase is, since each is inserted just before it) can
27822782
// still make the recursive host-tool sub-build call.
2783-
static std::expected<void, std::string> phase9_target_side_and_scan(PrepareState& state) {
2783+
static std::expected<void, std::string> phase9_target_side(PrepareState& state) {
27842784
// ── THE TARGET SIDE, RESOLVED ONCE ───────────────────────────────────────
27852785
//
27862786
// HERE AND NOT EARLIER, AND THAT IS THE WHOLE POINT.
@@ -4647,6 +4647,10 @@ static std::expected<void, std::string> phase9_target_side_and_scan(PrepareState
46474647
state.stdFlagAndDialect += ' ';
46484648
state.stdFlagAndDialect += f;
46494649
}
4650+
return {};
4651+
}
4652+
4653+
static std::expected<void, std::string> phase11_scan(PrepareState& state) {
46504654

46514655
// mcpp#225 (E2): observability marker for the source-discovery phase —
46524656
// `mcpp run`'s fast path (build_run_target/try_fast_run in execute.cppm)
@@ -5379,6 +5383,7 @@ static std::expected<void, std::string> phase9_target_side_and_scan(PrepareState
53795383
return {};
53805384
}
53815385

5386+
53825387
export std::expected<BuildContext, std::string>
53835388
prepare_build(bool print_fingerprint, bool includeDevDeps,
53845389
std::vector<mcpp::manifest::Target> extraTargets,
@@ -16372,7 +16377,8 @@ prepare_build(bool print_fingerprint,
1637216377
if (auto r = phase4b_graph_worklist(state); !r) return std::unexpected(r.error());
1637316378
if (auto r = phase5_toolchain_after_graph(state); !r) return std::unexpected(r.error());
1637416379
if (auto r = phase6_features_and_host_tools(state); !r) return std::unexpected(r.error());
16375-
if (auto r = phase9_target_side_and_scan(state); !r) return std::unexpected(r.error());
16380+
if (auto r = phase9_target_side(state); !r) return std::unexpected(r.error());
16381+
if (auto r = phase11_scan(state); !r) return std::unexpected(r.error());
1637616382

1637716383
return phase13_finish(state);
1637816384
}

0 commit comments

Comments
 (0)