https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
s

Stefan Oltmann

02/24/2023, 4:03 PM
I have defined:
Copy code
kotlin {
    mingwX64("native") {
        binaries {
            executable()
        }
    }
}
That results in
ModuleVersionNotFoundException: Could not find :kotlin-native-prebuilt-windows-aarch64:1.6.10.
I am currently using the ARM version of Windows 11, which has the ability to run x64 code. I would like to know how I can modify my Gradle configuration to prioritize the use of the x64 version instead of searching for the aarch64 version.
l

Landry Norris

02/24/2023, 4:13 PM
What is the output of gradlew --version (or bat equivalent if different)? On macos, this will tell you the arch gradle is seeing.
s

Stefan Oltmann

02/24/2023, 4:16 PM
Gradle is seeing windows-aarch64 , which is the correct system. I just want it to ignore that for mingwX64() and use something else. I'm not sure if this is possible.
e

ephemient

02/24/2023, 4:18 PM
I think it'll do that if you run a x86/x64 JVM, but that will have significant effects on the rest of your build time
s

Stefan Oltmann

02/24/2023, 4:19 PM
I assume that, too. That's why I'm asking if there is an option to configure just this one tasks to use something else
j

Joakim Forslund

02/24/2023, 4:26 PM
Afaik there currently is no other way than to run it through a x86/64 JVM
e

ephemient

02/24/2023, 4:39 PM
maybe you could download and unpack the Konan distribution manually, then use
./gradlew -Porg.jetbrains.kotlin.native.home=...
s

Stefan Oltmann

02/24/2023, 5:01 PM
Interesting... If I download the IDEA x86 version which runs
17.0.5+1-b653.25 amd64
Gradle is still trying to get non-existing
windows-aarch64
. In a bad case there is just a hardcoded
kotlin-native-prebuilt-windows-$arch
somehwere with no option to override.
I think there is nothing I can manually download. windows-aarch64 is not supported.
If I install Adoptium Temurin and configure in IDEA to use that for the project and for Gradle it works. Slow, but it works. If IDEA uses the bundled JRE (even the with amd64 version) it does not work. Would still be great if there was a way to use aarch64 JVM and just use Konan for x64
c

corneil

02/26/2023, 7:06 PM
The bottom line is that cross compilation for kotlin-native will be invaluable.
3 Views