diff --git a/test/system/reproducibleCompare/reproducible.mk b/test/system/reproducibleCompare/reproducible.mk index 3c901fff6..34b3b0342 100644 --- a/test/system/reproducibleCompare/reproducible.mk +++ b/test/system/reproducibleCompare/reproducible.mk @@ -23,4 +23,6 @@ endif ifneq (,$(findstring linux,$(SPEC))) SBOM_FILE := $(subst $(TEST_ROOT)/../jdkbinary,/home/jenkins/test,$(SBOM_FILE)) -endif \ No newline at end of file +endif + +RM_DEBUGINFO := $(shell find $(TEST_JDK_HOME) -type f -name "*.debuginfo" -delete) \ No newline at end of file diff --git a/tooling/reproducible/linux_repro_build_compare.sh b/tooling/reproducible/linux_repro_build_compare.sh index b84c55d48..1aceb48d3 100755 --- a/tooling/reproducible/linux_repro_build_compare.sh +++ b/tooling/reproducible/linux_repro_build_compare.sh @@ -24,8 +24,9 @@ ANT_VERSION=1.10.5 ANT_SHA=9028e2fc64491cca0f991acc09b06ee7fe644afe41d1d6caf72702ca25c4613c ANT_CONTRIB_VERSION=1.0b3 ANT_CONTRIB_SHA=4d93e07ae6479049bb28071b069b7107322adaee5b70016674a0bffd4aac47f9 -isJdkDir=false USING_DEVKIT="false" +ScriptPath=$(dirname "$(realpath "$0")") + installPrereqs() { if test -r /etc/redhat-release; then # Replace mirrorlist to vault as centos7 reached EOL. @@ -88,12 +89,6 @@ setAntEnvironment() { export PATH="${LOCALGCCDIR}/bin:/usr/local/bin:/usr/bin:$PATH:/usr/local/apache-ant-${ANT_VERSION}/bin" } -cleanBuildInfo() { - local DIR="$1" - # BUILD_INFO name of OS level build was built on will likely differ - sed -i '/^BUILD_INFO=.*$/d' "${DIR}/release" -} - setTemurinBuildArgs() { local buildArgs="$1" local bootJdk="$2" @@ -185,41 +180,36 @@ if [ -z "$JDK_PARAM" ] && [ ! -d "jdk-${TEMURIN_VERSION}" ] ; then JDK_PARAM="https://api.adoptium.net/v3/binary/version/jdk-${TEMURIN_VERSION}/linux/${NATIVE_API_ARCH}/jdk/hotspot/normal/eclipse?project=jdk" fi +sourceJDK="jdk-${TEMURIN_VERSION}" +mkdir "${sourceJDK}" if [[ $JDK_PARAM =~ ^https?:// ]]; then echo Retrieving original tarball from adoptium.net && curl -L "$JDK_PARAM" | tar xpfz - && ls -lart "$PWD/jdk-${TEMURIN_VERSION}" || exit 1 elif [[ $JDK_PARAM =~ tar.gz ]]; then - mkdir "$PWD/jdk-${TEMURIN_VERSION}" tar xpfz "$JDK_PARAM" --strip-components=1 -C "$PWD/jdk-${TEMURIN_VERSION}" else - echo "Local jdk dir" - isJdkDir=true -fi - -comparedDir="jdk-${TEMURIN_VERSION}" -if [ "${isJdkDir}" = true ]; then - comparedDir=$JDK_PARAM + # Local jdk dir + cp -R "${JDK_PARAM}"/* "${sourceJDK}" fi echo "Rebuild args for makejdk_any_platform.sh are: $TEMURIN_BUILD_ARGS" echo " cd temurin-build && ./makejdk-any-platform.sh $TEMURIN_BUILD_ARGS 2>&1 | tee build.$$.log" | sh echo Comparing ... -mkdir compare.$$ -tar xpfz temurin-build/workspace/target/OpenJDK*-jdk_*tar.gz -C compare.$$ +mkdir tarJDK +tar xpfz temurin-build/workspace/target/OpenJDK*-jdk_*tar.gz -C tarJDK cp temurin-build/workspace/target/OpenJDK*-jdk_*tar.gz reproJDK.tar.gz cp "$SBOM" SBOM.json -cleanBuildInfo "${comparedDir}" -cleanBuildInfo "compare.$$/jdk-$TEMURIN_VERSION" +cp "$ScriptPath"/repro_*.sh "$PWD" +chmod +x "$PWD"/repro_*.sh rc=0 - -# shellcheck disable=SC2069 -diff -r "${comparedDir}" "compare.$$/jdk-$TEMURIN_VERSION" 2>&1 > "reprotest.diff" || rc=$? +set +e +./repro_compare.sh temurin "$sourceJDK" temurin tarJDK/jdk-"$TEMURIN_VERSION" Linux 2>&1 || rc=$? +set -e if [ $rc -eq 0 ]; then echo "Compare identical !" else - cat "reprotest.diff" echo "Differences found..., logged in: reprotest.diff" fi diff --git a/tooling/reproducible/repro_common.sh b/tooling/reproducible/repro_common.sh index 9d0a7c2ad..4e3bf8bce 100755 --- a/tooling/reproducible/repro_common.sh +++ b/tooling/reproducible/repro_common.sh @@ -420,7 +420,6 @@ function cleanTemurinFiles() { local DIR="$1" echo "Cleaning Temurin build-scripts specific files and metadata from ${DIR}" - echo "Removing Temurin NOTICE file from $DIR" rm "${DIR}"/NOTICE @@ -453,7 +452,7 @@ function cleanTemurinFiles() { echo "Removing SOURCE= from ${DIR}/release file, as Temurin builds from Adoptium mirror repo _adopt tag" sed -i '/^SOURCE=.*$/d' "${DIR}/release" fi - + echo "Removing cacerts file, as Temurin builds with different Mozilla cacerts" find "${DIR}" -type f -name "cacerts" -delete diff --git a/tooling/reproducible/repro_process.sh b/tooling/reproducible/repro_process.sh index d63373cae..92b246f2a 100755 --- a/tooling/reproducible/repro_process.sh +++ b/tooling/reproducible/repro_process.sh @@ -39,6 +39,6 @@ fi patchManifests "${JDK_DIR}" echo "***********" -echo "SUCCESS :-)" +echo " Preprocess ${JDK_DIR} SUCCESS :-)" echo "***********"