https://kotlinlang.org logo
Title
n

napperley

03/07/2023, 2:43 AM
An issue has been encountered with generating a static library file using the K/N compiler with the unofficial rp2040 target. In the original Kotlin code base it is hard coded to use JetBrains servers to download dependencies for each K/N target like the target tool chain for instance, which is very bad design (tight coupling). Is there a way to work around this so that local dependencies (via absolute paths) are used instead? Below is the error:
~/repos/kotlin/kotlin-native/dist/bin/kotlinc-native -p static -target rp2040 src
Downloading native dependencies (LLVM, sysroot etc). This is a one-time action performed only on the first run of the compiler.
error: compilation failed: Server returned HTTP response code: 404 for URL: <https://download.jetbrains.com/kotlin/native/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.gz>

 * Source files: kotlinLib.kt
 * Compiler version info: Konan: 1.6.0-dev / Kotlin: 1.8.255
 * Output kind: STATIC

exception: org.jetbrains.kotlin.konan.util.DependencyDownloader$HTTPResponseException: Server returned HTTP response code: 404 for URL: <https://download.jetbrains.com/kotlin/native/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.gz>
Is there documentation available that covers how to use konan.properties to customise a Kotlin target?
Attached is a customised version of konan.properties:
n

natario1

03/07/2023, 8:47 AM
I don’t know if it solves your problem, but you can use the compiler option
-Xoverride-konan-properties=key1=value1;key2=value2;…