Repository navigation
package: every shipped program must resolve its NEEDED libraries the way a user runs it - #556
Conversation
…way a user runs it The 2026-10-23 rc shipped `hrx/llama/bin/llama-perplexity` without `libllama-perplexity-impl.so`: the tool never started, and anything that used it failed at launch rather than at build time. Two things in the stage made that possible, and both are fixed here. - **The implementation library is built.** `cmake/hrx.cmake`'s HRX build targeted `llama-server llama-bench` only, so the impl library for `llama-perplexity` did not exist to be packed. `llama-perplexity` joins the target list, so the next package carries both halves. - **The stage now refuses to ship a program it cannot load.** `pack_prune_unloadable()` drops a program whose NEEDED libraries do not resolve from the package and the system, with a line saying so, instead of shipping a binary that fails at first use; `pack_artifact_hygiene()` reports any that remain, so a package cannot quietly pass with one. The resolve check runs the way a user launches the binary: **plain `ldd` with no `LD_LIBRARY_PATH`**, so only the ELF's own RUNPATH and the system are consulted. A library path inherited from the build shell resolves against the build tree and would hide exactly this defect. Proof on a copy of the rc (no program run): ``` # as shipped, on this box: it resolves *through a RUNPATH into the build cache*, which no user has libllama-perplexity-impl.so => /home/bcloud/.cache/hw-gate/build-685489b587/bin/libllama-perplexity-impl.so RUNPATH starts at: /home/bcloud/.cache/hw-gate/build-685489b587/bin # with that RUNPATH removed — the shape the next package ships in, $ORIGIN only libllama-perplexity-impl.so => not found libllama-common.so.0 => not found # the gate catches it 1bit/hrx/llama/bin/llama-perplexity: libllama-perplexity-impl.so 1bit/hrx/llama/bin/llama-perplexity: libllama-common.so.0 (…) # and the stage drops the program rather than shipping it broken drop 1bit/hrx/llama/bin/llama-perplexity: needs a library the package does not carry 1 program(s) dropped as unloadable → gate on the pruned tree: clean ``` This is for the next package, not the rc: the rc keeps the defect it was cut with. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
PR Reviewer Guide 🔍(Review updated until commit 7ae1c10)Here are some key observations to aid the review process:
|
… one cannot load The 2026-10-23 rc shipped `hrx/llama/bin/llama-perplexity` with RUNPATH entries into `/home/bcloud/.cache/hw-gate/build-685489b587/…` and without `libllama-perplexity-impl.so`: the binary came from a hardware-gate build, not from the build being packaged, so it carries that build's paths and is missing the part that build never produced. It failed at first use, and the KLD rows that used it failed with it. Four checks, each catching one step of that: - **`pack_require_provenance <stage> <build>`** — every ELF in the stage must exist at the same relative path under the build being packaged and be byte-identical to it. A tool copied in from another tree fails here, before anything else looks at it. - **`pack_require_tools <stage> <rel> <program…>`** — the programs the release promises (`llama-server`, `llama-bench`, `llama-perplexity`, the three ds4 binaries) must be in the package and must resolve; otherwise the package stops instead of quietly losing a tool. - **`pack_unresolved_needed <stage>`** — plain `ldd`, **no** `LD_LIBRARY_PATH`, so only the ELF's own RUNPATH and the system count, which is how a user launches it. - **`pack_artifact_hygiene`** — additionally fails on an absolute RUNPATH outside the toolchain root (that is what points into a build machine), and `pack_prune_unloadable` drops any incidental ELF that cannot load. And the tool now exists in the package build: `cmake/hrx.cmake` builds `llama-perplexity` alongside `llama-server` and `llama-bench`, so its implementation library is produced and ships beside it with `$ORIGIN`. Measured against the rc (copy, no program run): ``` # provenance, with the rc build tree as the build being packaged hrx/llama/bin/llama-perplexity is not in the build being packaged ← the defect, named # the promised tools, once the build-machine RUNPATH is gone (the next package's shape) libllama-perplexity-impl.so => not found 1bit/hrx/llama/bin/llama-perplexity: libllama-perplexity-impl.so ← gate drop 1bit/hrx/llama/bin/llama-perplexity: needs a library the package does not carry ``` This is for the next package; the rc keeps the defect it was cut with. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
Precise cause and the checks for it, after the freeze/reboot — re-verified on both boxes before trusting any of it. Cause: Now (this PR, second commit):
Correction to my earlier note: the ds4 binaries are in the rc package (three ~25 MB binaries, RUNPATH One caveat worth knowing: |
|
Preparing review... |
|
Persistent review updated to latest commit e6f2333 |
|
Persistent review updated to latest commit 7ae1c10 |
#563) After #556 the package stage required llama-perplexity but never staged it, and the byte-for-byte provenance check ran after localization rewrote RUNPATHs so it could never pass. Stage the binary and its impl library; compare provenance before pack_localize. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… comment Rebased onto main (0d0c846) and reviewed against the current packaging, image and release check (#556, #563, #569): - docs/releases.md conflicted on the pins table and the NPU paragraph: the branch put the private repositories' names back into a public file ("gpu-kernels (private, HIP)", "npu-kernels (private, signed)", "npu-runtime (private)"), which main had scrubbed. Resolved keeping main's wording ("private kernel add-on (HIP)", "private NPU kernel set (signed)", "private NPU runtime") and the new shape. - scripts/weekly.sh package_checks: the set's manifest is now derived from `rel` once, instead of rebuilding the path with `${f%/npu/kernels/*}` plus `cut` (which can leave a double slash). Checked that the derived path resolves for <pkg>/npu/kernels/<set>/<id>/layer1.elf. - os/mini/init.sh: comment wrapped. Not marked ready: the package stage stages nothing against the pins in this tree (see the PR comment). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
package: every shipped program must resolve its NEEDED libraries the way a user runs it
The 2026-10-23 rc shipped
hrx/llama/bin/llama-perplexitywithoutlibllama-perplexity-impl.so: the toolnever started, and anything that used it failed at launch rather than at build time. Two things in the stage
made that possible, and both are fixed here.
cmake/hrx.cmake's HRX build targetedllama-server llama-benchonly, so the impl library for
llama-perplexitydid not exist to be packed.llama-perplexityjoins thetarget list, so the next package carries both halves.
pack_prune_unloadable()drops a program whoseNEEDED libraries do not resolve from the package and the system, with a line saying so, instead of shipping
a binary that fails at first use;
pack_artifact_hygiene()reports any that remain, so a package cannotquietly pass with one.
The resolve check runs the way a user launches the binary: plain
lddwith noLD_LIBRARY_PATH, so onlythe ELF's own RUNPATH and the system are consulted. A library path inherited from the build shell resolves
against the build tree and would hide exactly this defect.
Proof on a copy of the rc (no program run):
This is for the next package, not the rc: the rc keeps the defect it was cut with.
🤖 Generated with Claude Code