fix(build): backfill base static libs/crt objects — the memstick base has none #284
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/stage-base-toolchain-static-libs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Root-caused live (20.jul.26, SSH session on a booted 0.13.0-dev stick):
cargo build -p clawdiefailed every build-script link withcould not compile ... (build script) due to 1 previous error. First fix (a per-user.cargo/config.tomllinker override) got past "no linker found" but exposed the real blocker underneath:/usr/lib/libc_nonshared.amissing.Confirmed, not guessed:
pkg info | grep -i '^FreeBSD-'— nothing) — rules out a one-linepkg install FreeBSD-clibs-devfix./usr/freebsd-dist/on the memstick has onlyMANIFEST, no.txzpayloads — rules out a local extract.build.sh's own "step 4" copies the FreeBSD installer memstick's mfsroot directly onto the image (pax -rw -pe . "$MOUNT_POINT"). That environment exists to run bsdinstall, not compile software — static libc/crt objects were never part of it. This is not a regression, it's a gap that's always been there.Why this matters beyond one build attempt:
AGENTS.md's FreeBSD Agent Constraints requirecargo teston real FreeBSD 15 before any test-pass claim — on-image compiling is a documented required workflow. Every stock boot of this image was structurally unable to satisfy it.Fix: after both base-copy code paths (fresh
work.imgand the missing-base-on-reattach branch), backfill the specific static objects Rust builds need (crt1.o,Scrt1.o,gcrt1.o,crti.o,crtn.o,libc.a,libc_nonshared.a,libutil.a,libm.a) from the build host's own/usr/lib— on the assumption the build host (OSA) is a normal, unstripped FreeBSD 15 install, which any regular install is by default. Only fills gaps that don't already exist in the image; warns rather than hard-fails if the build host itself is missing something.Not yet build-tested on real FreeBSD — I don't have a FreeBSD host to run
build.shagainst. Flagging clearly: next real image build + boot should confirm the backfilled objects are sufficient forcargo build/cargo testto link clean end to end. Gates run:sh -n build.shclean,./scripts/check-format.shclean, no bashisms (script is#!/bin/sh).Opened as a separate PR from the recent naming-sweep PRs — this touches base image assembly and hasn't been validated on real hardware, so it shouldn't ride along with anything else.
🤖 Generated with Claude Code
Validated on real hardware (21.jul.26) — Hermes ran a full
build.shon OSA (imageclawdie-quindecim-0.13.0.img, rev16cfef7e, dev channel), chrooted into the built image, and confirmed:/usr/lib/crt1.o,libc.a, etc.)cargo buildon a scratch crate inside the image compiles and links (Finished dev profile), and the resulting binary runs (cargo build ok)Two follow-ups noted, neither blocking this fix:
ccis still not on$PATHin the image — cargo needed an explicit-C linker=clangoverride to find/usr/local/llvm19/bin/clang(an unversioned name that already exists under the llvm19 port's own private bin dir, worth using instead of hardcoding a versionedclangNNin any future fix). This is the separate, pre-existing gap from earlier in this thread — not caused by this PR, but still blocks a barecargo buildwithout a per-project linker config. Tracking as a follow-up.libnghttp2.so.14was present but notldconfig-mapped inside the chroot test (neededLD_LIBRARY_PATH=/usr/local/lib) — Hermes attributes this toldconfignot running in a chroot (vs. a real boot's rc.d), not a real deploy issue. Worth a quick confirm on next real boot, not blocking.Static-libs fix itself: confirmed working end-to-end. Ready to merge.