Mitchell Syer
02/22/2023, 3:23 PMMitchell Syer
02/22/2023, 3:24 PMkotlin {
mingwX64 {
val main by it.compilations.getting
val library1 by main.cinterops.creating {
defFile = project.file("src/nativeInterop/${it.name}/library1.def")
packageName = "library1"
header(project.file("headers/library1/library1.h"))
includeDirs(project.file("headers"))
}
val library2 by main.cinterops.creating {
defFile = project.file("src/nativeInterop/${it.name}/library2.def")
packageName = "library2"
header(project.file("headers/library2/library2.h"))
includeDirs(project.file("headers"))
}
}
}
Mitchell Syer
02/22/2023, 3:24 PM> Task :project1:commonizeCInterop FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':project1:commonizeCInterop'.
> Process 'command 'C:\jdk-17.0.6.10-hotspot\bin\java.exe'' could not be started because the command line exceed operating system limits.
* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':project1:commonizeCInterop'.
Caused by: org.gradle.process.internal.ExecException: Process 'command 'C:\jdk-17.0.6.10-hotspot\bin\java.exe'' could not be started because the command line exceed operating system limits.
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'C:\jdk-17.0.6.10-hotspot\bin\java.exe'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WindowsProcessLauncher.start(WindowsProcessLauncher.java:22)
Caused by: java.io.IOException: Cannot run program "C:\jdk-17.0.6.10-hotspot\bin\java.exe" (in directory "C:\project1\project1"): CreateProcess error=206, The filename or extension is too long
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
Mitchell Syer
02/22/2023, 3:26 PMCreateProcess error=206
in slack and google, and the only results I have found are jar building errors, not sync kotlin native c interop errorsAdam S
02/22/2023, 3:42 PMMitchell Syer
02/22/2023, 3:43 PMAdam S
02/22/2023, 3:44 PM./gradlew commonizeCInterop
in a terminal?Adam S
02/22/2023, 3:45 PM--info
or --debug
can you see the full command, why it might be so long?Mitchell Syer
02/22/2023, 3:46 PMephemient
02/22/2023, 3:46 PMMitchell Syer
02/22/2023, 3:46 PMMitchell Syer
02/22/2023, 3:47 PMAdam S
02/22/2023, 3:48 PM./gradlew commonizeCInterop --info
. Seeing the full command might give some hints.ephemient
02/22/2023, 3:50 PMMitchell Syer
02/22/2023, 3:53 PMAdam S
02/22/2023, 3:53 PMMitchell Syer
02/22/2023, 4:00 PMAdam S
02/22/2023, 4:01 PMMitchell Syer
02/22/2023, 4:02 PMAdam S
02/22/2023, 4:08 PM-cp
)Adam S
02/22/2023, 4:09 PMMitchell Syer
02/22/2023, 4:09 PMMitchell Syer
02/22/2023, 4:10 PMMitchell Syer
02/22/2023, 4:11 PMAdam S
02/22/2023, 4:14 PMAdam S
02/22/2023, 4:14 PMAdam S
02/22/2023, 4:15 PMMitchell Syer
02/22/2023, 4:16 PMAdam S
02/22/2023, 4:18 PMAdam S
02/22/2023, 4:19 PM-dependency-libraries
flagMitchell Syer
02/22/2023, 4:19 PMAdam S
02/22/2023, 4:19 PMAdam S
02/22/2023, 4:24 PMorg.gradle.logging.level=info
to the project's gradle.properties
and syncing in IntelliJ. It should enable extra logs in the build window (View > Tool windows > build) Fetch the commonize command out again, and compare it to a successful commonize run from the command lineMitchell Syer
02/22/2023, 4:31 PMAdam S
02/22/2023, 4:49 PMMitchell Syer
02/22/2023, 5:07 PMMitchell Syer
02/22/2023, 5:42 PMAdam S
02/22/2023, 5:44 PMMitchell Syer
02/22/2023, 5:45 PMAdam S
02/22/2023, 5:46 PM> Task :commonizeNativeDistribution
Warning: No libraries found for target macos_arm64. This target will be excluded from commonization.
Warning: No libraries found for target macos_x64. This target will be excluded from commonization.
> Task :commonizeCInterop
Warning: No libraries found for target macos_arm64. This target will be excluded from commonization.
Warning: No libraries found for target macos_x64. This target will be excluded from commonization.
Mitchell Syer
02/22/2023, 6:09 PMAdam S
02/22/2023, 6:12 PMJeff Lockhart
02/22/2023, 10:34 PM~/.konan
to resolve the error. I'd be interested if there's a fix for this that allows using the plugin.ephemient
02/22/2023, 10:35 PMlouiscad
02/23/2023, 9:13 AMlouiscad
02/23/2023, 9:14 AMgradle.properties
might do, can you try?
kotlin.native.ignoreDisabledTargets=true