From 909633c991637b5e9398ca13ed40677f08ad1cb9 Mon Sep 17 00:00:00 2001 From: Michal Harakal Date: Wed, 29 Apr 2026 23:41:44 +0200 Subject: [PATCH] build(native-cpu): add publishing config + register in BOM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Layers the publishing setup that PR 1 of the native-FFM rollout deliberately deferred (#571) onto the now-shipped scaffolding + kernels. Lets downstream consumers pull the native provider through the same coordinate-driven path the rest of the SKaiNET libraries use, and lets a composite-build consumer (e.g. SKaiNET-transformers via includeBuild) substitute the published coordinates with a local project ref. Changes: - skainet-backends/skainet-backend-native-cpu/build.gradle.kts: add `alias(libs.plugins.vanniktech.mavenPublish)` to the plugins block. The vanniktech plugin auto-derives Maven coordinates from the root group (`sk.ainet.core`), version (`VERSION_NAME` — currently 0.22.0-SNAPSHOT), and the new gradle.properties below. - skainet-backends/skainet-backend-native-cpu/gradle.properties: NEW. POM_ARTIFACT_ID=skainet-backend-native-cpu and POM_NAME mirroring the convention every other publishable module uses. - skainet-bom/build.gradle.kts: add `api(project(":skainet-backends:skainet-backend-native-cpu"))` alongside the existing backend-api / backend-cpu constraints, so consumers depending on the BOM get a constrained version of the native module without adding a separate version pin. Verification: - ./gradlew :skainet-backends:skainet-backend-native-cpu:publishToMavenLocal -PRELEASE_SIGNING_ENABLED=false -PsignAllPublications=false publishes sk.ainet.core:skainet-backend-native-cpu-jvm:0.22.0-SNAPSHOT to ~/.m2 alongside the existing backend artifacts. - ./gradlew publishToMavenLocal (full repo) — green, no regressions in the existing modules' publish tasks. The native module's JAR carries the host-arch shared library at native/-/libskainet_kernels.{so|dylib|dll}, so a JAR published from this build host (linux-x86_64 here) only carries the linux-x86_64 .so. Multi-arch fat-JAR aggregation across the PR 4 cross-arch CI matrix runners is still deferred — consumers on other arches cleanly fall back to the priority-50 Panama provider when the native lib doesn't load. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../skainet-backend-native-cpu/build.gradle.kts | 1 + .../skainet-backend-native-cpu/gradle.properties | 2 ++ skainet-bom/build.gradle.kts | 6 ++++++ 3 files changed, 9 insertions(+) create mode 100644 skainet-backends/skainet-backend-native-cpu/gradle.properties diff --git a/skainet-backends/skainet-backend-native-cpu/build.gradle.kts b/skainet-backends/skainet-backend-native-cpu/build.gradle.kts index 064250ae..0dbc6747 100644 --- a/skainet-backends/skainet-backend-native-cpu/build.gradle.kts +++ b/skainet-backends/skainet-backend-native-cpu/build.gradle.kts @@ -1,5 +1,6 @@ plugins { alias(libs.plugins.kotlinMultiplatform) + alias(libs.plugins.vanniktech.mavenPublish) } kotlin { diff --git a/skainet-backends/skainet-backend-native-cpu/gradle.properties b/skainet-backends/skainet-backend-native-cpu/gradle.properties new file mode 100644 index 00000000..00fe7645 --- /dev/null +++ b/skainet-backends/skainet-backend-native-cpu/gradle.properties @@ -0,0 +1,2 @@ +POM_ARTIFACT_ID=skainet-backend-native-cpu +POM_NAME=skainet native (FFM) CPU kernel provider diff --git a/skainet-bom/build.gradle.kts b/skainet-bom/build.gradle.kts index 828b25e4..a066f364 100644 --- a/skainet-bom/build.gradle.kts +++ b/skainet-bom/build.gradle.kts @@ -18,6 +18,12 @@ dependencies { // Backend abstraction + CPU backend api(project(":skainet-backends:skainet-backend-api")) api(project(":skainet-backends:skainet-backend-cpu")) + // Native (FFM) priority-100 kernel provider — bundles a + // libskainet_kernels shared library and overrides the + // priority-50 Panama kernels for Q4_K and FP32 matmul on + // hosts where the native lib resolves. Cascades to Panama + // otherwise (missing arch, sandbox, kill-switch). + api(project(":skainet-backends:skainet-backend-native-cpu")) // IO modules api(project(":skainet-io:skainet-io-core"))