A reduced JDK (created with jlink
) is part of our application. The required modules for the JDK image is rarely changed. Unfortunately generating a new JDK image (with the exact same jlink
parameters) results different output, so
clients have to download the same file again and again during the differential upgrade, unnecessarily.
Here is a PoC:
$ mkdir jdk-15a jdk-15b
$ tar xzf openjdk-15_linux-x64_bin.tar.gz --directory jdk-15a/
$ tar xzf openjdk-15_linux-x64_bin.tar.gz --directory jdk-15b/
$ jdk-15a/jdk-15/bin/jlink --compress=1 --module-path jdk-15a/jdk-15/jmods --add-modules java.base,jdk.management,jdk.unsupported,jdk.charsets --output output01
$ jdk-15b/jdk-15/bin/jlink --compress=1 --module-path jdk-15b/jdk-15/jmods --add-modules java.base,jdk.management,jdk.unsupported,jdk.charsets --output output02
$ md5sum output*/lib/modules
9ae5ae63df59593a0892c5ed411d7e59 output01/lib/modules
24b4af31553670799ab286ad1186329e output02/lib/modules
(I'm using the jdk-15a
and jdk-15b
directories similar to JDK instances on multiple build servers.)
Is there any way to get byte-to-byte identical output (reproducible build) from jlink
in this case?
Used JDK version:
$ cat jdk-15a/jdk-15/release
IMPLEMENTOR="Oracle Corporation"
JAVA_VERSION="15"
JAVA_VERSION_DATE="2020-09-15"
...
OS_ARCH="x86_64"
OS_NAME="Linux"
SOURCE=".:hg:e3f940bd3c8f"
It's a JDK bug, reported at JDK-8252730.