Support native on mingwX64
hakanai opened this issue · comments
I was writing a multiplatform library and happened to be sitting on a Windows machine when I tried to build it, so the build failed because it couldn't resolve assertk.
> Could not resolve com.willowtreeapps.assertk:assertk:0.25.
Required by:
project :
> No matching variant of com.willowtreeapps.assertk:assertk:0.25 was found. The consumer was configured to find a usage of 'kotlin-api' of a library, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native', attribute 'org.jetbrains.kotlin.native.target' with value 'mingw_x64' but:
- Variant 'commonMainMetadataElements' capability com.willowtreeapps.assertk:assertk:0.25 declares a usage of 'kotlin-api' of a component:
- Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'
- Other compatible attributes:
- Doesn't say anything about its component category (required a library)
- Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
- Doesn't say anything about org.jetbrains.kotlin.native.target (required 'mingw_x64')
...and so on for all the other published artifacts...
I'm guessing that supporting it will bemore than just adding "mingwX64" to the list, because I tried doing this and it couldn't find opentest4k for the same reason. So getting it going appears to be a bit of a rabbit hole, and there is CI to sort out also.
Apparently you can cross-compile to windows now so setting up ci shouldn't be too bad
Interesting! I happened to notice testing stuff on Windows that it also cross-compiles to Linux, so it figures they'd support other combinations.
A quick check over at opentest4j says that a few tests fail on Windows due to line ending differences, so there might be something like that lurking here as well.
+1 for this. Using kotlin 1.7.10 we should be able to compile for all platforms on a single macros host. If it's a test-support library that's missing mingwX64 support then we could just skip tests for that platform (by skipping the definition of the mingwX64Test sourceSet).
Fixed by #439