IQ.Pilot Release Commit @ 717ce45

This commit is contained in:
IQ.Lvbs CI [bot]
2026-09-02 15:53:36 -05:00
parent 43ee82d228
commit 4fb3da761f
11 changed files with 230 additions and 95 deletions

View File

@@ -51,7 +51,44 @@ class _SilentProgress:
pass
def build(spinner, dirty: bool = False, minimal: bool = False, show_error_window: bool = True) -> None:
REGISTRY_ARTIFACTS = [
"iqpilot/cereal/services.h",
"iqpilot/cereal/messaging/socketmaster.o",
"iqpilot/cereal/libsocketmaster.a",
"iqpilot/cereal/messaging/bridge",
"iqpilot/selfdrive/iqlocd/iqlocd",
"iqpilot/selfdrive/pandad/pandad",
"iqpilot/system/camerad/camerad",
"iqpilot/system/loggerd/loggerd",
"iqpilot/system/loggerd/encoderd",
"iqpilot/system/loggerd/bootlog",
]
def stale_registry_artifacts(basedir: str = BASEDIR) -> list[str]:
from iqpilot.cereal.services import REGISTRY_TAG_PREFIX, registry_tag
expected = registry_tag().encode()
prefix = REGISTRY_TAG_PREFIX.encode()
stale = []
for rel in REGISTRY_ARTIFACTS:
path = os.path.join(basedir, rel)
if not os.path.isfile(path):
continue
with open(path, "rb") as f:
data = f.read()
if prefix in data and expected not in data:
stale.append(rel)
return stale
def purge_registry_artifacts(stale: list[str], basedir: str = BASEDIR) -> None:
for rel in set(stale) | set(REGISTRY_ARTIFACTS[:3]):
path = os.path.join(basedir, rel)
if os.path.isfile(path):
os.remove(path)
def build(spinner, dirty: bool = False, minimal: bool = False, show_error_window: bool = True, registry_retry: bool = False) -> None:
env = os.environ.copy()
env.pop('PWD', None)
env['SCONS_PROGRESS'] = "1"
@@ -110,6 +147,22 @@ def build(spinner, dirty: bool = False, minimal: bool = False, show_error_window
t.wait_for_exit()
exit(1)
stale = stale_registry_artifacts()
if stale and not registry_retry:
cloudlog.error(f"compiled service registry is stale in {', '.join(stale)}, rebuilding messaging")
purge_registry_artifacts(stale)
build(spinner, dirty, minimal, show_error_window, registry_retry=True)
return
if stale:
error_s = "compiled service registry is still stale after rebuild: " + ", ".join(stale)
add_file_handler(cloudlog)
cloudlog.error(error_s)
spinner.close()
if not os.getenv("CI") and show_error_window:
with TextWindow("IQ.Pilot failed to build\n \n" + error_s) as t:
t.wait_for_exit()
exit(1)
# enforce max cache size
cache_files = [f for f in CACHE_DIR.rglob('*') if f.is_file()]
cache_files.sort(key=lambda f: f.stat().st_mtime)