mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-10-02 16:45:15 -07:00
fix: address PR review feedback from CodeRabbit
- Upgrade softprops/action-gh-release@v1 to @v2 (Node 16 EOL) - Fail-fast on checksum fetch failure instead of extracting unverified archives - Abort packaging if no NVIDIA files found (prevents empty cuda-libs archive) - Fix nvidia/ path detection bug (list membership vs substring check) - Fix justfile Copy-Item nesting (copy contents, not the directory itself)
This commit is contained in:
@@ -216,7 +216,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload archives to GitHub Release
|
- name: Upload archives to GitHub Release
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
release-assets/voicebox-server-cuda.tar.gz
|
release-assets/voicebox-server-cuda.tar.gz
|
||||||
|
|||||||
@@ -156,16 +156,16 @@ async def _download_and_extract_archive(
|
|||||||
if temp_path.exists():
|
if temp_path.exists():
|
||||||
temp_path.unlink()
|
temp_path.unlink()
|
||||||
|
|
||||||
# Fetch expected checksum
|
# Fetch expected checksum (fail-fast: never extract an unverified archive)
|
||||||
expected_sha = None
|
expected_sha = None
|
||||||
if sha256_url:
|
if sha256_url:
|
||||||
try:
|
try:
|
||||||
sha_resp = await client.get(sha256_url)
|
sha_resp = await client.get(sha256_url)
|
||||||
if sha_resp.status_code == 200:
|
sha_resp.raise_for_status()
|
||||||
expected_sha = sha_resp.text.strip().split()[0]
|
expected_sha = sha_resp.text.strip().split()[0]
|
||||||
logger.info(f"{label}: expected SHA-256: {expected_sha[:16]}...")
|
logger.info(f"{label}: expected SHA-256: {expected_sha[:16]}...")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning(f"{label}: could not fetch checksum — skipping verification: {e}")
|
raise RuntimeError(f"{label}: failed to fetch checksum from {sha256_url}") from e
|
||||||
|
|
||||||
# Stream download
|
# Stream download
|
||||||
downloaded = 0
|
downloaded = 0
|
||||||
|
|||||||
@@ -210,7 +210,8 @@ build-server-cuda: _ensure-venv
|
|||||||
if ($LASTEXITCODE -ne 0) { throw "build_binary.py --cuda failed with exit code $LASTEXITCODE" }; \
|
if ($LASTEXITCODE -ne 0) { throw "build_binary.py --cuda failed with exit code $LASTEXITCODE" }; \
|
||||||
$dest = "$env:APPDATA/com.voicebox.app/backends/cuda"; \
|
$dest = "$env:APPDATA/com.voicebox.app/backends/cuda"; \
|
||||||
if (Test-Path $dest) { Remove-Item -Recurse -Force $dest }; \
|
if (Test-Path $dest) { Remove-Item -Recurse -Force $dest }; \
|
||||||
Copy-Item "backend/dist/voicebox-server-cuda" $dest -Recurse -Force; \
|
New-Item -ItemType Directory -Path $dest -Force | Out-Null; \
|
||||||
|
Copy-Item "backend/dist/voicebox-server-cuda/*" $dest -Recurse -Force; \
|
||||||
Write-Host "Copied CUDA backend to $dest"
|
Write-Host "Copied CUDA backend to $dest"
|
||||||
|
|
||||||
# Build everything locally: CPU server + CUDA server + installable Tauri app
|
# Build everything locally: CPU server + CUDA server + installable Tauri app
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ def is_nvidia_file(rel_path: str) -> bool:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
# Files under nvidia/ subdirectory tree (older torch layout)
|
# Files under nvidia/ subdirectory tree (older torch layout)
|
||||||
if rel_lower.startswith("nvidia/") or "nvidia/" in rel_lower.split("/", 1)[-1:]:
|
if rel_lower.startswith("nvidia/") or "/nvidia/" in rel_lower:
|
||||||
# Only DLLs/shared objects — not .py, .dist-info, etc.
|
# Only DLLs/shared objects — not .py, .dist-info, etc.
|
||||||
if rel_lower.endswith((".dll", ".so")):
|
if rel_lower.endswith((".dll", ".so")):
|
||||||
return True
|
return True
|
||||||
@@ -127,13 +127,15 @@ def package(
|
|||||||
|
|
||||||
if not nvidia_files:
|
if not nvidia_files:
|
||||||
print(
|
print(
|
||||||
"WARNING: No NVIDIA files found! The CUDA libs archive will be empty.",
|
f"ERROR: No NVIDIA files found in {onedir_path}. "
|
||||||
|
"Refusing to create an empty CUDA libs archive.",
|
||||||
file=sys.stderr,
|
file=sys.stderr,
|
||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
"Make sure you built with --cuda and the NVIDIA packages are present.",
|
"Make sure you built with --cuda and the NVIDIA packages are present.",
|
||||||
file=sys.stderr,
|
file=sys.stderr,
|
||||||
)
|
)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
# Create server core archive
|
# Create server core archive
|
||||||
# Files are stored relative to the archive root (no parent directory prefix)
|
# Files are stored relative to the archive root (no parent directory prefix)
|
||||||
|
|||||||
Reference in New Issue
Block a user