From e3b17d10f35d6b2107d501c4e5d6b748f23b8900 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 18 Jan 2024 21:02:18 -0800 Subject: [PATCH] speedup prebuilt check (#31065) * speedup prebuilt check * one place --- launch_chffrplus.sh | 9 +++++++-- selfdrive/manager/build.py | 3 +-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index a91bd677aa..8ebf3a53f2 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -72,14 +72,19 @@ function launch { export PYTHONPATH="$PWD" # hardware specific init - agnos_init + if [ -f /AGNOS ]; then + agnos_init + fi # write tmux scrollback to a file tmux capture-pane -pq -S-1000 > /tmp/launch_log # start manager cd selfdrive/manager - ./build.py && ./manager.py + if [ ! -f $DIR/prebuilt ]; then + ./build.py + fi + ./manager.py # if broken, keep on screen error while true; do sleep 1; done diff --git a/selfdrive/manager/build.py b/selfdrive/manager/build.py index 836723e5a8..f2758cf32b 100755 --- a/selfdrive/manager/build.py +++ b/selfdrive/manager/build.py @@ -17,7 +17,6 @@ CACHE_DIR = Path("/data/scons_cache" if AGNOS else "/tmp/scons_cache") TOTAL_SCONS_NODES = 2560 MAX_BUILD_PROGRESS = 100 -PREBUILT = os.path.exists(os.path.join(BASEDIR, 'prebuilt')) def build(spinner: Spinner, dirty: bool = False, minimal: bool = False) -> None: env = os.environ.copy() @@ -85,7 +84,7 @@ def build(spinner: Spinner, dirty: bool = False, minimal: bool = False) -> None: f.unlink() -if __name__ == "__main__" and not PREBUILT: +if __name__ == "__main__": spinner = Spinner() spinner.update_progress(0, 100) build(spinner, is_dirty(), minimal = AGNOS)