Fix sidecar builds: macOS CUDA resolution and Windows uv install

macOS: pyproject.toml's [tool.uv.sources] forces torch from the CUDA
index which has no macOS ARM wheels. Use `uv sync --no-sources` to
bypass this and get torch from PyPI (which includes MPS support).

Windows: Add additional uv PATH locations ($LOCALAPPDATA\uv\bin) for
robustness with different runner environments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Developer
2026-04-06 13:48:19 -07:00
parent 4c519a109a
commit 0a01dfb3fa

View File

@@ -141,7 +141,7 @@ jobs:
- name: Build sidecar (CUDA)
run: |
uv sync
uv sync --frozen || uv sync
uv run pyinstaller local-transcription-headless.spec
- name: Package sidecar (CUDA)
@@ -151,7 +151,6 @@ jobs:
- name: Build sidecar (CPU)
run: |
rm -rf dist/local-transcription-backend build/
# Install CPU-only PyTorch
uv pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu --force-reinstall
uv run pyinstaller local-transcription-headless.spec
@@ -228,7 +227,17 @@ jobs:
Write-Host "uv already installed: $(uv --version)"
} else {
irm https://astral.sh/uv/install.ps1 | iex
echo "$env:USERPROFILE\.local\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# Add both possible uv install locations to PATH
$uvPaths = @(
"$env:USERPROFILE\.local\bin",
"$env:USERPROFILE\.cargo\bin",
"$env:LOCALAPPDATA\uv\bin"
)
foreach ($p in $uvPaths) {
if (Test-Path $p) {
echo $p | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
}
}
}
- name: Set up Python
@@ -245,7 +254,8 @@ jobs:
- name: Build sidecar (CUDA)
shell: powershell
run: |
uv sync
uv sync --frozen
if ($LASTEXITCODE -ne 0) { uv sync }
uv run pyinstaller local-transcription-headless.spec
- name: Package sidecar (CUDA)
@@ -356,9 +366,10 @@ jobs:
- name: Build sidecar (CPU)
run: |
# Install CPU-only PyTorch for macOS (MPS support included in default torch)
uv sync
uv pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu --force-reinstall
# --no-sources bypasses pyproject.toml's [tool.uv.sources] which forces
# torch from the CUDA index (no macOS ARM wheels there)
# Default PyPI torch includes MPS (Apple Silicon GPU) support
uv sync --no-sources
uv run pyinstaller local-transcription-headless.spec
- name: Package sidecar (CPU)