Summary
Building from origin/develop (HEAD 52ff395), compileCommonMainKotlinMetadata and compileKotlinJs for :llm-api, :llm-core, and :llm-performance fail with fundamental stdlib references unresolved in commonMain — Unit, String, Int, Long, AutoCloseable, JvmOverloads, JvmField, emptyList, listOf, firstOrNull, etc.
compileKotlinJvm works fine. The metadata + JS targets behave as if the Kotlin commonMain stdlib is not on their compile classpath at all.
Effect: publishKotlinMultiplatformPublicationToMavenLocal (and Maven Central) cannot complete, so the unsuffixed root multiplatform artifacts (skainet-transformers-api, skainet-transformers-core, skainet-transformers-inference-bert) cannot be produced. Only *-jvm per-target artifacts get published. Downstream Gradle consumers depending on skainet-transformers-api:0.23.0 (no suffix) cannot resolve.
Reproducer
git checkout develop
./gradlew :llm-api:compileCommonMainKotlinMetadata --no-daemon
Output (truncated):
e: …/llm-api/src/commonMain/kotlin/sk/ainet/llm/api/ChatModel.kt:17:30 Unresolved reference 'AutoCloseable'.
e: …/llm-api/src/commonMain/kotlin/sk/ainet/llm/api/ChatOptions.kt:3:15 Unresolved reference 'jvm'.
e: …/llm-api/src/commonMain/kotlin/sk/ainet/llm/api/ChatOptions.kt:13:32 Unresolved reference 'JvmOverloads'.
e: …/llm-api/src/commonMain/kotlin/sk/ainet/llm/api/ChatOptions.kt:14:23 Unresolved reference 'String'.
e: …/llm-api/src/commonMain/kotlin/sk/ainet/llm/api/ChatOptions.kt:16:22 Unresolved reference 'Int'.
e: …/llm-api/src/commonMain/kotlin/sk/ainet/llm/api/ChatOptions.kt:19:31 Unresolved reference 'List'.
… (~50 similar lines across all .kt files in commonMain)
Same symptom in :llm-core and :llm-performance.
Likely cause
llm-api/build.gradle.kts:53, llm-core/build.gradle.kts:46, and llm-performance/build.gradle.kts:55 all use:
commonMain.dependencies {
api(kotlin("stdlib-common"))
...
}
In Kotlin 2.x (this repo pins kotlin = "2.3.21" in libs.versions.toml), kotlin-stdlib-common was unified into kotlin-stdlib. The kotlin("stdlib-common") artifact now resolves to a stub or empty classpath, leaving commonMain without its stdlib. The kotlin-multiplatform Gradle plugin would normally add kotlin-stdlib to commonMain automatically — except the explicit api(kotlin("stdlib-common")) overrides/replaces that.
(Patching the three call sites to api(kotlin("stdlib")) did not fix the metadata compile in my local test, so there may be a second issue with how the metadata classpath is constructed — but the deprecated stdlib-common is the obvious starting point.)
Suggested fix
- Replace
api(kotlin("stdlib-common")) with api(kotlin("stdlib")) in the three modules above. Or remove the explicit dependency entirely — the kotlin-multiplatform plugin auto-adds the stdlib.
- Add a CI job that runs
./gradlew publishToMavenLocal (or at minimum compileCommonMainKotlinMetadata for every multiplatform module) so this kind of regression catches before release.
Workaround for downstream
Publish only JVM publications and bypass the multiplatform metadata module:
./gradlew \
:llm-bom:publishToMavenLocal \
:llm-api:publishJvmPublicationToMavenLocal \
:llm-core:publishJvmPublicationToMavenLocal \
:llm-agent:publishJvmPublicationToMavenLocal \
:llm-providers:publishMavenPublicationToMavenLocal \
:llm-inference:bert:publishJvmPublicationToMavenLocal \
-PVERSION_NAME=0.23.0 -PsignAllPublications=false
# strip stale Gradle metadata so consumers fall back to POMs
find ~/.m2/repository/sk/ainet/transformers -name "*-0.23.0.module" -delete
Consumer then depends on skainet-transformers-api-jvm etc. directly. Verified working end-to-end in michalharakal/SKaiNET-leaf-cli (built shadow JAR, CLI runs).
Why this matters
A real Maven Central release of 0.23.0 cannot be cut while this is broken. The unsuffixed root multiplatform artifacts are what consumers reference (e.g., implementation("sk.ainet.transformers:skainet-transformers-api:0.23.0")); without them, every downstream needs the workaround above.
Related
Summary
Building from
origin/develop(HEAD52ff395),compileCommonMainKotlinMetadataandcompileKotlinJsfor:llm-api,:llm-core, and:llm-performancefail with fundamental stdlib references unresolved incommonMain—Unit,String,Int,Long,AutoCloseable,JvmOverloads,JvmField,emptyList,listOf,firstOrNull, etc.compileKotlinJvmworks fine. The metadata + JS targets behave as if the Kotlin commonMain stdlib is not on their compile classpath at all.Effect:
publishKotlinMultiplatformPublicationToMavenLocal(and Maven Central) cannot complete, so the unsuffixed root multiplatform artifacts (skainet-transformers-api,skainet-transformers-core,skainet-transformers-inference-bert) cannot be produced. Only*-jvmper-target artifacts get published. Downstream Gradle consumers depending onskainet-transformers-api:0.23.0(no suffix) cannot resolve.Reproducer
Output (truncated):
Same symptom in
:llm-coreand:llm-performance.Likely cause
llm-api/build.gradle.kts:53,llm-core/build.gradle.kts:46, andllm-performance/build.gradle.kts:55all use:commonMain.dependencies { api(kotlin("stdlib-common")) ... }In Kotlin 2.x (this repo pins
kotlin = "2.3.21"inlibs.versions.toml),kotlin-stdlib-commonwas unified intokotlin-stdlib. Thekotlin("stdlib-common")artifact now resolves to a stub or empty classpath, leaving commonMain without its stdlib. Thekotlin-multiplatformGradle plugin would normally addkotlin-stdlibto commonMain automatically — except the explicitapi(kotlin("stdlib-common"))overrides/replaces that.(Patching the three call sites to
api(kotlin("stdlib"))did not fix the metadata compile in my local test, so there may be a second issue with how the metadata classpath is constructed — but the deprecatedstdlib-commonis the obvious starting point.)Suggested fix
api(kotlin("stdlib-common"))withapi(kotlin("stdlib"))in the three modules above. Or remove the explicit dependency entirely — the kotlin-multiplatform plugin auto-adds the stdlib../gradlew publishToMavenLocal(or at minimumcompileCommonMainKotlinMetadatafor every multiplatform module) so this kind of regression catches before release.Workaround for downstream
Publish only JVM publications and bypass the multiplatform metadata module:
Consumer then depends on
skainet-transformers-api-jvmetc. directly. Verified working end-to-end inmichalharakal/SKaiNET-leaf-cli(built shadow JAR, CLI runs).Why this matters
A real Maven Central release of
0.23.0cannot be cut while this is broken. The unsuffixed root multiplatform artifacts are what consumers reference (e.g.,implementation("sk.ainet.transformers:skainet-transformers-api:0.23.0")); without them, every downstream needs the workaround above.Related
sk.ainet:skainet-bom:0.21.0#97 (the fix on develop, which importssk.ainet:skainet-bom:0.23.0, is blocked from a public release until this metadata compile is fixed).