no ui in ci

pull/35003/head
deanlee 1 month ago
parent 900564fecc
commit 1095ff47dd
  1. 7
      system/manager/build.py

@ -26,12 +26,14 @@ def build(dirty: bool = False, minimal: bool = False) -> None:
nproc = os.cpu_count() or 2 nproc = os.cpu_count() or 2
extra_args = ["--minimal"] if minimal else [] extra_args = ["--minimal"] if minimal else []
CI = os.getenv("CI") is not None
if AGNOS: if AGNOS:
HARDWARE.set_power_save(False) HARDWARE.set_power_save(False)
os.sched_setaffinity(0, range(8)) # ensure we can use the isolcpus cores os.sched_setaffinity(0, range(8)) # ensure we can use the isolcpus cores
# building with all cores can result in using too # building with all cores can result in using too
# much memory, so retry with less parallelism # much memory, so retry with less parallelism
if not CI:
gui_app.init_window("Spinner") gui_app.init_window("Spinner")
spinner = Spinner() spinner = Spinner()
compile_output: list[bytes] = [] compile_output: list[bytes] = []
@ -42,9 +44,11 @@ def build(dirty: bool = False, minimal: bool = False) -> None:
os.set_blocking(scons.stderr.fileno(), False) # Non-blocking reads os.set_blocking(scons.stderr.fileno(), False) # Non-blocking reads
# Read progress from stderr and update spinner # Read progress from stderr and update spinner
if not CI:
spinner.set_text("0") spinner.set_text("0")
while scons.poll() is None: while scons.poll() is None:
try: try:
if not CI:
rl.begin_drawing() rl.begin_drawing()
rl.clear_background(rl.BLACK) rl.clear_background(rl.BLACK)
spinner.render() spinner.render()
@ -57,6 +61,7 @@ def build(dirty: bool = False, minimal: bool = False) -> None:
line = line.rstrip() line = line.rstrip()
prefix = b'progress: ' prefix = b'progress: '
if line.startswith(prefix): if line.startswith(prefix):
if not CI:
i = int(line[len(prefix):]) i = int(line[len(prefix):])
spinner.set_text(str(int(MAX_BUILD_PROGRESS * min(1., i / TOTAL_SCONS_NODES)))) spinner.set_text(str(int(MAX_BUILD_PROGRESS * min(1., i / TOTAL_SCONS_NODES))))
elif len(line): elif len(line):
@ -79,7 +84,7 @@ def build(dirty: bool = False, minimal: bool = False) -> None:
cloudlog.error("scons build failed\n" + error_s) cloudlog.error("scons build failed\n" + error_s)
# Show TextWindow # Show TextWindow
if not os.getenv("CI"): if not CI:
text_window = TextWindow("openpilot failed to build\n \n" + error_s) text_window = TextWindow("openpilot failed to build\n \n" + error_s)
while True: while True:
rl.begin_drawing() rl.begin_drawing()

Loading…
Cancel
Save