From 03ed68bafec56ef8bb690440d796c1a742042907 Mon Sep 17 00:00:00 2001 From: historia Date: Fri, 28 Aug 2026 18:44:32 -0400 Subject: feat(audio.cpp): if github binary download fails, automatically start building from source --- app/backends/audiocpp/build.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'app/backends/audiocpp/build.py') diff --git a/app/backends/audiocpp/build.py b/app/backends/audiocpp/build.py index f840193..e3536cf 100644 --- a/app/backends/audiocpp/build.py +++ b/app/backends/audiocpp/build.py @@ -138,22 +138,26 @@ def _update_prebuilt(checkout: Path, backend: Optional[str], *, """The update route for a prebuilt (release-downloaded) install. Source builds update by rebuilding after a git pull; a prebuilt - install instead re-downloads when upstream published a newer release - (the marker's tag is compared against the latest release tag). The - recorded/detected backend selects the asset, mirroring what was - originally installed. A GitHub outage is not fatal — the installed - binary keeps working. Returns the install exit code (0 when already - current or when the check could not run). + install instead re-downloads when upstream published a newer release. + The current-version check resolves the newest tag from the release + page's redirect (no API quota); the API is only consulted by the + re-download itself, for the checksum digests. The recorded/detected + backend selects the asset, mirroring what was originally installed. + A GitHub outage is not fatal — the installed binary keeps working. + Returns the install exit code (0 when already current or when the + check could not run). """ marker = _prebuilt.installed_release(checkout, backend) - release = _prebuilt.fetch_latest_release() - if release is None: + tag = _prebuilt.resolve_latest_tag() + if tag is None: + release = _prebuilt.fetch_latest_release() + tag = str(release.get("tag_name") or "") if release else "" + if not tag: print("[WARNING] Could not check GitHub for a newer prebuilt " "audiocpp_server; keeping the installed one (" f"{marker.get('tag') if marker else 'unknown'}).") return 0 - tag = str(release.get("tag_name") or "") - if marker and tag and tag == marker.get("tag"): + if marker and tag == marker.get("tag"): print(f"[OK] Prebuilt audiocpp_server is current ({tag}).") return 0 print(f"[INFO] audio.cpp {tag} is available; downloading the prebuilt " -- cgit v1.2.3