I'm setting up CI to run some K/N tests on several...
# kotlin-native
r
I'm setting up CI to run some K/N tests on several distributions (arch, fedora, ubuntu, etc) using docker but I'm facing an issue on some of them I'm getting this error:
Copy code
build/bin/linuxX64/debugTest/test.kexe: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory
In particular I get it on fedora and arch, but not on ubuntu and opensuse. Is there any known workaround? I'm using Kotlin 2.0.21
issue solved on both fedora and arch by installing
libxcrypt-compat
.
s
Hey there! I encountered a similar issue on Fedora, the solution was to install the
libxcrypt-compat
package.
s
Ah, didn't notice that message 😄
r
no problem, and thanks anyway 🙂
s
I had the same issue when running kotlin native app on distroless container images. Found this workaround in one of the ktor native sample and is working fine
Copy code
binaries {
      executable(setOf(RELEASE)) {
        entryPoint = "main"

        // Fix for libcrypt.so.1 not-found error on distroless
        if (target.targetName.startsWith("linux")) {
          linkerOpts("--as-needed")
          freeCompilerArgs += "-Xoverride-konan-properties=linkerGccFlags.linux=-lgcc -lgcc_eh -lc"
        }
🙌 2