Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

docker-build: CL binary swaps into initramfs after C libs are copied

Moves CL build step between initramfs population (which copies all
shared libs via ldd of C binary) and cpio packing. The CL binary
replaces ac-native in the initramfs, getting all the C binary's libs
(libdrm, libasound, etc.) plus libzstd for SBCL's compressed core.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+27 -22
+27 -22
fedac/native/docker-build.sh
··· 54 54 [ -f "$BUILD/ac-native" ] || { err "Binary compilation failed"; tail -30 "$BUILD/.make.log"; exit 1; } 55 55 log " Binary: $(stat -c%s "$BUILD/ac-native") bytes" 56 56 57 - # ── Optional: Build Common Lisp variant ── 58 - if [ "${AC_BUILD_LISP:-0}" = "1" ]; then 59 - log "Step 1b: Building ac-native (Common Lisp)..." 60 - CL_DIR="$NATIVE/cl" 61 - # Build standalone binary via SBCL + Quicklisp 62 - sbcl --non-interactive \ 63 - --eval '(load "/opt/quicklisp/setup.lisp")' \ 64 - --eval '(require :asdf)' \ 65 - --eval "(push #P\"$CL_DIR/\" asdf:*central-registry*)" \ 66 - --eval '(asdf:load-system :ac-native)' \ 67 - --eval "(ac-native.build:build \"$BUILD/ac-native-cl\")" \ 68 - 2>&1 || { err "CL build failed"; exit 1; } 69 - if [ -f "$BUILD/ac-native-cl" ]; then 70 - log " CL Binary: $(stat -c%s "$BUILD/ac-native-cl") bytes" 71 - # Replace C binary with CL binary 72 - cp "$BUILD/ac-native" "$BUILD/ac-native-c" 73 - cp "$BUILD/ac-native-cl" "$BUILD/ac-native" 74 - log " Using Common Lisp binary" 75 - else 76 - err "CL binary not produced — falling back to C" 77 - fi 78 - fi 57 + # CL build happens after initramfs (step 2) — see below 79 58 80 59 # ══════════════════════════════════════════════ 81 60 # Step 2: Build initramfs from scratch ··· 279 258 TOTAL_FILES=$(find "$IROOT" -type f | wc -l) 280 259 log " Initramfs: $TOTAL_FILES files, $BROKEN_FINAL broken symlinks" 281 260 [ "$BROKEN_FINAL" -gt 0 ] && err " WARNING: broken symlinks remain!" 261 + 262 + # ── Optional: Swap in Common Lisp binary ── 263 + if [ "${AC_BUILD_LISP:-0}" = "1" ]; then 264 + log "Step 2b: Building ac-native (Common Lisp)..." 265 + CL_DIR="$NATIVE/cl" 266 + sbcl --non-interactive \ 267 + --eval '(load "/opt/quicklisp/setup.lisp")' \ 268 + --eval '(require :asdf)' \ 269 + --eval "(push #P\"$CL_DIR/\" asdf:*central-registry*)" \ 270 + --eval '(asdf:load-system :ac-native)' \ 271 + --eval "(ac-native.build:build \"$BUILD/ac-native-cl\")" \ 272 + 2>&1 || { err "CL build failed"; } 273 + if [ -f "$BUILD/ac-native-cl" ]; then 274 + log " CL Binary: $(stat -c%s "$BUILD/ac-native-cl") bytes" 275 + # Swap into initramfs (keep C version in build dir) 276 + cp "$IROOT/ac-native" "$BUILD/ac-native-c" 277 + cp "$BUILD/ac-native-cl" "$IROOT/ac-native" 278 + # Add libzstd (CL runtime needs it, C binary doesn't) 279 + for lib in /lib64/libzstd.so*; do 280 + [ -f "$lib" ] && cp -L "$lib" "$IROOT/lib64/" 2>/dev/null 281 + done 282 + log " Swapped CL binary into initramfs" 283 + else 284 + err "CL binary not produced — using C binary" 285 + fi 286 + fi 282 287 283 288 # ══════════════════════════════════════════════ 284 289 # Step 3: Pack initramfs (cpio + lz4)