From e6401c94f98f186152e13745e953f25eee861cbe Mon Sep 17 00:00:00 2001 From: Cass Date: Tue, 7 Jul 2026 21:49:26 -0500 Subject: [PATCH] fix(release): repair all build targets in the Release workflow The v0.17.2 Release run failed on every target. Three independent root causes, each fixed here: 1. Empty-string backend env vars were treated as "set". The CI matrix passes `GGML_VULKAN: ${{ matrix.vulkan && 'ON' || '' }}`, exporting the var as "" on non-Vulkan targets. `is_explicitly_set` used `env::var().is_ok()`, so "" counted as set and the CPU and macOS builds tried to link the ggml-vulkan / vulkan libraries absent from their prebuilt archives. Now empty/whitespace counts as unset. Fixes: Linux-x86_64 (CPU), macOS-arm64. 2. The prebuilt Vulkan target never installed libvulkan-dev. The "Install Vulkan SDK" step was gated on `!matrix.prebuilt`, but that target uses a prebuilt archive, so the step was skipped and the linker could not resolve -lvulkan. Install libvulkan-dev whenever matrix.vulkan. Fixes: Linux-x86_64-vulkan. 3. The llama.cpp submodule was stale. It was pinned to 0ccbfde (2026-02-14), far behind the b9837 release that the bridge code and prebuilt libraries target (b3fed31, 2026-06-28). The from-source CUDA/SYCL builds compiled autocommit_common_bridge.cpp against the old `common` API and failed on missing symbols (common_download_opts, common_params_speculative::draft, common_grammar, ...). Repin to b3fed31 (tag b9837). Fixes: Linux-x86_64-cuda, Linux-x86_64-sycl. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/release.yml | 5 ++++- crates/llama-sys/build.rs | 10 ++++++++-- third_party/llama.cpp | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e4a7206..7d2b7ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,8 +82,11 @@ jobs: sub-packages: '["nvcc", "cudart"]' non-cuda-sub-packages: '["libcublas", "libcublas-dev"]' + # libvulkan-dev provides the unversioned libvulkan.so the linker needs + # (-lvulkan). Required even for the prebuilt Vulkan target: its archive + # ships libggml-vulkan but links against the system Vulkan loader. - name: Install Vulkan SDK - if: matrix.vulkan && !matrix.prebuilt + if: matrix.vulkan run: sudo apt-get update && sudo apt-get install -y glslc libvulkan-dev - name: Add Intel oneAPI repository diff --git a/crates/llama-sys/build.rs b/crates/llama-sys/build.rs index 150ea9c..4f787ee 100644 --- a/crates/llama-sys/build.rs +++ b/crates/llama-sys/build.rs @@ -89,9 +89,15 @@ fn add_lib_dir_from_pkg_config(package: &str) { } } -/// Check whether `GGML_` is explicitly set (to any value). +/// Check whether `GGML_` is explicitly set to a non-empty value. +/// +/// CI passes backend flags as `GGML_VULKAN: ${{ matrix.vulkan && 'ON' || '' }}`, +/// which exports the variable as an empty string on targets that don't use that +/// backend. An empty value must count as "not set" — otherwise a plain CPU or +/// macOS build would try to link the Vulkan libraries that aren't present in its +/// (non-Vulkan) prebuilt archive. fn is_explicitly_set(var: &str) -> bool { - env::var(var).is_ok() + env::var(var).is_ok_and(|v| !v.trim().is_empty()) } /// Returns true if *any other* GPU backend was explicitly requested via env var. diff --git a/third_party/llama.cpp b/third_party/llama.cpp index 0ccbfde..b3fed31 160000 --- a/third_party/llama.cpp +++ b/third_party/llama.cpp @@ -1 +1 @@ -Subproject commit 0ccbfdef3e0a635530aec490f863d83edc22cbc4 +Subproject commit b3fed31b99f9bd37725833674252bccb429bb183