fix release pipeline: vendored cava source, fftw in CI, runner arch, smoke test

- Vendor cava/cavacore.c + header (MIT, from karlstav/cava) — the FFI build
  referenced cava/cavacore.c which was never committed, so every CI runner
  failed at scripts/build-cavacore.sh and no release was possible.
- build-cavacore.sh: discover libfftw3.a across Homebrew and Debian/Ubuntu
  multiarch paths (FFTW_PREFIX override preserved).
- release.yml: install fftw before building cavacore; run the boot smoke test
  from a bunfig-free dir (the embedded runtime reads the CWD bunfig.toml and
  this repo's preload entry breaks it — 'preload not found'); use
  macos-15-intel for darwin-x64 (macos-latest is arm64).
- Makefile/build.ts: drop the no-op BUN_CONFIG=bunfig.standalone.toml compile
  dance (Bun never honored it; compile output is config-independent); delete
  bunfig.standalone.toml.
This commit is contained in:
2026-08-07 14:27:35 -04:00
parent 25fe7f6ac9
commit c9e3aa92ec
8 changed files with 828 additions and 45 deletions

View File

@@ -19,36 +19,58 @@ mkdir -p "$OUT_DIR"
OS="$(uname -s)"
ARCH="$(uname -m)"
# Resolve fftw3 paths
# Resolve fftw3 paths. The static archive lives in different places per
# platform: Homebrew (/opt/homebrew on arm64, /usr/local on Intel) and, on
# Debian/Ubuntu, the multiarch dir /usr/lib/<triplet> (e.g.
# x86_64-linux-gnu, aarch64-linux-gnu).
if [ "$OS" = "Darwin" ]; then
if [ "$ARCH" = "arm64" ]; then
FFTW_PREFIX="${FFTW_PREFIX:-/opt/homebrew}"
else
FFTW_PREFIX="${FFTW_PREFIX:-/usr/local}"
fi
LIB_EXT="dylib"
SHARED_FLAG="-dynamiclib"
INSTALL_NAME="-install_name @rpath/libcavacore.dylib"
LIB_EXT="dylib"
SHARED_FLAG="-dynamiclib"
INSTALL_NAME="-install_name @rpath/libcavacore.dylib"
if [ "$ARCH" = "arm64" ]; then
FFTW_HINTS="/opt/homebrew /usr/local"
else
FFTW_HINTS="/usr/local /opt/homebrew"
fi
else
FFTW_PREFIX="${FFTW_PREFIX:-/usr}"
LIB_EXT="so"
SHARED_FLAG="-shared"
INSTALL_NAME=""
LIB_EXT="so"
SHARED_FLAG="-shared"
INSTALL_NAME=""
FFTW_HINTS="/usr /usr/local"
fi
FFTW_PREFIX="${FFTW_PREFIX:-}"
FFTW_STATIC=""
if [ -n "$FFTW_PREFIX" ]; then
FFTW_STATIC="$FFTW_PREFIX/lib/libfftw3.a"
else
for hint in $FFTW_HINTS; do
for cand in "$hint/lib/libfftw3.a" "$hint/lib/${ARCH}-linux-gnu/libfftw3.a"; do
if [ -f "$cand" ]; then
FFTW_STATIC="$cand"
FFTW_PREFIX="$hint"
break 2
fi
done
done
fi
if [ -z "$FFTW_STATIC" ] || [ ! -f "$FFTW_STATIC" ]; then
echo "Error: libfftw3.a not found (searched: ${FFTW_HINTS})"
echo "Install fftw3: brew install fftw (macOS) or apt install libfftw3-dev (Linux)"
echo "or point FFTW_PREFIX at a prefix containing lib/libfftw3.a."
exit 1
fi
FFTW_INCLUDE="$FFTW_PREFIX/include"
FFTW_STATIC="$FFTW_PREFIX/lib/libfftw3.a"
if [ ! -f "$FFTW_STATIC" ]; then
echo "Error: libfftw3.a not found at $FFTW_STATIC"
echo "Install fftw3: brew install fftw (macOS) or apt install libfftw3-dev (Linux)"
exit 1
if [ ! -d "$FFTW_INCLUDE" ]; then
FFTW_INCLUDE="$FFTW_PREFIX/include/$(basename "$(dirname "$FFTW_STATIC")")"
fi
if [ ! -f "$SRC" ]; then
echo "Error: cavacore.c not found at $SRC"
echo "Ensure the cava submodule is initialized: git submodule update --init"
exit 1
echo "Error: cavacore.c not found at $SRC"
echo "The cava source is vendored under cava/ (from github.com/karlstav/cava, MIT)."
exit 1
fi
OUT="$OUT_DIR/libcavacore.$LIB_EXT"
@@ -59,21 +81,21 @@ echo " FFTW3: $FFTW_STATIC"
echo " Output: $OUT"
cc -O2 \
$SHARED_FLAG \
$INSTALL_NAME \
-fPIC \
-I"$FFTW_INCLUDE" \
-I"$ROOT/cava" \
-o "$OUT" \
"$SRC" \
"$FFTW_STATIC" \
-lm
$SHARED_FLAG \
$INSTALL_NAME \
-fPIC \
-I"$FFTW_INCLUDE" \
-I"$ROOT/cava" \
-o "$OUT" \
"$SRC" \
"$FFTW_STATIC" \
-lm
echo "Built: $OUT"
# Verify exported symbols
if [ "$OS" = "Darwin" ]; then
echo ""
echo "Exported symbols:"
nm -gU "$OUT" | grep "cava_"
echo ""
echo "Exported symbols:"
nm -gU "$OUT" | grep "cava_"
fi