MCPcopy Create free account
hub / github.com/FastLED/FastLED / _run_compile

Function _run_compile

ci/check_backend_flag_drift.py:431–481  ·  view source on GitHub ↗

Invoke ``ci/ci-compile.py`` for ``board`` with the chosen ``backend``. Returns True on success. Output is streamed so a slow first-time framework download is visible to the user.

(
    project_root: Path,
    board: str,
    example: str,
    backend: str,
    *,
    timeout_seconds: int,
)

Source from the content-addressed store, hash-verified

429
430
431def _run_compile(
432 project_root: Path,
433 board: str,
434 example: str,
435 backend: str,
436 *,
437 timeout_seconds: int,
438) -> bool:
439 """Invoke ``ci/ci-compile.py`` for ``board`` with the chosen ``backend``.
440
441 Returns True on success. Output is streamed so a slow first-time
442 framework download is visible to the user.
443 """
444 if backend not in {"fbuild", "platformio"}:
445 raise ValueError(f"unknown backend {backend!r}")
446
447 backend_flag = "--fbuild" if backend == "fbuild" else "--pio"
448 cmd: list[str] = [
449 "uv",
450 "run",
451 "python",
452 "ci/ci-compile.py",
453 board,
454 "--examples",
455 example,
456 backend_flag,
457 ]
458
459 print(
460 f"\n>>> Compiling [{backend}]: {subprocess.list2cmdline(cmd)}",
461 flush=True,
462 )
463 try:
464 result = RunningProcess.run(
465 cmd,
466 check=False,
467 cwd=str(project_root),
468 timeout=timeout_seconds,
469 )
470 except KeyboardInterrupt as ki:
471 handle_keyboard_interrupt(ki)
472 raise
473
474 success = result.returncode == 0
475 if not success:
476 print(
477 f"\n!!! Compile failed for backend={backend} board={board} "
478 f"(rc={result.returncode})",
479 file=sys.stderr,
480 )
481 return success
482
483
484# ---------------------------------------------------------------------------

Callers 1

mainFunction · 0.85

Calls 3

printFunction · 0.50
runMethod · 0.45

Tested by

no test coverage detected