fix(ci): set LIBCLANG_PATH on Linux; install Vulkan via brew on macOS
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled

Two follow-ups to the previous CI deps commit:

1. Linux: libclang-dev installs libclang.so under
   /usr/lib/llvm-*/lib and /usr/lib/x86_64-linux-gnu, but
   bindgen-0.72.1 does not probe the llvm-versioned directory by
   default. Resolve the newest /usr/lib/llvm-*/lib candidate
   dynamically and export LIBCLANG_PATH so bindgen finds it without
   any clang-sys guesswork. Also install glslang-tools + spirv-tools
   so find_package(Vulkan COMPONENTS glslc) succeeds against
   ggml-vulkan's cmake step.

2. macOS: llama-cpp-sys-2 sets GGML_VULKAN=ON unconditionally when
   the vulkan feature is enabled; cmake's find_package(Vulkan) then
   fails on a vanilla macOS-latest runner because there is no
   Vulkan SDK shipped by default. The LunarG macOS SDK ships as a
   non-scriptable interactive installer, so we compose MoltenVK +
   Vulkan loader + headers + shaderc via Homebrew formulae instead.
   Export VULKAN_SDK=$(brew --prefix) and CMAKE_PREFIX_PATH=same so
   both the build.rs branch and cmake's FindVulkan resolve headers /
   libs / glslc from /opt/homebrew.

Applied symmetrically to check.yml and build.yml. Windows config is
unchanged.

Co-authored-by: jars <jakejars@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-04-21 13:47:29 +00:00
committed by Jake
parent 5c36bdec28
commit 2f763e124b
2 changed files with 39 additions and 11 deletions

View File

@@ -81,14 +81,25 @@ jobs:
build-essential \
libclang-dev \
clang \
libvulkan-dev
libvulkan-dev \
glslang-tools \
spirv-tools
LIBCLANG_CANDIDATE=$(ls -d /usr/lib/llvm-*/lib 2>/dev/null | sort -V | tail -n1)
if [ -z "$LIBCLANG_CANDIDATE" ]; then
LIBCLANG_CANDIDATE=/usr/lib/x86_64-linux-gnu
fi
echo "LIBCLANG_PATH=$LIBCLANG_CANDIDATE" >> "$GITHUB_ENV"
- 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
brew install vulkan-headers vulkan-loader molten-vk shaderc
echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> "$GITHUB_ENV"
BREW_PREFIX=$(brew --prefix)
echo "VULKAN_SDK=$BREW_PREFIX" >> "$GITHUB_ENV"
echo "CMAKE_PREFIX_PATH=$BREW_PREFIX" >> "$GITHUB_ENV"
- name: Install Windows deps
if: matrix.os == 'windows-latest'

View File

@@ -35,11 +35,12 @@ jobs:
# 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.
# - Vulkan: llama-cpp-sys-2's `vulkan` feature wires `GGML_VULKAN=ON`
# for its embedded llama.cpp build, which runs `find_package(Vulkan)`
# and needs headers + loader + glslc at configure time (and
# libvulkan.so at link time). On Linux apt-get covers all four.
# - LIBCLANG_PATH: set explicitly because bindgen-0.72.1's default
# search path does not include /usr/lib/llvm-*/lib on 22.04.
- name: Install Linux deps
if: matrix.os == 'ubuntu-22.04'
run: |
@@ -55,19 +56,35 @@ jobs:
build-essential \
libclang-dev \
clang \
libvulkan-dev
libvulkan-dev \
glslang-tools \
spirv-tools
LIBCLANG_CANDIDATE=$(ls -d /usr/lib/llvm-*/lib 2>/dev/null | sort -V | tail -n1)
if [ -z "$LIBCLANG_CANDIDATE" ]; then
LIBCLANG_CANDIDATE=/usr/lib/x86_64-linux-gnu
fi
echo "LIBCLANG_PATH=$LIBCLANG_CANDIDATE" >> "$GITHUB_ENV"
# macOS: cmake is preinstalled in macos-latest but pin via brew to
# 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.
# be explicit. Xcode CLT provides libclang but the runner's default
# clang install does not ship libclang.dylib in a discoverable
# location — use Homebrew's LLVM and point LIBCLANG_PATH at it.
#
# Vulkan on macOS is provided by MoltenVK (Vulkan → Metal shim).
# We install the Homebrew formulae individually rather than the
# LunarG macOS SDK, which ships as an interactive .dmg/.app and
# doesn't scriptify cleanly. shaderc gives us glslc, which
# find_package(Vulkan) requires at cmake configure time.
- 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.
brew install vulkan-headers vulkan-loader molten-vk shaderc
echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> "$GITHUB_ENV"
BREW_PREFIX=$(brew --prefix)
echo "VULKAN_SDK=$BREW_PREFIX" >> "$GITHUB_ENV"
echo "CMAKE_PREFIX_PATH=$BREW_PREFIX" >> "$GITHUB_ENV"
# Windows: cmake + clang (for whisper-rs-sys/llama-cpp-sys bindgen)
# + Vulkan SDK (required by llama-cpp-sys-2 when the `vulkan`