Feature request
Is your feature request related to a problem? Please describe.
Provide out-of-the-box support of the Alpine Linux distribution on GraalVM CE and EE
Describe the solution you'd like.
This can be delivered as its own platform. For example, if someone desires to use GraalVM using Alpine, it should be a package like this: graalvm-ce-javaN-Alpine-amd64-X.Y.Z.tar.gz
Describe who do you think will benefit the most.
GraalVM users that want to use the advantage of a lightweight Linux distribution based on musl libc and busybox.
Describe alternatives you've considered.
Currently, is possible to execute GraalVM on Alpine using the glibc library. But the purpose of using Alpine is to use musl.
Additional context.
GraalVM's Github repository can demonstrate that there is a demand for support on Alpine. Here is a list of issues regarding the usage of Alpine:
https://github.com/oracle/graal/issues?q=+alpine+
I'm currently working on it. I've got both 8 and 11 versions build on Alpine, but the native-image tool does not work properly: it produces images that crash when run
I'm able to build substratevm and native-image with the attached patch applied and the following prerequisites:
musl-gcc somewhere in PATH and pointing to gcc from the package aboveapk add bash cmake git make openssh python2 zlib-staticI've managed to build complete GraalVM CE 20.3.0 package (including js, graalpython, truffleruby, and fastr) on Alpine Linux 3.11 with the 3 patches attached, and
apk add bash build-base cmake ed gfortran git make openssh python2 sed xz binutils-dev bzip2-dev curl-dev libffi-dev libxml2-dev openssl-dev pcre-dev readline-dev zlib-staticThings seem to work in general, but not all tests pass.
The patches are uncultured, they enable musl build at the cost of breaking glibc build. My next step should be to make both builds work. So far I've no idea how to do that... native files need some #ifdefs, as for Java and mx files I'm not sure.
Most helpful comment
I've managed to build complete GraalVM CE 20.3.0 package (including js, graalpython, truffleruby, and fastr) on Alpine Linux 3.11 with the 3 patches attached, and
apk add bash build-base cmake ed gfortran git make openssh python2 sed xz binutils-dev bzip2-dev curl-dev libffi-dev libxml2-dev openssl-dev pcre-dev readline-dev zlib-staticThings seem to work in general, but not all tests pass.
The patches are uncultured, they enable musl build at the cost of breaking glibc build. My next step should be to make both builds work. So far I've no idea how to do that... native files need some #ifdefs, as for Java and mx files I'm not sure.
graalvm-musl-20.3.0-patches.zip