I'm trying to write a library that can be used on ...
# multiplatform
k
I'm trying to write a library that can be used on the JVM and iOS. However my tests (written in Kotest) are failing the iOS linking step.
Copy code
> Task :my-library:linkDebugTestIosX64 FAILED
e: Could not find "io.kotest:kotest-assertions-api" in [ 
  /Users/kieran/Projects/my-library/kotlin, 
  /Users/kieran/.konan/klib, 
  /Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/common, 
  /Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/platform/ios_x64
]
FAILURE: Build failed with an exception.
Copy code
// arrowVersion = 1.0.1
commonMain {
    dependencies {
        api "io.arrow-kt:arrow-core:${rootProject.ext.arrowVersion}"
        api "io.arrow-kt:arrow-fx-coroutines:${rootProject.ext.arrowVersion}"
    }
}

// kotestVersion = "5.1.0"
commonTest {
    dependencies {
        implementation "io.kotest:kotest-framework-engine:${rootProject.ext.kotestVersion}"
        implementation "io.kotest:kotest-assertions-core:${rootProject.ext.kotestVersion}"
        implementation "io.kotest:kotest-property:${rootProject.ext.kotestVersion}"
        implementation "io.kotest.extensions:kotest-assertions-arrow:1.2.2"
    }
}
If I look on my disk the files are present (the
.a
files are present, I've reduced the amount of output)
Copy code
$ find ~/.konan/ -name '*assertions-api*'
/Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/cache/ios_x64-gSTATIC/kotest-assertions-api-iosx64

$ find ~/.konan/ -name '*arrow*'
/Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/cache/ios_x64-gSTATIC/kotest-assertions-arrow-iosx64
/Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/cache/ios_x64-gSTATIC/arrow-core-iosx64
So the main linking step can find Arrow, but the test linking can't find the
kotest-assertions-api
. Has anyone else had this sort of problem?
a
Hello, @kierans777! Could you please check this task’s output with
--info
? As far as I can see, the library name was sent to the compiler incorrectly for some reason.
k
@Artyom Degtyarev [JB] I ran 
./gradlew iosX64Test --info
 and I think it's an issue integrating 
kotest-assertions-arrow
(which all my tests rely on as I use Arrow in this library)
Copy code
Classpath = [
        /Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/konan/lib/kotlin-native.jar
        /Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/konan/lib/trove4j.jar
]
Arguments = [
        -p
        static_cache
        -target
        ios_x64
        -g
        -Xexternal-dependencies=/var/folders/90/rnmkftm10551d62mjt897mym0000gn/T/kotlin-native-external-dependencies4001252806988445666.deps
        -Xadd-cache=/Users/kieran/.gradle/caches/modules-2/files-2.1/io.kotest.extensions/kotest-assertions-arrow-iosx64/1.2.2/2da466c9780a787c5b7f8cd310cf37c82b36f754/kotest-assertions-arrow.klib
        -Xcache-directory=/Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/cache/ios_x64-gSTATIC/kotest-assertions-arrow-iosx64/1.2.2/7cbae098c9d28e7b9d2d5cc67e2abbde4474614cc1168b690793b82432bd28dc
        -Xcache-directory=/Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/cache/ios_x64-gSTATIC
]
Transformed arguments = [
        konanc
        -p
        static_cache
        -target
        ios_x64
        -g
        -Xexternal-dependencies=/var/folders/90/rnmkftm10551d62mjt897mym0000gn/T/kotlin-native-external-dependencies4001252806988445666.deps
        -Xadd-cache=/Users/kieran/.gradle/caches/modules-2/files-2.1/io.kotest.extensions/kotest-assertions-arrow-iosx64/1.2.2/2da466c9780a787c5b7f8cd310cf37c82b36f754/kotest-assertions-arrow.klib
        -Xcache-directory=/Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/cache/ios_x64-gSTATIC/kotest-assertions-arrow-iosx64/1.2.2/7cbae098c9d28e7b9d2d5cc67e2abbde4474614cc1168b690793b82432bd28dc
        -Xcache-directory=/Users/kieran/.konan/kotlin-native-prebuilt-macos-x86_64-1.6.0/klib/cache/ios_x64-gSTATIC
]
e: Could not find "io.kotest:kotest-assertions-api" in ...
@Artyom Degtyarev [JB] I've been working with the library authors https://kotlinlang.slack.com/archives/CT0G9SD7Z/p1644363006064619 however if you have any suggestions I'm sure it will be welcome https://github.com/kotest/kotest-extensions-arrow/