cmake : fall back to empty UI on stale assets when provisioning is disabled#26104
cmake : fall back to empty UI on stale assets when provisioning is disabled#26104wuisabel-gif wants to merge 2 commits into
Conversation
…bled A leftover tools/ui/dist with LLAMA_BUILD_UI=OFF and LLAMA_USE_PREBUILT_UI=OFF reached llama-ui-embed, which hard-fails on incomplete assets and broke the llama-server build. Now warn and fall back to the empty-UI embed in that case. Fatal error preserved when provisioning is enabled; valid local assets embed as before. Add a CTest that runs ui-assets.cmake in script mode and checks the four flag/asset combinations. Fixes ggml-org#25443
|
Verified this against the reproducer from #25443. It fixes both of the paths that issue described. Environment: Ubuntu Server 26.04 LTS, gcc 15.2.0, cmake 4.2.3, no npm/node on the box. Configured CPU-only (
On master both failures land on On the PR the same two cases produce the warning at
One small thing, not a blocker. The warning says the build is proceeding without an embedded UI, but not what to do about it. |
|
@notwitcheer Thanks for testing both paths. Good catch on the warning. c525974 adds the flag names and a note to remove the directory. Since the directory is gitignored, nothing else would ever surface it and the warning is the only place a user learns it exists. |
|
Confirmed on Same environment as the previous run: Ubuntu Server 26.04 LTS, gcc 15.2.0, cmake 4.2.3, no npm/node on the box,
I ran the two callers as separate cases rather than relying on both reaching the shared guard in One practical note: cmake wraps the message, so |
Overview
With
LLAMA_BUILD_UI=OFFandLLAMA_USE_PREBUILT_UI=OFF, a leftovertools/ui/dist(gitignored, so it silently survivesgit pull) still reachedllama-ui-embed, which hard-fails on an incomplete asset set and broke the wholellama-serverbuild.This PR makes the embed step, when both provisioning options are disabled, warn and fall back to the empty-UI embed (the same path taken when no assets exist) instead of failing the build. The fatal error is preserved whenever npm building or prebuilt downloads are enabled, and a valid local dist is still embedded as before.
Also adds a CTest (
tests/test-ui-assets.cmake) that runsui-assets.cmakein script mode against temporary directories and checks the four flag/asset combinations: incomplete assets with provisioning disabled falls back and warns, incomplete assets with either provisioning option enabled still fails, and complete local assets still embed. The required asset list is derived fromllama-ui-embed's own error output so the test doesn't go stale when the list changes.Fixes #25443
Additional information
The fix is based on the approach proposed by the reporter in #25443. Reproduced on current master before the change: with both flags OFF, a dist containing only a stale
index.htmlfails the build withUI: llama-ui-embed failed (1); after the change it warns and builds successfully. Verified a fullllama-serverbuild with the fix applied.Requirements