https://kotlinlang.org logo
b

Brian Estrada

05/19/2022, 10:04 AM
Has anyone been able to get cross compilation running (MacOS-ARM => Linux64)?
I’m using the ktor curl client, not having too much luck there as it requires the curl lib but that isn’t being found
Copy code
ld.lld: error: unable to find library -lcurl
m

mbonnin

05/19/2022, 10:17 AM
I'm afraid it's not possible because it uses the host dynamic lib. See https://youtrack.jetbrains.com/issue/KTOR-2186/Statically-link-curl-in-published-klibs
b

Brian Estrada

05/19/2022, 10:18 AM
(it is a trauma coming from the Maven + JVM ecosystem).
this explained the last 2 hours for me 😆
😁 1
thank you for linking this 🙏
m

msink

05/19/2022, 10:41 AM
It should be possible to run docker container with linux, and make libs directory from it available for K/N compiler.
b

Brian Estrada

05/19/2022, 10:42 AM
yeah I tried somethnig like this
Copy code
FROM gradle:7.4.2-jdk17-alpine AS build
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle linuxX64Binaries --no-daemon
didn’t really work out tho, it was just stuck building but not sure if gradle is the correct way to be building it
h

hfhbd

05/19/2022, 10:54 AM
You still need to install libcurl in the dockerfile
m

msink

05/19/2022, 11:01 AM
of course - install libcurl with all dependencies in docker, then copy
/lib
,
/usr/lib
(or whatever that linux distribution uses for libs) to host fs, and then point K/N to it by
-L
option.
12 Views