Run the sequential compile path (target resolution + compile + diagnostics).
(
ctx: SequentialCompileContext,
)
| 179 | |
| 180 | |
| 181 | def run_sequential_compile( |
| 182 | ctx: SequentialCompileContext, |
| 183 | ) -> SequentialCompileResult: |
| 184 | """Run the sequential compile path (target resolution + compile + diagnostics).""" |
| 185 | targets_to_try = _resolve_compile_candidates(ctx) |
| 186 | |
| 187 | _ts_print(f"[BUILD] Building FastLED engine ({ctx.build_mode} mode)...") |
| 188 | |
| 189 | has_fallbacks = len(targets_to_try) > 1 |
| 190 | compilation_success = False |
| 191 | successful_target: Optional[str] = None |
| 192 | last_error_output = "" |
| 193 | last_result: Optional[CompileResult] = None |
| 194 | all_suppressed_errors: list[str] = [] |
| 195 | resolved_meson_test_name = ctx.meson_test_name |
| 196 | |
| 197 | for candidate in targets_to_try: |
| 198 | ctx.phase_tracker.set_phase( |
| 199 | "COMPILE", |
| 200 | test_name=ctx.test_name, |
| 201 | target=candidate, |
| 202 | path="sequential", |
| 203 | ) |
| 204 | result = compile_meson( |
| 205 | ctx.build_dir, |
| 206 | target=candidate, |
| 207 | quiet=has_fallbacks, |
| 208 | verbose=ctx.verbose, |
| 209 | ) |
| 210 | last_result = result |
| 211 | compilation_success = result.success |
| 212 | if compilation_success: |
| 213 | ctx.phase_tracker.set_phase( |
| 214 | "LINK", |
| 215 | test_name=ctx.test_name, |
| 216 | target=candidate, |
| 217 | path="sequential", |
| 218 | ) |
| 219 | successful_target = candidate |
| 220 | resolved_meson_test_name = ( |
| 221 | candidate.removeprefix("tests/") if candidate else candidate |
| 222 | ) |
| 223 | break |
| 224 | last_error_output = result.error_output |
| 225 | all_suppressed_errors.extend(result.suppressed_errors) |
| 226 | |
| 227 | ctx.build_timer.checkpoint("compile_done") |
| 228 | |
| 229 | if compilation_success and has_fallbacks: |
| 230 | print_banner("Compile", "📦", verbose=ctx.verbose) |
| 231 | print(f"Compiling: {successful_target}") |
| 232 | |
| 233 | if compilation_success: |
| 234 | return SequentialCompileResult( |
| 235 | success=True, meson_test_name=resolved_meson_test_name |
| 236 | ) |
| 237 | |
| 238 | _print_compile_failure( |
no test coverage detected