I am having an issue concerning the reproducibility of the JVM libraries
produced by JLink. When running the same build script across different
machines with the same JDK, sometimes the binaries and libs in the
lib/runtime/bin and lib/runtime/lib folders are different. If one of the
*.so files is different, they all are. However, the lib/runtime/lib/modules
file produced by JLink is consistently identical. The machines running the
builds are all Linux running flavours of Ubuntu.

On examining the issue more closely, I notice that sometimes the files are
identical to the ones in the JDK installation, and sometimes they are not.
They are not significantly different, for example:
JDK:
-rw-rw-r-- 1 xxx xxx  16560 Aug  4 18:08 libjsig.so

JLink:
-rw-rw-r-- 1 xxx xxx  17136 Aug  4 19:23 libjsig.so

Further, I've tried running the java binaries in each, and they differ in
that one is 'sharing' and the other not:

xxx@yyy:~$ ~/.sdkman/candidates/java/18.0.1-tem/bin/java --version
openjdk 18.0.1 2022-04-19
OpenJDK Runtime Environment Temurin-18.0.1+10 (build 18.0.1+10)
OpenJDK 64-Bit Server VM Temurin-18.0.1+10 (build 18.0.1+10, mixed mode,
sharing)

xxx@yyy:~$ ~/project/build/image/bin/java --version
openjdk 18.0.1 2022-04-19
OpenJDK Runtime Environment Temurin-18.0.1+10 (build 18.0.1+10)
OpenJDK 64-Bit Server VM Temurin-18.0.1+10 (build 18.0.1+10, mixed mode)

What would cause JLink to modify the JVM itself? Is there a way I can
achieve a consistently reproducible JVM image?

The build in this case is using the org.beryx.jlink plugin with Gradle 7.5.

Thanks,
Craig

Reply via email to