From ddc35fde1619ce2e605ba8bfe5ca12489c407fd5 Mon Sep 17 00:00:00 2001 From: Cass Date: Tue, 7 Jul 2026 22:02:44 -0500 Subject: [PATCH] fix(build): disable LLAMA_BUILD_APP/UI in llama.cpp source build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The b9837 submodule bump (#42) resolved the bridge API drift, but the from-source CUDA and SYCL release targets then failed at 3% with: app/llama.cpp:1:10: fatal error: build-info.h: No such file or directory b9837 introduced two new CMake targets — LLAMA_BUILD_APP (the "unified binary") and LLAMA_BUILD_UI — both defaulting ON for a standalone (top-level) build. build.rs disables TESTS/EXAMPLES/TOOLS/SERVER but not these, so cmake tried to build app/llama.cpp, which needs a generated build-info.h and breaks the library-only build we need for FFI. Pass -DLLAMA_BUILD_APP=OFF and -DLLAMA_BUILD_UI=OFF. Verified against a b9837 checkout: with these flags the app subdirectory is no longer configured and libllama/ggml/common build cleanly. Only affects the from-source backends (CUDA/SYCL); prebuilt targets (CPU/Vulkan/macOS) never run the cmake source build. Co-Authored-By: Claude Opus 4.8 --- crates/llama-sys/build.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/llama-sys/build.rs b/crates/llama-sys/build.rs index 4f787ee..af07b31 100644 --- a/crates/llama-sys/build.rs +++ b/crates/llama-sys/build.rs @@ -612,7 +612,15 @@ fn build_from_source(source_dir: &Path, out_dir: &Path, manifest_dir: &Path) { .arg("-DLLAMA_BUILD_TESTS=OFF") .arg("-DLLAMA_BUILD_EXAMPLES=OFF") .arg("-DLLAMA_BUILD_TOOLS=OFF") - .arg("-DLLAMA_BUILD_SERVER=OFF"); + .arg("-DLLAMA_BUILD_SERVER=OFF") + // b9837+ introduced these targets, both defaulting ON for a standalone + // (top-level) build. We only need the libraries for FFI, so disable + // them. LLAMA_BUILD_APP (the "unified binary") compiles app/llama.cpp, + // which needs a generated build-info.h and breaks the source build; + // LLAMA_BUILD_UI would fetch a prebuilt web UI. Both are unknown to + // older releases, where CMake harmlessly ignores the unused flags. + .arg("-DLLAMA_BUILD_APP=OFF") + .arg("-DLLAMA_BUILD_UI=OFF"); if use_cuda { configure.arg("-DGGML_CUDA=ON"); }