fix(build): set LD_LIBRARY_PATH for chrooted xkbcomp — fresh image has no ld-elf.so.hints #277

Merged
clawdie merged 1 commit from fix/xkb-chroot-ldpath into main 2026-07-19 13:38:10 +02:00
Owner

Follow-up to #275, which did its job: the same loader error reappeared but this time surfaced honestly (xkbcomp: ld-elf.so.1: Shared object "libxkbfile.so.1" not found) — from inside the chroot.

Root cause, one layer deeper: a freshly assembled image has no /var/run/ld-elf.so.hints (ldconfig runs at boot via rc, which has never happened), and FreeBSD's rtld does not search /usr/local/lib without the hints file. The image's X libraries are present on disk but invisible to the loader until first boot — chroot or not.

Fix: wrap both chrooted xkbcomp invocations with /usr/bin/env LD_LIBRARY_PATH=/usr/local/lib. Chosen over running chroot ldconfig because it leaves zero residue in the image (no generated hints file to ship). TESTING.md's post-build check gets the identical wrap.

Premise check before merge (pool still mounted on valhala): ls tmp/cache/mnt/usr/local/lib/libxkbfile* tmp/cache/mnt/var/run/ld-elf.so.hints — expected: library present, hints file absent. If the library is MISSING instead, this is a pkg dependency gap, not a loader-path issue, and this PR alone won't fix it.

Gates: ./scripts/check-format.sh green, sh -n build.sh clean.

🤖 Generated with Claude Code

Follow-up to #275, which did its job: the same loader error reappeared but this time **surfaced honestly** (`xkbcomp: ld-elf.so.1: Shared object "libxkbfile.so.1" not found`) — from *inside* the chroot. Root cause, one layer deeper: a freshly assembled image has **no `/var/run/ld-elf.so.hints`** (ldconfig runs at boot via rc, which has never happened), and FreeBSD's rtld does **not** search `/usr/local/lib` without the hints file. The image's X libraries are present on disk but invisible to the loader until first boot — chroot or not. Fix: wrap both chrooted xkbcomp invocations with `/usr/bin/env LD_LIBRARY_PATH=/usr/local/lib`. Chosen over running `chroot ldconfig` because it leaves zero residue in the image (no generated hints file to ship). TESTING.md's post-build check gets the identical wrap. Premise check before merge (pool still mounted on valhala): `ls tmp/cache/mnt/usr/local/lib/libxkbfile* tmp/cache/mnt/var/run/ld-elf.so.hints` — expected: library present, hints file absent. If the library is MISSING instead, this is a pkg dependency gap, not a loader-path issue, and this PR alone won't fix it. Gates: `./scripts/check-format.sh` green, `sh -n build.sh` clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(build): set LD_LIBRARY_PATH for chrooted xkbcomp — fresh image has no ld-elf.so.hints
All checks were successful
format-check / prettier (pull_request) Successful in 26s
8a464b3251
The chrooted XKB test compile (#275) still failed with the same loader
error, now surfaced honestly by the log capture:

    xkbcomp: ld-elf.so.1: Shared object "libxkbfile.so.1" not found

Cause: a freshly assembled image has no /var/run/ld-elf.so.hints —
ldconfig only runs at boot via rc — and FreeBSD's rtld does NOT search
/usr/local/lib without the hints file. The image's X libraries are
present but invisible to the loader until first boot, even inside the
chroot.

Wrap both chrooted xkbcomp invocations with
/usr/bin/env LD_LIBRARY_PATH=/usr/local/lib (zero residue in the
image, unlike generating hints). Same wrap added to TESTING.md's
post-build check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
clawdie deleted branch fix/xkb-chroot-ldpath 2026-07-19 13:38:10 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
clawdie/clawdie-iso!277
No description provided.