Has anyone been able to get cross compilation runn...
# multiplatform
b
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
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
(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
It should be possible to run docker container with linux, and make libs directory from it available for K/N compiler.
b
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
You still need to install libcurl in the dockerfile
m
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.