From db8f1bf19dc1f16e4471e6c67c0f4f45d5514abe Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 21 Apr 2026 13:08:55 +0000 Subject: [PATCH] fix(ci): install libclang + Vulkan SDK on all platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both whisper-rs-sys and llama-cpp-sys-2 run bindgen at build time, which requires libclang.so/dylib/dll resolvable from the loader. None of the three GitHub runners ship this out of the box today: - ubuntu-22.04: bindgen-0.72.1 panics with 'couldn't find any valid shared libraries matching libclang.so*' - macos-latest: same panic against libclang.dylib - windows-latest: choco already installed llvm here, but libclang was on an unset LIBCLANG_PATH, so bindgen still couldn't find it And llama-cpp-sys-2's vulkan feature (wired on by whisper-rs' vulkan feature → whisper-rs-sys + its own shared ggml build) hard-panics on Windows when VULKAN_SDK is unset, and needs libvulkan.so linkable on Linux. Changes, applied symmetrically to check.yml and build.yml: - Linux: add libclang-dev, clang, libvulkan-dev to apt-get install. - macOS: brew install llvm, set LIBCLANG_PATH to brew --prefix llvm /lib so bindgen can load libclang.dylib. - Windows: choco install vulkan-sdk, set VULKAN_SDK to the newest-version directory under C:\VulkanSDK (resolved dynamically so a minor-version bump doesn't hardcode-break anything), set LIBCLANG_PATH to the llvm bin dir. Unblocks the per-push cargo check job on main, phase4-systems-f7d0, and phase4-ux-f7d0; also unblocks the release build. The Windows Vulkan SDK install is the new long pole (~2 min on a cold runner) but is needed unconditionally while the vulkan feature is on in crates/transcription/Cargo.toml. Co-authored-by: jars --- .github/workflows/build.yml | 17 ++++++++++++++- .github/workflows/check.yml | 43 +++++++++++++++++++++++++++++-------- 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0472101..f4f9d4c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,6 +64,8 @@ jobs: - uses: actions/checkout@v4 # System packages — same as check.yml but locked to release-build needs. + # See check.yml for the per-package rationale (bindgen → libclang, + # llama-cpp-sys-2 vulkan feature → libvulkan / VULKAN_SDK). - name: Install Linux deps if: matrix.os == 'ubuntu-22.04' run: | @@ -76,12 +78,17 @@ jobs: libudev-dev \ patchelf \ cmake \ - build-essential + build-essential \ + libclang-dev \ + clang \ + libvulkan-dev - name: Install macOS deps if: matrix.os == 'macos-latest' run: | brew list cmake >/dev/null 2>&1 || brew install cmake + brew list llvm >/dev/null 2>&1 || brew install llvm + echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> "$GITHUB_ENV" - name: Install Windows deps if: matrix.os == 'windows-latest' @@ -89,6 +96,14 @@ jobs: run: | cmake --version choco install -y llvm --no-progress + choco install -y vulkan-sdk --no-progress + $sdkRoot = Get-ChildItem -Directory "C:\VulkanSDK" | Sort-Object Name -Descending | Select-Object -First 1 + if (-not $sdkRoot) { + Write-Error "VulkanSDK directory not found under C:\VulkanSDK after choco install" + exit 1 + } + echo "VULKAN_SDK=$($sdkRoot.FullName)" >> $env:GITHUB_ENV + echo "LIBCLANG_PATH=C:\Program Files\LLVM\bin" >> $env:GITHUB_ENV - name: Install Node uses: actions/setup-node@v4 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 834464f..56997aa 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -32,9 +32,14 @@ jobs: steps: - uses: actions/checkout@v4 - # System packages whisper-rs-sys + Tauri need on each OS. - # Linux is the heaviest because we depend on GTK/WebKit, audio, - # evdev, plus cmake for whisper.cpp. + # System packages whisper-rs-sys + llama-cpp-sys-2 + Tauri need on each OS. + # - libclang-dev: bindgen (pulled by whisper-rs-sys + llama-cpp-sys-2) + # needs a libclang shared library at build time. + # - libvulkan-dev: llama-cpp-sys-2's `vulkan` feature links against + # libvulkan.so at build time, even when VULKAN_SDK is unset + # (falls back to the system-provided lib on Linux). + # - Linux is the heaviest because we depend on GTK/WebKit, audio, + # evdev, plus cmake for whisper.cpp. - name: Install Linux deps if: matrix.os == 'ubuntu-22.04' run: | @@ -47,25 +52,45 @@ jobs: libudev-dev \ patchelf \ cmake \ - build-essential + build-essential \ + libclang-dev \ + clang \ + libvulkan-dev # macOS: cmake is preinstalled in macos-latest but pin via brew to - # be explicit and future-proof. + # be explicit and future-proof. Xcode CLT provides libclang but the + # runner's default clang install does not ship libclang.dylib — use + # Homebrew's LLVM, which does, and point LIBCLANG_PATH at it. - name: Install macOS deps if: matrix.os == 'macos-latest' run: | brew list cmake >/dev/null 2>&1 || brew install cmake + brew list llvm >/dev/null 2>&1 || brew install llvm + # Expose libclang.dylib to bindgen for subsequent steps. + echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> "$GITHUB_ENV" - # Windows: cmake + clang are needed by whisper-rs-sys. cmake is on - # windows-latest by default; ensure it. + # Windows: cmake + clang (for whisper-rs-sys/llama-cpp-sys bindgen) + # + Vulkan SDK (required by llama-cpp-sys-2 when the `vulkan` + # feature is on — it hard-panics on a missing VULKAN_SDK env var). + # + # choco's `vulkan-sdk` package installs into + # C:\VulkanSDK\\; the canonical VULKAN_SDK path is that + # directory. We resolve it dynamically so a minor-version bump in + # the SDK doesn't hardcode-break this step. - name: Install Windows deps if: matrix.os == 'windows-latest' shell: pwsh run: | - # cmake is on the runner image; verify it. cmake --version - # LLVM/clang for whisper.cpp's sources. choco install -y llvm --no-progress + choco install -y vulkan-sdk --no-progress + $sdkRoot = Get-ChildItem -Directory "C:\VulkanSDK" | Sort-Object Name -Descending | Select-Object -First 1 + if (-not $sdkRoot) { + Write-Error "VulkanSDK directory not found under C:\VulkanSDK after choco install" + exit 1 + } + echo "VULKAN_SDK=$($sdkRoot.FullName)" >> $env:GITHUB_ENV + echo "LIBCLANG_PATH=C:\Program Files\LLVM\bin" >> $env:GITHUB_ENV - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable