apache / maven-mvnd

Apache Maven Daemon
https://maven.apache.org/
Apache License 2.0
2.94k stars 212 forks source link

Support for musl library on linux-amd64 (Alpine) #642

Open Raul1718 opened 2 years ago

Raul1718 commented 2 years ago

image

gnodet commented 2 years ago

Do you have a docker image to reproduce the problem ?

walnut-tom commented 2 years ago

Dockerfile add _RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2_

gnodet commented 2 years ago

Dockerfile add _RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2_

Adding the link to the musl library still leads to an error:

~ # ./mvnd-0.8.0-linux-amd64/bin/mvnd
Error relocating ./mvnd-0.8.0-linux-amd64/bin/mvnd: __strdup: symbol not found
Segmentation fault

This looks similar to https://github.com/SAP/node-rfc/issues/148. Either mvnd client and the native library have to be compiled and linked with musl, or glibc needs to be installed on the alpine box.

walnut-tom commented 2 years ago

here a graalvm in alpine https://github.com/renanpalmeira/docker-graalvm-alpine/blob/master/Dockerfile

gnodet commented 2 years ago

here a graalvm in alpine https://github.com/renanpalmeira/docker-graalvm-alpine/blob/master/Dockerfile

This looks a bit outdated as GraalVM location has changed (and version is now 22), but it may be used as a basis. I found the following thread FTR: https://github.com/oracle/graal/issues/1898#issuecomment-763275747 which points to this gist https://gist.github.com/sify21/2eec007e4b05d448c85192fc279232c6

zhaoyuehao commented 2 years ago

Dockerfile add _RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2_

Adding the link to the musl library still leads to an error:

~ # ./mvnd-0.8.0-linux-amd64/bin/mvnd
Error relocating ./mvnd-0.8.0-linux-amd64/bin/mvnd: __strdup: symbol not found
Segmentation fault

This looks similar to SAP/node-rfc#148. Either mvnd client and the native library have to be compiled and linked with musl, or glibc needs to be installed on the alpine box.

https://wiki.alpinelinux.org/wiki/Running_glibc_programs

apk add gcompat

It work for me