kotlinx.coroutines icon indicating copy to clipboard operation
kotlinx.coroutines copied to clipboard

Coroutines are not built for arm ( targets linuxArm32Hfp and others)

Open harlem88 opened this issue 6 years ago • 27 comments

When I build kotlin-native project for linuxArm32Hfp receive: Unable to find a matching configuration of org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.0.1

harlem88 avatar Nov 22 '18 14:11 harlem88

Is there any update on this? It has been almost a year and the issue was neither addressed nor closed. I am developing a Raspberry Pi IoT project and the lack of coroutines is quite a blow.

Nohus avatar Oct 20 '19 21:10 Nohus

You can build your own version for linuxArm from the sources, but you'll also need to build https://github.com/Kotlin/kotlinx.atomicfu first. We'll expand the set platforms available out of the box at some point.

elizarov avatar Oct 21 '19 06:10 elizarov

I think we will address this issue right after Kotlin 1.3.60 release (along with #1596)

qwwdfsad avatar Oct 21 '19 08:10 qwwdfsad

@qwwdfsad any timeline for this to be released?

sockeqwe avatar Oct 21 '19 13:10 sockeqwe

@elizarov looks like a compilation quest, compilation errors appear when building kotlinx.atomicfu

e: kotlinx.atomicfu/atomicfu/src/nativeMain/kotlin/kotlinx/atomicfu/locks/Synchronized.kt: (4, 8): Unresolved reference: interop

let me repeat the question above: any timeline for this to be released?

AlexanderBykin avatar Feb 23 '20 11:02 AlexanderBykin

No specific timeline at the moment.

elizarov avatar Feb 23 '20 20:02 elizarov

It has been many months since there was an update to this issue. @elizarov - What is the current status on support for the Linux Arm targets? Why are the IOS Arm targets a higher priority than the Linux Arm targets?

napperley avatar May 26 '20 23:05 napperley

If testing for the Linux Arm targets is a issue then there are some solutions available. With the Linux Arm based targets (not the Android ones) testing can either be done through QEMU, or on a Arm based computer (eg a SBC like a Raspberry Pi, or Beagle Bone Black for instance) via SSH. The testing method that is used will heavily depend on the software being tested. For the QEMU option the buildroot would be setup in a similar way as described in this article.

napperley avatar May 26 '20 23:05 napperley

The status is the same. We don't currently have the capacity in our team to support Linux ARM and no near-term priority in that direction.

elizarov avatar Jun 05 '20 11:06 elizarov

It would be great if the Linux arm32 target could be added. We would like to use this target for Tizen OS smart watches in our app. We are using kotlinx.coroutines but that does not appear to have the required target.

Kotlinx.serialization does have support for Linux arm targets, see the following: https://github.com/Kotlin/kotlinx.serialization/blob/fb65be2e43cd5df41ab1c8db0f456bcf57033e6f/gradle/native-targets.gradle#L95-L98

I am not sure how they are testing the Linux targets in their project.

Thomas-Vos avatar Dec 03 '20 20:12 Thomas-Vos

@Thomas-Vos Are you able to run Kotlin code on Tizen OS already? 👀

LouisCAD avatar Dec 03 '20 22:12 LouisCAD

@LouisCAD yes, I have Kotlin code working on physical Tizen OS watches (specifically the Galaxy Watch).

I am using the linuxArm32Hfp target. Cinterop with native Tizen libaries works too. Needed to use a workaround for soft float from here: https://github.com/JetBrains/kotlin-native/issues/3350#issuecomment-702678120 (will be easier when Kotlin 1.4.30 is released with the new -Xoverride-konan-properties flag. However. it would be better if a new target is added for soft float). I am currently exporting a static lib and including that in Tizen Studio. The code works and I verified the Kotlin code can actually interop with Tizen code. Unfortunately, I am still waiting for the Linux targets to be added in AtomicFU, Coroutines, and Ktor, before I can actually start developing further.

The Tizen OS emulator is a bit more challenging. It is an x86 emulator. I think I would need a linuxX86 target but unfortunately that does not exist in Kotlin/Native. If you have any ideas, let me know.

Thomas-Vos avatar Dec 04 '20 18:12 Thomas-Vos

@Thomas-Vos - The Tizen emulator is X64 (also known as amd64 in Linux), which should be covered by Kotlin Native's linuxX64 target (already supported by KotlinX Coroutines). On the Tizen website ALL downloads (for Linux, Windows, and Mac OS X) are X64 only.

napperley avatar Dec 07 '20 00:12 napperley

It seems as though the Kotlin team is split on Linux support for Kotlin Native. With some major Kotlin libraries developed by JetBrains there is good Linux support (eg KotlinX Serialization), while there are other libraries that barely have Linux support (eg KotlinX Coroutines). Everywhere there is inconsistency on Kotlin Native's Linux support, this has to change! Looks like the Kotlin team is placing way too much focus on Apple platforms to the detriment of support for other platforms like Linux for example.

Would not be too surprising that there are some prominent members on the Kotlin team that are heavily for Linux support on Kotlin Native that aren't being allowed to significantly improve the situation. Must be extremely frustrating for them considering they understand the huge importance of the Linux platform from a business/technical standpoint, especially with Embedded Linux which is a large market that would easily rival the Apple platforms.

napperley avatar Dec 07 '20 00:12 napperley

@Thomas-Vos - The Tizen emulator is X64 (also known as amd64 in Linux), which should be covered by Kotlin Native's linuxX64 target (already supported by KotlinX Coroutines). On the Tizen website ALL downloads (for Linux, Windows, and Mac OS X) are X64 only.

Thanks for the details. However, when I try to create an emulator I can only select x86. See attached screenshot. I tried it on macOS and Windows. Are you sure the Tizen OS emulator is 64 bit as well?

I created an issue on YouTrack about the missing targets for Tizen OS: https://youtrack.jetbrains.com/issue/KT-43808

TizenOS emulator

Thomas-Vos avatar Dec 07 '20 17:12 Thomas-Vos

Very disappointed to run into this hurdle. Any updates on when it might be addressed?

clydebarrow avatar May 11 '21 00:05 clydebarrow

We also need arm targets to solve https://youtrack.jetbrains.com/issue/KTOR-872

e5l avatar May 13 '21 13:05 e5l

As an alternative one can use Reaktive, it does support linuxArm32Hfp and is tested against this target.

arkivanov avatar May 29 '21 23:05 arkivanov

Hey folks, we are also interested in this. We want to support Raspberry Pi and Raspberry Pi Zero in KorGE so we need 32-bit and 64-bit linux versions.

Made this PR here to add those targets to atomicfu: https://github.com/Kotlin/kotlinx.atomicfu/pull/193/files

Is anything we can do to move this forward, is there any blockers like not being able to execute tests, or it is just a matter of bandwidth?

soywiz avatar Jul 16 '21 17:07 soywiz

Enabling Arm32/Arm64 is pretty simple: https://github.com/Kotlin/kotlinx.coroutines/pull/2841 though based on one of the comments on the kotlinx.atomicfu issues board it sounds like it's a matter of testing and officially supporting the build, not just generating it.

ObsidianX avatar Jul 25 '21 00:07 ObsidianX

This is blocking kotest to use the Linux ARM target, why can't it be merged?

JavierSegoviaCordoba avatar Sep 03 '21 21:09 JavierSegoviaCordoba

@JavierSegoviaCordoba please see https://youtrack.jetbrains.com/issue/KT-43996

dkhalanskyjb avatar Sep 06 '21 07:09 dkhalanskyjb

This is a major blocker for me. Surely it can't be too hard?

clydebarrow avatar Sep 28 '21 01:09 clydebarrow

2 years later, I would still love to have this resolved. I am still building Raspberry Pi electronics with Kotlin/Native and still can't use coroutines. :/

Nohus avatar Nov 17 '21 19:11 Nohus

kotlinx.coroutines with linuxArm64 and linuxArm32Hfp

This fork has minimal changes to allow building linuxArm64 and linuxArm32Hfp kotlin native libraries.

Binaries are available on my maven repository at: https://h1.danbrough.org/maven

The current versions available are:

  • 1.5.2-danbroid
  • 1.5.2-danbroid-native-mt
  • 1.6.0-RC-danbroid

With the source code at: https://github.com/danbrough/kotlinx.coroutines and https://github.com/danbrough/kotlinx.atomicfu

So far I've only tested the linuxArm64 binaries on a RPI3 running debian 64bit.

danbrough avatar Nov 28 '21 21:11 danbrough

Binaries are available on my maven repository

Thanks! I've just built on a mac and run on a 32 bit RPI (original version with 512MB RAM) and it works! Awesome!

For the benefit of others, here is my build.gradle.kts with configs for host (macOS) and Pi targets:

plugins {
    kotlin("multiplatform") version "1.6.10"
    kotlin("plugin.serialization") version "1.6.10"
}

repositories {
    mavenCentral()
    maven(url = "https://h1.danbrough.org/maven/")
}

kotlin {
    val hostOs = System.getProperty("os.name")
    val isMingwX64 = hostOs.startsWith("Windows")
    val hostTarget = when {
        hostOs == "Mac OS X" -> macosX64("host")
        hostOs == "Linux" -> linuxX64("host")
        isMingwX64 -> mingwX64("host")
        else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
    }

    hostTarget.apply {
        binaries {
            executable {
                entryPoint = "main"
            }
        }
    }
    linuxArm32Hfp("pi").apply {
        binaries {
            executable {
                entryPoint = "main"
            }
        }
    }
    sourceSets {
        commonMain {
            dependencies {
                implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
            }
        }
        val hostMain by getting {
            dependencies {
                implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.3.2")
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
            }
        }
        val piMain by getting {
            dependencies {
                implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-linuxarm32hfp:1.6.0-danbroid")
                implementation("org.jetbrains.kotlinx:kotlinx-datetime-linuxarm32hfp:0.3.1-danbroid")
            }
        }
    }
}

clydebarrow avatar Jan 26 '22 10:01 clydebarrow

I've setup a github repo at https://github.com/danbrough/kotlinxtras/ as a hub for tweaked packages for linuxArm32Hfp,linuxArm64 and the android native targets. It would be useful to anyone who wants to use kotlin native coroutines, okio, atomicfu, datetime, serialization, ktor with curl or who just needs curl or openssl support in their kotlin native app. Those are all working and there are precompiled packages at: https://s01.oss.sonatype.org/content/groups/staging/org/danbrough/ for pre-releases before they are published to: https://repo.maven.apache.org/maven2/org/danbrough/

danbrough avatar Sep 11 '22 03:09 danbrough

Kotlin 1.8.0 was released two days ago and still no support for Linux ARM, any news about those platforms?

nicolasfara avatar Dec 30 '22 20:12 nicolasfara

@qwwdfsad There is no support for linuxArm32Hfp. I think this issue was marked as done by mistake. May be very confusing if some people come to this GH issue and see it as `complete'. Would be good to keep it open if there is a glimmer of hope to implement this in a future. Or explicitly close it with a resolution that KT will never support this Linux architecture.

audkar avatar Mar 09 '23 13:03 audkar

See https://kotlinlang.org/docs/native-target-support.html#deprecated-targets

dkhalanskyjb avatar Mar 09 '23 13:03 dkhalanskyjb