From 6030d22aa9eb9bb68ea5b4aaade419bb9fbf46c6 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 13 Sep 2026 00:36:31 +0000 Subject: [PATCH] fix(commons): declare okio so the Apple targets compile after the Compose split test-quartz-ios failed on :commons:compileKotlinIosSimulatorArm64 with "Unresolved reference 'okio'" in service/image/DeferredDeleteFileSystem.kt. The file always used okio, but commons only ever got it transitively: through Coil on every target, and through OkHttp on JVM. Moving Coil to :commonsUI removed the only Apple-side provider, and the JVM builds kept passing, so nothing caught it locally. Declare okio (3.18.1, the version already resolved everywhere; Apache-2.0 per its POM) in commons commonMain. Reproduced and re-verified on Linux with :commons:compileCommonMainKotlinMetadata, which resolves commonMain against the shared-dependency set exactly like the iOS compile. That task, for all three KMP library modules, is now part of the lint job so this class of gap fails fast on Linux. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01N56KzPSYiN5edMRamvKEgD --- .github/workflows/build.yml | 11 ++++++++++- commons/build.gradle.kts | 7 +++++++ gradle/libs.versions.toml | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 44582700a4..7665ea2bb6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,16 @@ jobs: cache-read-only: ${{ github.ref != 'refs/heads/main' }} - name: Linter (gradle) - run: ./gradlew spotlessCheck :quartz:verifyKmpPurity :commons:verifyKmpPurity :commonsUI:verifyKmpPurity + # The three metadata compiles resolve commonMain against only the + # deps every target shares, which is the Apple classpath — a + # dependency that reaches JVM transitively (okio via OkHttp) but is + # missing for iOS fails here, on Linux, instead of in test-quartz-ios. + run: | + ./gradlew spotlessCheck \ + :quartz:verifyKmpPurity :commons:verifyKmpPurity :commonsUI:verifyKmpPurity \ + :quartz:compileCommonMainKotlinMetadata \ + :commons:compileCommonMainKotlinMetadata \ + :commonsUI:compileCommonMainKotlinMetadata build-desktop: needs: lint diff --git a/commons/build.gradle.kts b/commons/build.gradle.kts index 7e8b0dda6c..b952fe67af 100644 --- a/commons/build.gradle.kts +++ b/commons/build.gradle.kts @@ -83,6 +83,13 @@ kotlin { // LruCache (KMP-ready) implementation(libs.androidx.collection) + // okio (KMP, Apache-2.0) for service/image/DeferredDeleteFileSystem, + // the ForwardingFileSystem the apps wrap Coil's disk cache in. It + // used to arrive transitively through Coil; with Coil in + // :commonsUI the Apple targets lost it (JVM still saw it via + // OkHttp), so declare the dependency the file actually has. + implementation(libs.okio) + // Immutable collections api(libs.kotlinx.collections.immutable) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 266e447dd3..bde3c56b33 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -59,6 +59,7 @@ lightcompressor-enhanced = "2.2.1" jlatexmath = "1.5" markdown = "4d3b3dd173" highlights = "1.1.0" +okio = "3.18.1" # JetBrains material3 must track Compose Multiplatform's foundation: CMP 1.12.0 changed # the CustomStyle.applyStyle signature, so the stable 1.9.0 (and the 1.11.0-alpha07 that # kodein-emoji pulls in) crash at runtime with AbstractMethodError in OutlinedTextField. @@ -221,6 +222,7 @@ markdown-commonmark = { group = "com.github.vitorpamplona.compose-richtext", nam markdown-ui = { group = "com.github.vitorpamplona.compose-richtext", name = "richtext-ui", version.ref = "markdown" } markdown-ui-material3 = { group = "com.github.vitorpamplona.compose-richtext", name = "richtext-ui-material3", version.ref = "markdown" } highlights = { group = "dev.snipme", name = "highlights", version.ref = "highlights" } +okio = { group = "com.squareup.okio", name = "okio", version.ref = "okio" } mockk = { group = "io.mockk", name = "mockk", version.ref = "mockk" } mockk-android = { group = "io.mockk", name = "mockk-android", version.ref = "mockk" } kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinx-coroutines-test"}