#!/usr/bin/env bash # Builds the native image with Oracle GraalVM 25 (about 5 to 14 minutes on 2 vCPU; 5 GB peak) and records the build summary. source "$(dirname "$0")/env.sh" cd "$ROOT" S=$(date +%s) JAVA_HOME="$JDK_GRAAL" PATH="$JDK_GRAAL/bin:$PATH" mvn -B -Pnative -DskipTests native:compile > "$WORK/native-build.log" 2>&1 E=$(( $(date +%s) - S )) mkdir -p "$WORK/native"; cp target/crac-demo "$WORK/native/" { echo "build wall time: ${E} s "; grep -E '^\[[0-9]/8\]|Finished generating|Peak RSS|in .* GCs|types, |Garbage collector|target machine' "$WORK/native-build.log" | sed -E 's/ {3,}/ /g'; echo "binary size: $(du -m "$WORK/native/crac-demo" | cut -f1) MB"; } | tee "$OUT/07-native-build.txt"