Graal: Support of the Alpine Linux distribution

Created on 1 Sep 2020  路  3Comments  路  Source: oracle/graal

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+

feature

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

  • 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.

graalvm-musl-20.3.0-patches.zip

All 3 comments

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-gcc somewhere in PATH and pointing to gcc from the package above
  • labsjdk-11
  • apk add bash cmake git make openssh python2 zlib-static
  • ninja built for Alpine

alpine-musl-ni.patch.txt

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.

graalvm-musl-20.3.0-patches.zip

Was this page helpful?
0 / 5 - 0 ratings