mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-07-30 19:46:17 +00:00
fix: revert macosArm64 target (blocked by negentropy-kmp), add K/N toolchain to session hook
macosArm64 target cannot be enabled until negentropy-kmp publishes a macosArm64 artifact — commented out with explanation. Reverted run_all.sh back to Linux-only for K/Native benchmark. Added Kotlin/Native toolchain dependencies (GCC sysroot, LLDB, LLVM, libffi) to session-start.sh so K/N compilation works in Claude Code remote environments where Gradle's own downloader fails through the proxy. https://claude.ai/code/session_01WSNE6QKiYM2ZutQD2UihCW
This commit is contained in:
@@ -174,6 +174,43 @@ if [ -n "${CLAUDE_ENV_FILE:-}" ]; then
|
||||
echo "export PATH=\$PATH:$ANDROID_SDK_DIR/platform-tools" >> "$CLAUDE_ENV_FILE"
|
||||
fi
|
||||
|
||||
# --- Kotlin/Native: pre-install native dependencies (GCC sysroot, LLDB) ---
|
||||
# The K/N compiler downloads these on first use, but that fails through the proxy.
|
||||
# Pre-download them so K/N benchmarks and linuxX64 compilation work out of the box.
|
||||
KONAN_DIR="/root/.konan"
|
||||
KONAN_DEPS_URL="https://download.jetbrains.com/kotlin/native"
|
||||
KONAN_DEPS_DIR="$KONAN_DIR/dependencies"
|
||||
|
||||
install_konan_dep() {
|
||||
local dep_name="$1"
|
||||
local url="$2" # full download URL
|
||||
# Already extracted?
|
||||
if [ -d "$KONAN_DEPS_DIR/$dep_name" ]; then
|
||||
return 0
|
||||
fi
|
||||
local archive="$dep_name.tar.gz"
|
||||
local cache_dir="$KONAN_DEPS_DIR/cache"
|
||||
mkdir -p "$cache_dir"
|
||||
if [ ! -f "$cache_dir/$archive" ]; then
|
||||
echo "Downloading K/N dependency $dep_name..."
|
||||
curl -fsSL "$url" -o "$cache_dir/$archive" || {
|
||||
echo "Failed to download $dep_name" >&2; return 1
|
||||
}
|
||||
fi
|
||||
echo "Extracting $dep_name..."
|
||||
tar -xzf "$cache_dir/$archive" -C "$KONAN_DEPS_DIR"
|
||||
}
|
||||
|
||||
# Dependencies for linuxX64 target (from konan.properties for Kotlin 2.3.20)
|
||||
install_konan_dep "x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2" \
|
||||
"$KONAN_DEPS_URL/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2.tar.gz"
|
||||
install_konan_dep "lldb-4-linux" \
|
||||
"$KONAN_DEPS_URL/lldb-4-linux.tar.gz"
|
||||
install_konan_dep "llvm-19-x86_64-linux-essentials-109" \
|
||||
"$KONAN_DEPS_URL/resources/llvm/19-x86_64-linux/llvm-19-x86_64-linux-essentials-109.tar.gz"
|
||||
install_konan_dep "libffi-3.2.1-2-linux-x86-64" \
|
||||
"$KONAN_DEPS_URL/libffi-3.2.1-2-linux-x86-64.tar.gz"
|
||||
|
||||
cd "$CLAUDE_PROJECT_DIR"
|
||||
./gradlew --version > /dev/null 2>&1
|
||||
|
||||
|
||||
@@ -82,26 +82,25 @@ fi
|
||||
echo ""
|
||||
|
||||
# ============================================================================
|
||||
# 2. Kotlin/Native benchmark (Linux and macOS)
|
||||
# 2. Kotlin/Native benchmark
|
||||
# ============================================================================
|
||||
echo "=== Running Kotlin/Native benchmark ==="
|
||||
case "$OS_NAME" in
|
||||
Linux)
|
||||
KN_TARGET="linuxX64Test"
|
||||
;;
|
||||
Darwin)
|
||||
KN_TARGET="macosArm64Test"
|
||||
;;
|
||||
esac
|
||||
# macosArm64 target is blocked until negentropy-kmp publishes a macosArm64
|
||||
# artifact. Once unblocked, add: Darwin) KN_TARGET="macosArm64Test" ;;
|
||||
if [ "$OS_NAME" = "Linux" ]; then
|
||||
echo "=== Running Kotlin/Native benchmark ==="
|
||||
KN_TARGET="linuxX64Test"
|
||||
|
||||
"$ROOT/gradlew" -p "$ROOT" ":quartz:$KN_TARGET" --tests "*.Secp256k1NativeBenchmark" \
|
||||
2>/dev/null || true
|
||||
"$ROOT/gradlew" -p "$ROOT" ":quartz:$KN_TARGET" --tests "*.Secp256k1NativeBenchmark" \
|
||||
2>/dev/null || true
|
||||
|
||||
KN_XML="$ROOT/quartz/build/test-results/$KN_TARGET/TEST-${KN_TARGET}.com.vitorpamplona.quartz.utils.secp256k1.Secp256k1NativeBenchmark.xml"
|
||||
if [ -f "$KN_XML" ]; then
|
||||
sed -n '/<!\[CDATA\[/,/\]\]>/p' "$KN_XML" | grep -v 'CDATA\|]]>'
|
||||
KN_XML="$ROOT/quartz/build/test-results/$KN_TARGET/TEST-${KN_TARGET}.com.vitorpamplona.quartz.utils.secp256k1.Secp256k1NativeBenchmark.xml"
|
||||
if [ -f "$KN_XML" ]; then
|
||||
sed -n '/<!\[CDATA\[/,/\]\]>/p' "$KN_XML" | grep -v 'CDATA\|]]>'
|
||||
else
|
||||
echo "K/Native benchmark XML not found."
|
||||
fi
|
||||
else
|
||||
echo "K/Native benchmark XML not found."
|
||||
echo "=== Skipping Kotlin/Native benchmark (only linuxX64 target available) ==="
|
||||
fi
|
||||
echo ""
|
||||
|
||||
|
||||
+3
-18
@@ -87,7 +87,7 @@ kotlin {
|
||||
|
||||
linuxX64()
|
||||
|
||||
macosArm64()
|
||||
// macosArm64() — blocked until negentropy-kmp publishes a macosArm64 artifact
|
||||
|
||||
// This makes sure that the resource file directory is visible for iOS tests.
|
||||
val rootDir = "${rootProject.rootDir.path}/quartz/src/commonTest/resources"
|
||||
@@ -299,23 +299,8 @@ kotlin {
|
||||
dependsOn(iosTest.get())
|
||||
}
|
||||
|
||||
val macosMain =
|
||||
create("macosMain") {
|
||||
dependsOn(appleMain)
|
||||
}
|
||||
|
||||
val macosTest =
|
||||
create("macosTest") {
|
||||
dependsOn(appleTest)
|
||||
}
|
||||
|
||||
val macosArm64Main by getting {
|
||||
dependsOn(macosMain)
|
||||
}
|
||||
|
||||
val macosArm64Test by getting {
|
||||
dependsOn(macosTest)
|
||||
}
|
||||
// macosMain/macosTest source sets exist but are not wired until
|
||||
// negentropy-kmp publishes a macosArm64 artifact.
|
||||
|
||||
val linuxMain =
|
||||
create("linuxMain") {
|
||||
|
||||
Reference in New Issue
Block a user