From 089cb46b6f51f947eff26b4463990edcdd7c5fdf Mon Sep 17 00:00:00 2001 From: bong-water-water-bong Date: Sun, 25 Oct 2026 03:05:24 -0300 Subject: [PATCH] package: ship llama-perplexity, and prove provenance before localizing Two blockers in the package stage after #556, both fatal for the release build: - #556's load check requires hrx/llama/bin/llama-perplexity, but `put` never staged it, so every package run died with "missing from the package". The build makes it (cmake/hrx.cmake builds llama-server, llama-bench and llama-perplexity) and #556's localization gives it $ORIGIN RUNPATHs and its libllama-perplexity-impl.so, so stage it like the other two tools. - pack_require_provenance compares each staged file byte for byte with the same path under the build, and #556 called it after pack_localize - which rewrites every RUNPATH with patchelf and copies libomp.so in. Nothing can match after that, so the check failed on every file. Run it before pack_localize, where the staged copies are still the build's own bytes (and libomp.so is not there yet). Proved on the release build (engine e7d64b8, strixhalo): scripts/package-linux.sh exits 0, hrx/llama/bin ships 27 files with llama-server, llama-bench and llama-perplexity, the three sealed NPU sets, and no "cannot load" line from #556's own check. Co-Authored-By: Claude Fable 5.1 --- scripts/package-linux.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/package-linux.sh b/scripts/package-linux.sh index 4c2d5963..55a2d3ed 100755 --- a/scripts/package-linux.sh +++ b/scripts/package-linux.sh @@ -52,7 +52,7 @@ put() { } cp -a "$build/1bit" "$stage/" -put hrx/llama/bin llama-server llama-bench +put hrx/llama/bin llama-server llama-bench llama-perplexity put ds4/hip ds4-server ds4 ds4-bench # the sealed NPU kernel sets (scripts/weekly.sh, WEEKLY_NPU_KERNELS): encrypted artifacts, packed @@ -88,6 +88,12 @@ if [ -d "$build/npu" ]; then echo " scripts, tools: the GGUF-on-NPU helpers ($(ls "$stage/scripts" "$stage/tools" | wc -l) files)" fi +# Everything staged has to come from the build being packaged. This compares bytes with the same path under the +# build, so it runs before pack_localize: localization rewrites every RUNPATH (and adds libomp.so, which the build +# does not have), after which nothing would match. +provenance_bad=$(pack_require_provenance "$stage" "$build" || true) +[ -z "$provenance_bad" ] || { echo "files that did not come from this build:"; echo "$provenance_bad"; exit 1; } + # Every program and library finds its libraries beside itself (scripts/pack-elf.sh): a library it # loads from elsewhere in the build tree (HRX's libhrx, libloomc) or LLVM's OpenMP runtime # (libomp.so, which ggml's CPU code links when TheRock's amdclang builds llama.cpp) is copied beside @@ -104,10 +110,6 @@ tools_bad+=$(pack_require_tools "$stage" hrx/llama/bin llama-server llama-bench tools_bad+=$(pack_require_tools "$stage" ds4/hip ds4-server ds4 ds4-bench || true) [ -z "$tools_bad" ] || { echo "shipped tools that cannot load:"; echo "$tools_bad"; exit 1; } -# everything shipped has to come from the build being packaged -provenance_bad=$(pack_require_provenance "$stage" "$build" || true) -[ -z "$provenance_bad" ] || { echo "files that did not come from this build:"; echo "$provenance_bad"; exit 1; } - # anything else that cannot load leaves the package rather than shipping broken pack_prune_unloadable "$stage"