ref:ed9b74addbf43497431902b7a9b22ff83f84381e

build: rebuild all 5 platform natives with correct JNI class path

All native libraries now reference io/fangorn/huorn/nativelib. Previously only macOS aarch64 was rebuilt; the other 4 had the old alacrittymc class path and would crash on load. Fixed build_natives.sh to use rustup toolchain (Homebrew Rust lacks cross-compilation sysroots). Added JNI class path verification step. Platforms: macOS aarch64/x86_64, Linux aarch64/x86_64, Windows x86_64. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SHA: ed9b74addbf43497431902b7a9b22ff83f84381e
Author: Cole Christensen <cole.christensen@macmillan.com>
Date: 2026-03-21 02:40
Parents: 89ec6a5
6 files changed +21 -1
Type
build_natives.sh +21 −1
@@ -2,13 +2,22 @@
set -euo pipefail
# Build native libraries for all supported platforms.
# Requires: cargo, cross (cargo install cross)
# Requires: cross (cargo install cross) for Linux targets.
# macOS targets build natively, Linux targets use cross (Docker).
# Windows is a pre-built artifact (no cross-compilation in this script).
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
RUST_DIR="$SCRIPT_DIR/rust"
NATIVES_DIR="$SCRIPT_DIR/common/src/main/resources/natives"
cd "$RUST_DIR"
# Prefer rustup toolchain over Homebrew for cross-compilation support.
# Homebrew's Rust doesn't ship cross-compilation sysroots.
RUSTUP_TOOLCHAIN="$HOME/.rustup/toolchains/stable-aarch64-apple-darwin/bin"
if [ -x "$RUSTUP_TOOLCHAIN/cargo" ]; then
export PATH="$RUSTUP_TOOLCHAIN:$PATH"
echo "Using rustup cargo: $(which cargo)"
fi
echo "=== Building native libraries ==="
@@ -48,3 +57,14 @@
echo ""
echo "=== Results ==="
find "$NATIVES_DIR" -type f -exec ls -lh {} \;
echo ""
echo "=== JNI class path verification ==="
for dir in "$NATIVES_DIR"/*/; do
platform=$(basename "$dir")
file=$(ls "$dir" 2>/dev/null | head -1)
if [ -n "$file" ]; then
match=$(strings "$dir$file" 2>/dev/null | grep -o "io/fangorn/[a-z]*/nativelib" | head -1)
echo " $platform: $match"
fi
done