From aff35ce149156998d55ee0a5a392e725d500d8db Mon Sep 17 00:00:00 2001 From: Michal Harakal Date: Mon, 20 Jul 2026 12:26:01 +0200 Subject: [PATCH] io-safetensors: add androidNative targets; drop unused compile-core/-dag deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit skainet-io-safetensors was jvm/linux-only, blocking on-device (androidNative) SafeTensors weight loading. Two independent facts make it a clean add: 1. The commonMain deps on skainet-compile-core and skainet-compile-dag are unused (no sk.ainet.compile.* reference anywhere in the module) — they were the only deps lacking androidNative. Removed. 2. io-safetensors has no posix in its own nativeMain: createRandomAccessSource and readTextFile are null stubs and currentTimeMillis uses TimeSource.Monotonic, so there is no bit-width metadata issue (unlike io-core, whose posix pread needed the native64Main split in #842). File-backed reads route through io-core's RandomAccessSource. After removing the dead deps, commonMain depends only on lang-core + io-core (both androidNative) + kotlinx, so androidNativeArm32/Arm64 just needed declaring. Verified: compileNativeMainKotlinMetadata, compileKotlinAndroidNativeArm32/Arm64, compileKotlinJvm, and jvmTest all green. Co-Authored-By: Claude Opus 4.8 (1M context) --- skainet-io/skainet-io-safetensors/build.gradle.kts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/skainet-io/skainet-io-safetensors/build.gradle.kts b/skainet-io/skainet-io-safetensors/build.gradle.kts index a1fc3c69..6b20fbf6 100644 --- a/skainet-io/skainet-io-safetensors/build.gradle.kts +++ b/skainet-io/skainet-io-safetensors/build.gradle.kts @@ -32,6 +32,12 @@ kotlin { macosArm64() linuxX64() linuxArm64() + // androidNative (edge NPU / phone). io-safetensors has no posix in its own nativeMain — + // createRandomAccessSource / readTextFile are stubs and currentTimeMillis uses a monotonic + // TimeSource — so there is no bit-width metadata issue here (unlike io-core, whose posix pread + // needed the native64Main split). File-backed reads route through io-core's RandomAccessSource. + androidNativeArm32() + androidNativeArm64() js { browser() @@ -54,8 +60,6 @@ kotlin { implementation(libs.kotlinx.coroutines) implementation(project(":skainet-lang:skainet-lang-core")) implementation(project(":skainet-io:skainet-io-core")) - implementation(project(":skainet-compile:skainet-compile-core")) - implementation(project(":skainet-compile:skainet-compile-dag")) } } val commonTest by getting {