0

I'm porting a C# library to Kotlin to take advantage of multiplatform. When running the build task, it fails in the subtask linkDebugTestLinux.

For context, I'm using IDEA Ultimate on Manjaro. I'm certain there's nothing wrong with my code as compileKotlinLinux finishes without error.

There are zero DDG results for "linkDebugTestLinux" and nothing helpful for "konan could not find home" or "kotlin native ...". After hours of stitching together incomplete and outdated examples from the official docs, I've given up.

My build.gradle.kts:

plugins {
    kotlin("multiplatform") version "1.3.40"
}

repositories {
    mavenCentral()
}

dependencies {
    commonMainImplementation("org.jetbrains.kotlin:kotlin-stdlib")
    commonTestImplementation("org.jetbrains.kotlin:kotlin-test-common")
    commonTestImplementation("org.jetbrains.kotlin:kotlin-test-annotations-common")
}

kotlin {
//  js() // wasn't the issue
    linuxX64("linux")
}

Output of task build without args:

> Configure project :
Kotlin Multiplatform Projects are an experimental feature.
> Task :compileKotlinLinux
[...unused param warnings...]
> Task :compileKotlinMetadata
[...unused param warnings...]
> Task :metadataMainClasses
> Task :metadataJar
> Task :assemble
> Task :linuxProcessResources NO-SOURCE
> Task :linuxMainKlibrary
> Task :linkDebugTestLinux FAILED
e: Could not find "/home/username/" in [/home/username/path/to/the/repo, /home/username/.konan/klib, /home/username/.konan/kotlin-native-linux-1.3/klib/common, /home/username/.konan/kotlin-native-linux-1.3/klib/platform/linux_x64].
[...snip...]
BUILD FAILED in 16s
4 actionable tasks: 4 executed
Process 'command '/usr/lib/jvm/java-8-openjdk/bin/java'' finished with non-zero exit value 1

In the boilerplate I omitted it suggests to use --debug, so I've uploaded that here.

James Groom
  • 235
  • 2
  • 6
  • It looks similar to [this](https://kotlinlang.slack.com/archives/C3PQML5NU/p1560165054083900) one. Try to change your `build.gradle` file the same way, and let me know if it won't help. – Artyom Degtyarev Jun 27 '19 at 11:42
  • @ArtyomDegtyarev Looks like I can't access that, can you make a mirror? – James Groom Jun 27 '19 at 13:14
  • Oh, I'm sorry, to access the slack, one got to get an invite from https://kotlinlang.org/community/ site. There was an advice to change `____Implementation` with ordinary `implementation`. – Artyom Degtyarev Jun 27 '19 at 14:10
  • I've copied more of the examples and ended up with [this](https://gist.github.com/YoshiRulz/0f312d5c248e2d16b6b4c00daaef4471#gistcomment-2956255), the error persists. – James Groom Jun 28 '19 at 06:46

1 Answers1

0

After some investigation, it was assumed that the problem is in the path. In the debug log, you got the /home/yoshi/,/ fragment. As far as this directory name was unexpected, the compiler interpreted this , as a delimiter between lib names. So, it tried to find library /home/yoshi/, that was obviously unavailable.
For now, I would recommend you to change the directory name to be something trivial.

Artyom Degtyarev
  • 2,704
  • 8
  • 23
  • It seems that konan won't let you use a comma in the project path. I switched to comma because `msbuild` wouldn't accept plus, being a Microsoft product, it gave an equally unhelpful error message when using characters disallowed by NTFS. Thanks for the response! – James Groom Jun 28 '19 at 14:13
  • UPD: This issue will be gone in the next release, so you'll be free to rename your directory back. – Artyom Degtyarev Jul 04 '19 at 08:33