Anyone seen something like this before? ```w: skip...
# kotlin-native
d
Anyone seen something like this before?
Copy code
w: skipping D:\a\kgl\kgl\kgl-glfw\build\classes\kotlin\commonizer\cglfw\H3MydyJqF8c0JoJ3z3gndIlI7DE=\(linux_x64, macos_x64, mingw_x64)\com.kgl_kgl-glfw-cinterop-cglfw. The target doesn't match. Expected 'linux_x64', found [mingw_x64]
https://github.com/JetBrains/kotlin/blob/v1.6.21/kotlin-native/shared/src/library/[…]kotlin/org/jetbrains/kotlin/konan/library/SearchPathResolver.kt
s
Yes, this is not a good sign! Did this happen on 1.6.21 for you? How did you configure your cinterop?
d
It happened on 1.6.20
It only happens on Windows but it doesn't happen on Linux.
Upgraded to 1.6.21 and it confirmed it also happens on macos.
s
I am looking into your project now! You do not have a smaller version reproducer, right?
Reproduced the issue and I assume that I know where it is coming from: Right now, the shared native compiler does not about its full set of targets, but requires to be passed a single target. This now checks if this target is present in the libraries provided to it. However, your project is smart and only enables cinterops on the host platform. Now the shared native compiler is doing something unfortunate: From the set of targets it compiles from, it selects “the first enabled on the host”, which in this case is linuxX64. Now you have a compiler setup for linuxX64 receiving a macosX64 library, which gets filtered. You can track this issue here. https://youtrack.jetbrains.com/issue/KT-50944/Support-providing-a-set-of-native-targets-to-Shared-Native-Metad I will create another ticket for your special case after my break and link it.
d
Thanks for looking into this!
s
Here is the ticket you can directly follow: https://youtrack.jetbrains.com/issue/KT-52273/Shared-Native-Compilation-SearchPathResolver-Filters-propagated- I will bring this up in the next planning. Can’t promise it, but I hope we can make this into 1.7.20. Now, when this is blocking you, then I can help you working around this, but please keep in mind that things would get dirty (but they will work)
d
I think I can disable commonization as a workaround but I don't know how to do this per project.
s
This cannot be done on a per-project basis, also I assume that you are using symbols from your cinterop in your nativeMain source set, right?
d
Yeah I am. Although previously, I didn't have a
nativeMain
source set, I just set all the native targets to use the
nativeMain
folder.