-
-
Notifications
You must be signed in to change notification settings - Fork 255
How to create a "reproducible build" on a Linux OS
- jdk-17.0.4+
- jdk-19+
To create a reproducible build you need a Linux OS environment identical to the environment of the build you want to reproduce.
So the exact environment dependencies is work in-progress, so at the present time the identical envionment can be achieved by building on the same machine as the original build, or build using a docker or podman container that was used for the same original build.
Adoptium Temurin builds use the following docker images:
- Linux x64 : docker pull adoptopenjdk/centos6_build_image
- Linux arm64 : docker pull adoptopenjdk/centos7_build_image
Starting a container in your local directory under a workspace folder:
mkdir workspace
docker run -it -u=$(id -u):$(id -g) -w $(pwd)/workspace -v $(pwd)/workspace:$(pwd)/workspace <image> bash
If you are using the Adoptium Temurin docker images, then your environment will already be setup.
Otherwise, your environment should be as specified for building the target JDK version. See: https://openjdk.org/groups/build/doc/building.html
Commands:
git clone /~https://github.com/adoptium/temurin-build.git
cd temurin-build
export VARIANT=temurin
export JAVA_TO_BUILD=jdk
export SCM_REF=jdk-20+2_adopt
(The Adoptium build tag you want to build, don't set to build HEAD)
export RELEASE=true
export CONFIGURE_ARGS=--disable-ccache
build-farm/make-adopt-build-farm.sh
Build output:
Once the build has successfully completed the built JDK archive will be available in directory:
JDK Archive: workspace/target/jdk-hotspot.tar.gz
CycloneDX SBOM: workspace/target/jdk-hotspot.json
Currently identical JDK images "may" have the following differences, if building on the same physical machine as the original quite often these will be identical as well:
- jdk-19+
- lib/server/classes_nocoops.jsa
- jdk-17.0.4+
- lib/server/classes.jsa
- lib/server/classes_nocoops.jsa