diff --git a/build_only.sh b/build_only.sh index 19963aa..139c541 100755 --- a/build_only.sh +++ b/build_only.sh @@ -35,4 +35,6 @@ source "$BASEDIR/build_preflight.sh" cd "$BASEDIR/selfdrive/manager" rm -f "$BASEDIR/prebuilt" -BUILD_ONLY=1 exec ./build.py +# Tee output to /tmp/build.log for inspection after the script exits +BUILD_ONLY=1 ./build.py 2>&1 | tee /tmp/build.log +exit "${PIPESTATUS[0]}" diff --git a/selfdrive/frogpilot/screenrecorder/moc_screenrecorder.cc b/selfdrive/frogpilot/screenrecorder/moc_screenrecorder.cc old mode 100755 new mode 100644 diff --git a/selfdrive/frogpilot/ui/qt/offroad/moc_control_settings.cc b/selfdrive/frogpilot/ui/qt/offroad/moc_control_settings.cc old mode 100755 new mode 100644 diff --git a/selfdrive/frogpilot/ui/qt/offroad/moc_vehicle_settings.cc b/selfdrive/frogpilot/ui/qt/offroad/moc_vehicle_settings.cc old mode 100755 new mode 100644 diff --git a/selfdrive/frogpilot/ui/qt/offroad/moc_visual_settings.cc b/selfdrive/frogpilot/ui/qt/offroad/moc_visual_settings.cc old mode 100755 new mode 100644 diff --git a/selfdrive/frogpilot/ui/qt/widgets/moc_frogpilot_controls.cc b/selfdrive/frogpilot/ui/qt/widgets/moc_frogpilot_controls.cc old mode 100755 new mode 100644 diff --git a/selfdrive/manager/build.py b/selfdrive/manager/build.py index e46f20c..2b4f2b1 100755 --- a/selfdrive/manager/build.py +++ b/selfdrive/manager/build.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 import os +import sys import subprocess from pathlib import Path @@ -54,6 +55,21 @@ def build(spinner: Spinner, dirty: bool = False, minimal: bool = False) -> None: if scons.returncode == 0: Path('/data/openpilot/prebuilt').touch() + + # CLEARPILOT: update prebuilt spinner if the new build is newer. + # Write to a temp path then os.replace so we can swap a binary that's + # currently executing (the in-process spinner holds the old one open). + new_spinner = Path(BASEDIR) / "selfdrive/ui/_spinner" + old_spinner = Path(BASEDIR) / "selfdrive/ui/qt/spinner" + if new_spinner.exists() and (not old_spinner.exists() or new_spinner.stat().st_mtime > old_spinner.stat().st_mtime): + import shutil + try: + tmp_spinner = old_spinner.with_name(old_spinner.name + ".new") + shutil.copy2(str(new_spinner), str(tmp_spinner)) + os.replace(str(tmp_spinner), str(old_spinner)) + except OSError as e: + print(f"CLP failed to update prebuilt spinner: {e}", file=sys.stderr) + break if scons.returncode != 0: @@ -69,8 +85,23 @@ def build(spinner: Spinner, dirty: bool = False, minimal: bool = False) -> None: # Show TextWindow spinner.close() if not os.getenv("CI"): - with TextWindow("openpilot failed to build\n \n" + error_s) as t: - t.wait_for_exit() + msg = "openpilot failed to build\n \n" + error_s + if os.getenv("BUILD_ONLY"): + # CLEARPILOT: BUILD_ONLY mode — spawn the text window fully detached + # (own session, /dev/null stdio) so it stays on screen after this + # script exits and doesn't hold our stdout/stderr pipes open. + print(error_s, file=sys.stderr) + devnull = open(os.devnull, 'r+b') + subprocess.Popen( + ["./text", msg], + cwd=os.path.join(BASEDIR, "selfdrive", "ui"), + stdin=devnull, stdout=devnull, stderr=devnull, + start_new_session=True, + close_fds=True, + ) + else: + with TextWindow(msg) as t: + t.wait_for_exit() exit(1) # enforce max cache size diff --git a/selfdrive/ui/SConscript b/selfdrive/ui/SConscript index 49c6dda..2a4efc5 100755 --- a/selfdrive/ui/SConscript +++ b/selfdrive/ui/SConscript @@ -78,19 +78,11 @@ qt_env.Program("_spinner", ["qt/spinner.cc"], LIBS=qt_libs) # Clearpilot -# Add qtwebengine to build paths -qt_env['CXXFLAGS'] += ["-I/usr/include/aarch64-linux-gnu/qt5/QtWebEngine"] -qt_env['CXXFLAGS'] += ["-I/usr/include/aarch64-linux-gnu/qt5/QtWebEngineCore"] -qt_env['CXXFLAGS'] += ["-I/usr/include/aarch64-linux-gnu/qt5/QtWebEngineWidgets"] -qt_env['CXXFLAGS'] += ["-I/usr/include/aarch64-linux-gnu/qt5/QtWebChannel"] -qt_webengine_libs = qt_libs + ['Qt5WebEngineWidgets'] - # Create clearpilot tools qt_env.Program("/data/openpilot/system/clearpilot/tools/qt_shell", ["/data/openpilot/system/clearpilot/tools/qt_shell.cc"], LIBS=qt_libs) -# qt_env.Program("/data/openpilot/system/clearpilot/tools/qt_webview", ["/data/openpilot/system/clearpilot/tools/qt_webview.cc"], LIBS=qt_webengine_libs) # build main UI -qt_env.Program("ui", qt_src + [asset_obj], LIBS=qt_webengine_libs) +qt_env.Program("ui", qt_src + [asset_obj], LIBS=qt_libs) if GetOption('extras'): qt_src.remove("main.cc") # replaced by test_runner qt_env.Program('tests/test_translations', [asset_obj, 'tests/test_runner.cc', 'tests/test_translations.cc'] + qt_src, LIBS=qt_libs) diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index d89f056..0b9d0d0 100755 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -10,8 +10,6 @@ #include "selfdrive/ui/qt/widgets/drive_stats.h" #include "system/hardware/hw.h" -#include - // HomeWindow: the container for the offroad and onroad UIs HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) { diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index b596660..d2b3f0c 100755 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -78,7 +78,7 @@ void OnroadWindow::updateState(const UIState &s) { QColor bgColor = bg_colors[s.status]; - if (paramsMemory.getBool("no_lat_lane_change") == 1 || screenDisplayMode == 2) { + if (paramsMemory.getBool("no_lat_lane_change") == 1 || nvg->screenDisplayMode == 2) { bgColor = bg_colors[STATUS_DISENGAGED]; } diff --git a/selfdrive/ui/qt/spinner b/selfdrive/ui/qt/spinner index ab69bdc..6152ad6 100755 Binary files a/selfdrive/ui/qt/spinner and b/selfdrive/ui/qt/spinner differ