From ee6ff6e9d5a05ee559b4b179c6b74b5006f1c7e0 Mon Sep 17 00:00:00 2001 From: MasterPhooey Date: Sat, 25 Apr 2026 08:46:34 -0500 Subject: [PATCH] micro-opus fix --- dockerfile | 2 +- trainer_server.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dockerfile b/dockerfile index 37bb910..0fd7bbd 100644 --- a/dockerfile +++ b/dockerfile @@ -6,7 +6,7 @@ ENV DEBIAN_FRONTEND=noninteractive # System deps RUN apt-get update && apt-get install -y --no-install-recommends \ python3.12 python3.12-venv python3.12-dev python3-pip python-is-python3 \ - git wget curl unzip ca-certificates nano less \ + git wget curl unzip patch ca-certificates nano less \ && rm -rf /var/lib/apt/lists/* \ && mkdir -p /data diff --git a/trainer_server.py b/trainer_server.py index ee22d58..f342c46 100644 --- a/trainer_server.py +++ b/trainer_server.py @@ -1931,6 +1931,21 @@ def _run_firmware_build_flash_background(session_id: str): template_key = str(session.get("template_key") or "") values = session.get("values") if isinstance(session.get("values"), dict) else {} + if shutil.which("patch") is None: + _append_firmware_log(session_id, "✗ Firmware build cannot start: required system command 'patch' was not found.") + _append_firmware_log( + session_id, + "Tip: rebuild the Nvidia Docker image so it includes the patch utility required by ESP-IDF micro-opus.", + ) + with FIRMWARE_LOCK: + live = FIRMWARE_SESSIONS.get(session_id) + if isinstance(live, dict): + live["running"] = False + live["exit_code"] = 997 + live["finished_at"] = datetime.now(timezone.utc).isoformat() + live["message"] = "Firmware build dependency missing: patch." + return + try: config_path, _normalized = _render_firmware_config(template_key, values, host, session_id) except Exception as exc: