Hey folks. I am playing around with Kotlin Native ...
# kotlin-native
h
Hey folks. I am playing around with Kotlin Native and hit the wall very early on. Running
./gradlew build
produces a weired error (see stacktrace)
My build.gradle looks like that:
Copy code
plugins {
    id 'org.jetbrains.kotlin.multiplatform' version '1.3.61'
}

repositories {
    mavenCentral()
}

kotlin {
  macosX64("macos") {
    binaries {
      executable{}
    }
  }
  mingwX64("windows") {
    binaries {
      executable{}
    }
  }
}

wrapper {
  gradleVersion = "6.0.1"
  distributionType = "ALL"
}
It doesn’t matter whether I use Java 8 (Oracle) or 11 (OpenJDK)
Yes. I will need a Windows build host for the minwx64. But it doesn’t seem to matter whether it is defined or not
d
The problem is during compiling macos build, it says invalid argument.
a
We got the same issue reported recently(https://github.com/JetBrains/kotlin-native/issues/3725). Can you try to use different Gradle version? IIRC, there was some problem with 6.0.1, maybe something is wrong there. Also it would be nice if you can extend the report with
--info
output.
h
I'll have a look and will comment on the GitHub oder, thanks @Artyom Degtyarev [JB]
🙏 1
Also, thanks for the clarification, @Dico
@Artyom Degtyarev [JB] So I tried Gradle 6.0.1, 6.0 and 5.6.4. All sho the same issue
Same for version 5.5.1
a
Okay, thanks! And what about
./gradlew compileKotlinMacos --info
? This flag can also help to extract arguments sent to
konanc
, for CLI use - as I mentioned in the issue.
h
Will try in a minute. In the meantime, I commented on the issue and attached the
--info
output from
build
.
🙏 1
👀 1
Copy code
> Task :compileKotlinMacos FAILED
Caching disabled for task ':compileKotlinMacos' because:
  Build cache is disabled
Task ':compileKotlinMacos' is not up-to-date because:
  Task has failed previously.
file or directory '/Users/holger/projects/customers/Customer 01/20200110 - CSV/repo/src/commonMain/kotlin', not found
file or directory '/Users/holger/projects/customers/Customer 01/20200110 - CSV/repo/src/commonMain/kotlin', not found
Run tool: konanc with args: -g -ea -target macos_x64 -p library -o /Users/holger/projects/customers/Customer 01/20200110 - CSV/repo/build/classes/kotlin/macos/main/repo.klib -Xmulti-platform -no-endorsed-libs /Users/holger/projects/customers/Customer 01/20200110 - CSV/repo/src/macosMain/kotlin/hello.kt
Starting process 'command '/Users/holger/.asdf/installs/java/openjdk-11.0.1/bin/java''. Working directory: /Users/holger/projects/customers/Customer 01/20200110 - CSV/repo Command: /Users/holger/.asdf/installs/java/openjdk-11.0.1/bin/java -Dawt.toolkit=sun.lwawt.macosx.LWCToolkit -Dfile.separator=/ -Dftp.nonProxyHosts=local|*.local|169.254/16|*.169.254/16 -DgopherProxySet=false -Dhttp.nonProxyHosts=local|*.local|169.254/16|*.169.254/16 -Djava.awt.graphicsenv=sun.awt.CGraphicsEnvironment -Djava.awt.printerjob=sun.lwawt.macosx.CPrinterJob -Djava.class.path=/Users/holger/.gradle/wrapper/dists/gradle-5.5.1-bin/cfsov38hb3r1zj4ic9bbjcc7n/gradle-5.5.1/lib/gradle-launcher-5.5.1.jar -Djava.class.version=55.0 -Djava.home=/Users/holger/.asdf/installs/java/openjdk-11.0.1 -Djava.library.path=/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/nativelib -Djava.runtime.name=OpenJDK Runtime Environment -Djava.runtime.version=11.0.1+13 -Djava.specification.name=Java Platform API Specification -Djava.specification.vendor=Oracle Corporation -Djava.specification.version=11 -Djava.vendor=Oracle Corporation -Djava.vendor.url=<http://java.oracle.com/> -Djava.vendor.url.bug=<http://bugreport.java.com/bugreport/> -Djava.vendor.version=18.9 -Djava.version=11.0.1 -Djava.version.date=2018-10-16 -Djava.vm.compressedOopsMode=Zero based -<http://Djava.vm.info|Djava.vm.info>=mixed mode -Djava.vm.name=OpenJDK 64-Bit Server VM -Djava.vm.specification.name=Java Virtual Machine Specification -Djava.vm.specification.vendor=Oracle Corporation -Djava.vm.specification.version=11 -Djava.vm.vendor=Oracle Corporation -Djava.vm.version=11.0.1+13 -Djdk.debug=release -Dkonan.home=/Users/holger/.konan/kotlin-native-macos-1.3.61 -Dkotlin.environment.keepalive=true -Dlibrary.jansi.path=/Users/holger/.gradle/native/jansi/1.17.1/osx -Dline.separator=
 -Dorg.gradle.appname=gradlew -Dorg.jetbrains.kotlin.cliMessageRenderer=GradleStyle -Dos.arch=x86_64 -Dos.name=Mac OS X -Dos.version=10.15.2 -Dpath.separator=: -DsocksNonProxyHosts=local|*.local|169.254/16|*.169.254/16 -Dsun.arch.data.model=64 -Dsun.boot.library.path=/Users/holger/.asdf/installs/java/openjdk-11.0.1/lib -Dsun.cpu.endian=little -Dsun.cpu.isalist -<http://Dsun.io|Dsun.io>.unicode.encoding=UnicodeBig -Dsun.java.command=org.gradle.launcher.daemon.bootstrap.GradleDaemon 5.5.1 -Dsun.java.launcher=SUN_STANDARD -Dsun.jnu.encoding=UTF-8 -Dsun.management.compiler=HotSpot 64-Bit Tiered Compilers -Dsun.os.patch.level=unknown -Duser.dir=/Users/holger/projects/customers/Customer 01/20200110 - CSV/repo -Duser.home=/Users/holger -Duser.name=holger -Duser.timezone -Xmx3G -Dfile.encoding=UTF-8 -<http://Djava.io|Djava.io>.tmpdir=/var/folders/5c/2z1wrqmd00jf2wqgd8c4ytzh0000gn/T/ -Duser.country=GB -Duser.language=en -Duser.variant -ea -cp /Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/kotlin-stdlib.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/klib.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/Runtime.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/protobuf-java-2.6.1.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/shared.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/kotlin-util-io.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/kotlin-script-runtime.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/kotlin-compiler.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/kotlin-reflect.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/konan.metadata.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/kotlin-util-klib.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/utilities.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/backend.native.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/trove4j.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/StubGenerator.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/konan.serializer.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/kotlinx.cli-jvm.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/kotlin-native-utils.jar:/Users/holger/.konan/kotlin-native-macos-1.3.61/konan/lib/Indexer.jar org.jetbrains.kotlin.cli.utilities.MainKt konanc @/var/folders/5c/2z1wrqmd00jf2wqgd8c4ytzh0000gn/T/konancArgs1107009468518817141.lst
Successfully started process 'command '/Users/holger/.asdf/installs/java/openjdk-11.0.1/bin/java''
e: Invalid argument: -
i: Use -help for more information
:compileKotlinMacos (Thread[Execution worker for ':',5,main]) completed. Took 1.559 secs.

FAILURE: Build failed with an exception.
Here we go:
Hope it helps
a
Yep, I see. The problem is just about whitespace-dash-whitespace in the path. There is
GSM Treuhand/20200110 - CSV/repo/
fragment, compiler supposes that as some kind of empty flag and breaks up. I think it can be fixed with the next release, but for now the quickest solution will be the directory rename. Can you give it a try?
h
Will do
s
@Holger Steinhauer [Mod] you might want to filter the customer name in your comments, never good idea to publicly show that stuff
h
Good point. Forgot about that, wanted to get this out of the way
Yep, it is due to the spaces and the - in the path
🎉 1