graal
graal copied to clipboard
Support of the Alpine Linux distribution
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:
- gcc-9.3.1 from musl.cc (no luck with gcc package provided by Alpine)
- symlink named
musl-gccsomewhere in PATH and pointing togccfrom the package above - labsjdk-11
apk add bash cmake git make openssh python2 zlib-static- ninja built for Alpine
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
- labsjdk-11 as boot JDK
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-static- ninja built from source (Alpine package didn't work for me, some options were not supported)
Things 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.
Hello,
First, thanks a lot for taking into account the requirement I have talked to Julia Kindelsberger.
When do you think GraalVM will be fully supported on Alpine/musl 3.12.x as for the forthcoming OpenJDK 16 ?
Best Regards.
Hi @gradinac, sorry to disturb you but do you think we'll be able to work on integrating this patch anytime soon? If yes, I will work on resolving conflicts and re-merging the master branch
Hey @petermz, thank you for your contribution! :) I have some things that I need to finish up, but I will probably have time to look into this sometime next week - I'll post an update here as soon as I can.
Hey @gradinac , any update on this topic please? thank you for your contribution!
I am looking for the same for a new project any traction on this. #Alpine #GraalVM
Any update on this? @petermz @fernando-valdez
Any update on this ?
Hello,
As far as I know, the answer is: no update on this topic ☹. BTW, it has been a long time that I have requested (September 2020 more than 3 years ago) this feature.
As you can see no more activity since March 2021 so more that 2 years ago :-(
Best Regards.
FYI: I recently packaged Mandrel (distribution of GraalVM) native image builder for Alpine Linux. It’s currently available in the testing repository: openjdk-mandrel
Musl support was merged some time ago, see #3141. It is now possible to build and run GraalVM on a musl based system.
Some things might be unimplemented (esp. in Truffle/Espresso area), but JIT/AOT compilation should work