From 4a186d1de6bcc6c85e1cc05b4ec17cf0e780e3db Mon Sep 17 00:00:00 2001 From: Developer Date: Mon, 6 Apr 2026 17:23:26 -0700 Subject: [PATCH] Fix CPU sidecar builds bundling CUDA torch instead of CPU The CPU build steps used `uv run pyinstaller` which re-resolves dependencies from pyproject.toml's [tool.uv.sources] before running, pulling CUDA torch back in after the CPU-only reinstall. This made CPU and CUDA zips the same size. Fix: run pyinstaller directly from the venv (.venv/bin/pyinstaller on Linux/macOS, .venv\Scripts\pyinstaller.exe on Windows) to skip uv's dependency resolution entirely. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitea/workflows/build-sidecar.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/build-sidecar.yml b/.gitea/workflows/build-sidecar.yml index 66babee..d896e3a 100644 --- a/.gitea/workflows/build-sidecar.yml +++ b/.gitea/workflows/build-sidecar.yml @@ -152,7 +152,9 @@ jobs: run: | rm -rf dist/local-transcription-backend build/ uv pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu --force-reinstall - uv run pyinstaller local-transcription-headless.spec + # Run pyinstaller directly from venv to prevent uv run from + # re-resolving torch back to the CUDA version via pyproject.toml sources + .venv/bin/pyinstaller local-transcription-headless.spec - name: Package sidecar (CPU) run: | @@ -268,7 +270,9 @@ jobs: run: | Remove-Item -Recurse -Force dist\local-transcription-backend, build -ErrorAction SilentlyContinue uv pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu --force-reinstall - uv run pyinstaller local-transcription-headless.spec + # Run pyinstaller directly from venv to prevent uv run from + # re-resolving torch back to the CUDA version via pyproject.toml sources + .venv\Scripts\pyinstaller.exe local-transcription-headless.spec - name: Package sidecar (CPU) shell: powershell @@ -370,10 +374,9 @@ jobs: run: | # UV_NO_SOURCES bypasses pyproject.toml's [tool.uv.sources] which forces # torch from the CUDA index (no macOS ARM wheels there). - # Applies to both uv sync AND uv run (which re-resolves). # Default PyPI torch includes MPS (Apple Silicon GPU) support. uv sync - uv run pyinstaller local-transcription-headless.spec + .venv/bin/pyinstaller local-transcription-headless.spec - name: Package sidecar (CPU) run: |