From cf3dc05ee9ce2cb83caa2db26b867db960441f16 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Fri, 16 Aug 2024 16:48:25 -0400 Subject: [PATCH 01/11] Renable reproducible compare on mac Signed-off-by: Sophia Guo --- test/system/reproducibleCompare/playlist.xml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/system/reproducibleCompare/playlist.xml b/test/system/reproducibleCompare/playlist.xml index ba90cddfb..2cffcd482 100644 --- a/test/system/reproducibleCompare/playlist.xml +++ b/test/system/reproducibleCompare/playlist.xml @@ -59,4 +59,24 @@ os.win + + Rebuild_Same_JDK_Reproducibility_Test_Mac + ls -l $(TEST_ROOT)$(D)system$(D)reproducibleCompare$(D);\ + $(TEST_ROOT)$(D)system$(D)reproducibleCompare$(D)macos_repro_build_compare.sh $(SBOM_FILE) $(JDK_FILE) $(REPORTDIR); \ + $(TEST_STATUS) + + + dev + + + system + + + eclipse + + + 21+ + + os.osx + \ No newline at end of file From 0e5c2416e0608ba5e68b614257574e8fa7b1a8da Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Wed, 21 Aug 2024 15:36:49 -0400 Subject: [PATCH 02/11] Remove non-relevant files Signed-off-by: Sophia Guo --- tooling/reproducible/repro_common.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tooling/reproducible/repro_common.sh b/tooling/reproducible/repro_common.sh index 9d0a7c2ad..4ee0567b7 100755 --- a/tooling/reproducible/repro_common.sh +++ b/tooling/reproducible/repro_common.sh @@ -327,14 +327,18 @@ function processModuleInfo() { fi } -# Remove windowns generate classes jdk/bin/server/classes.jsa & jdk/bin/server/classes_nocoops.jsa +# Remove non-relevant files function removeGeneratedClasses() { local JDK_DIR="$1" local OS="$2" - if [[ "$OS" =~ CYGWIN* ]] || [[ "$OS" =~ Darwin* ]]; then - rm -rf "$JDK_DIR/bin/server/classes.jsa" - rm -rf "$JDK_DIR/bin/server/classes_nocoops.jsa" + rm -rf "$JDK_DIR/bin/server/classes.jsa" + rm -rf "$JDK_DIR/bin/server/classes_nocoops.jsa" + rm -rf "$JDK_DIR/release" + rm -rf "$JDK_DIR/NOTICE" + + if [[ "$OS" =~ Linux ]]; then + find "$JDK_DIR/" -type f -name "*.debuginfo" -delete fi } From f0158b40d566742592e26ef958c761cb179f38d0 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Wed, 21 Aug 2024 16:20:32 -0400 Subject: [PATCH 03/11] Move compare process to common script Signed-off-by: Sophia Guo --- .../reproducible/linux_repro_build_compare.sh | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/tooling/reproducible/linux_repro_build_compare.sh b/tooling/reproducible/linux_repro_build_compare.sh index b84c55d48..f2210ca68 100755 --- a/tooling/reproducible/linux_repro_build_compare.sh +++ b/tooling/reproducible/linux_repro_build_compare.sh @@ -26,6 +26,7 @@ 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" @@ -204,22 +199,20 @@ 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 compare +tar xpfz temurin-build/workspace/target/OpenJDK*-jdk_*tar.gz -C compare cp temurin-build/workspace/target/OpenJDK*-jdk_*tar.gz reproJDK.tar.gz cp "$SBOM" SBOM.json -cleanBuildInfo "${comparedDir}" -cleanBuildInfo "compare.$$/jdk-$TEMURIN_VERSION" rc=0 -# shellcheck disable=SC2069 -diff -r "${comparedDir}" "compare.$$/jdk-$TEMURIN_VERSION" 2>&1 > "reprotest.diff" || rc=$? +echo "./repro_compare.sh temurin ${comparedDir}/ temurin compare/ Linux 2>&1" | sh & +wait +rc=$? if [ $rc -eq 0 ]; then echo "Compare identical !" else - cat "reprotest.diff" echo "Differences found..., logged in: reprotest.diff" fi From f4442245612350e56c7dfedf2063ce539819ca69 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Wed, 21 Aug 2024 16:44:51 -0400 Subject: [PATCH 04/11] Testing Signed-off-by: Sophia Guo --- test/system/reproducibleCompare/playlist.xml | 20 ------------------- .../reproducible/linux_repro_build_compare.sh | 14 +++++++++++-- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/test/system/reproducibleCompare/playlist.xml b/test/system/reproducibleCompare/playlist.xml index 2cffcd482..ba90cddfb 100644 --- a/test/system/reproducibleCompare/playlist.xml +++ b/test/system/reproducibleCompare/playlist.xml @@ -59,24 +59,4 @@ os.win - - Rebuild_Same_JDK_Reproducibility_Test_Mac - ls -l $(TEST_ROOT)$(D)system$(D)reproducibleCompare$(D);\ - $(TEST_ROOT)$(D)system$(D)reproducibleCompare$(D)macos_repro_build_compare.sh $(SBOM_FILE) $(JDK_FILE) $(REPORTDIR); \ - $(TEST_STATUS) - - - dev - - - system - - - eclipse - - - 21+ - - os.osx - \ 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 f2210ca68..76bd8900d 100755 --- a/tooling/reproducible/linux_repro_build_compare.sh +++ b/tooling/reproducible/linux_repro_build_compare.sh @@ -196,7 +196,8 @@ if [ "${isJdkDir}" = true ]; then 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 +#Testing disable build +# echo " cd temurin-build && ./makejdk-any-platform.sh $TEMURIN_BUILD_ARGS 2>&1 | tee build.$$.log" | sh echo Comparing ... mkdir compare @@ -204,11 +205,20 @@ tar xpfz temurin-build/workspace/target/OpenJDK*-jdk_*tar.gz -C compare cp temurin-build/workspace/target/OpenJDK*-jdk_*tar.gz reproJDK.tar.gz cp "$SBOM" SBOM.json +cp "$ScriptPath"/repro_*.sh "$PWD" +echo "under script path +files permission" +ls -l "$ScriptPath" +echo "files permission" +ls -l rc=0 +set +e -echo "./repro_compare.sh temurin ${comparedDir}/ temurin compare/ Linux 2>&1" | sh & +#Testing disable compare# +#echo "./repro_compare.sh temurin $comparedDir/ temurin compare/ Linux 2>&1" | sh & wait rc=$? +set -e if [ $rc -eq 0 ]; then echo "Compare identical !" From 03773f332a8f5eab173d1baccefbff6ca935a00b Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Thu, 22 Aug 2024 14:38:35 -0400 Subject: [PATCH 05/11] Testing Signed-off-by: Sophia Guo --- .../reproducible/linux_repro_build_compare.sh | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/tooling/reproducible/linux_repro_build_compare.sh b/tooling/reproducible/linux_repro_build_compare.sh index 76bd8900d..53a9c5d3b 100755 --- a/tooling/reproducible/linux_repro_build_compare.sh +++ b/tooling/reproducible/linux_repro_build_compare.sh @@ -24,9 +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. @@ -180,42 +180,31 @@ 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" -#Testing disable build -# echo " cd temurin-build && ./makejdk-any-platform.sh $TEMURIN_BUILD_ARGS 2>&1 | tee build.$$.log" | sh +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 cp "$ScriptPath"/repro_*.sh "$PWD" -echo "under script path -files permission" -ls -l "$ScriptPath" -echo "files permission" -ls -l +chmod +x "$PWD"/repro_*.sh rc=0 set +e - -#Testing disable compare# -#echo "./repro_compare.sh temurin $comparedDir/ temurin compare/ Linux 2>&1" | sh & +echo "./repro_compare.sh temurin $sourceJDK temurin tarJDK Linux 2>&1" | sh & wait rc=$? set -e From f5ecf133437e01db33dac763668ef664539ba848 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Fri, 23 Aug 2024 09:10:15 -0400 Subject: [PATCH 06/11] Remove release and other generated files Signed-off-by: Sophia Guo --- tooling/reproducible/repro_common.sh | 47 ---------------------------- 1 file changed, 47 deletions(-) diff --git a/tooling/reproducible/repro_common.sh b/tooling/reproducible/repro_common.sh index 4ee0567b7..34b9903d2 100755 --- a/tooling/reproducible/repro_common.sh +++ b/tooling/reproducible/repro_common.sh @@ -428,36 +428,6 @@ function cleanTemurinFiles() { echo "Removing Temurin NOTICE file from $DIR" rm "${DIR}"/NOTICE - if [[ $(uname) =~ Darwin* ]]; then - echo "Removing Temurin specific lines from release file in $DIR" - sed -i "" '/^BUILD_SOURCE=.*$/d' "${DIR}/release" - sed -i "" '/^BUILD_SOURCE_REPO=.*$/d' "${DIR}/release" - sed -i "" '/^SOURCE_REPO=.*$/d' "${DIR}/release" - sed -i "" '/^FULL_VERSION=.*$/d' "${DIR}/release" - sed -i "" '/^SEMANTIC_VERSION=.*$/d' "${DIR}/release" - sed -i "" '/^BUILD_INFO=.*$/d' "${DIR}/release" - sed -i "" '/^JVM_VARIANT=.*$/d' "${DIR}/release" - sed -i "" '/^JVM_VERSION=.*$/d' "${DIR}/release" - sed -i "" '/^IMAGE_TYPE=.*$/d' "${DIR}/release" - - echo "Removing SOURCE= from ${DIR}/release file, as Temurin builds from Adoptium mirror repo _adopt tag" - sed -i "" '/^SOURCE=.*$/d' "${DIR}/release" - else - echo "Removing Temurin specific lines from release file in $DIR" - sed -i '/^BUILD_SOURCE=.*$/d' "${DIR}/release" - sed -i '/^BUILD_SOURCE_REPO=.*$/d' "${DIR}/release" - sed -i '/^SOURCE_REPO=.*$/d' "${DIR}/release" - sed -i '/^FULL_VERSION=.*$/d' "${DIR}/release" - sed -i '/^SEMANTIC_VERSION=.*$/d' "${DIR}/release" - sed -i '/^BUILD_INFO=.*$/d' "${DIR}/release" - sed -i '/^JVM_VARIANT=.*$/d' "${DIR}/release" - sed -i '/^JVM_VERSION=.*$/d' "${DIR}/release" - sed -i '/^IMAGE_TYPE=.*$/d' "${DIR}/release" - - 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 @@ -467,23 +437,6 @@ function cleanTemurinFiles() { rm -rf "${DIR}/demo" } -# Temurin release file metadata BUILD_INFO/SOURCE can/will be different -function cleanTemurinBuildInfo() { - local DIR="$1" - - echo "Cleaning any Temurin build-scripts release file BUILD_INFO from ${DIR}" - - if [[ $(uname) =~ Darwin* ]]; then - sed -i "" '/^BUILD_SOURCE=.*$/d' "${DIR}/release" - sed -i "" '/^BUILD_SOURCE_REPO=.*$/d' "${DIR}/release" - sed -i "" '/^BUILD_INFO=.*$/d' "${DIR}/release" - else - sed -i '/^BUILD_SOURCE=.*$/d' "${DIR}/release" - sed -i '/^BUILD_SOURCE_REPO=.*$/d' "${DIR}/release" - sed -i '/^BUILD_INFO=.*$/d' "${DIR}/release" - fi -} - # Patch the Vendor strings from the BootJDK in jrt-fs/jar MANIFEST function patchManifests() { local JDK_DIR="$1" From f94bb2ac2f4f05bd58ad235f12011f662900bb47 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Wed, 4 Sep 2024 11:34:06 -0400 Subject: [PATCH 07/11] Remove extra debuginfo in aqa level Signed-off-by: Sophia Guo --- test/system/reproducibleCompare/reproducible.mk | 4 +++- tooling/reproducible/repro_common.sh | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) 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/repro_common.sh b/tooling/reproducible/repro_common.sh index 34b9903d2..34a262efa 100755 --- a/tooling/reproducible/repro_common.sh +++ b/tooling/reproducible/repro_common.sh @@ -335,11 +335,7 @@ function removeGeneratedClasses() { rm -rf "$JDK_DIR/bin/server/classes.jsa" rm -rf "$JDK_DIR/bin/server/classes_nocoops.jsa" rm -rf "$JDK_DIR/release" - rm -rf "$JDK_DIR/NOTICE" - - if [[ "$OS" =~ Linux ]]; then - find "$JDK_DIR/" -type f -name "*.debuginfo" -delete - fi + rm -rf "$JDK_DIR/NOTICE" } # Remove all Signatures From a94d65449d066369d8834003a059d6109a552c74 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Wed, 4 Sep 2024 11:50:00 -0400 Subject: [PATCH 08/11] Revert clean up Signed-off-by: Sophia Guo --- tooling/reproducible/repro_common.sh | 50 +++++++++++++++++++++++++-- tooling/reproducible/repro_process.sh | 2 +- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/tooling/reproducible/repro_common.sh b/tooling/reproducible/repro_common.sh index 34a262efa..7809ce6fe 100755 --- a/tooling/reproducible/repro_common.sh +++ b/tooling/reproducible/repro_common.sh @@ -330,12 +330,9 @@ function processModuleInfo() { # Remove non-relevant files function removeGeneratedClasses() { local JDK_DIR="$1" - local OS="$2" rm -rf "$JDK_DIR/bin/server/classes.jsa" rm -rf "$JDK_DIR/bin/server/classes_nocoops.jsa" - rm -rf "$JDK_DIR/release" - rm -rf "$JDK_DIR/NOTICE" } # Remove all Signatures @@ -424,6 +421,36 @@ function cleanTemurinFiles() { echo "Removing Temurin NOTICE file from $DIR" rm "${DIR}"/NOTICE + if [[ $(uname) =~ Darwin* ]]; then + echo "Removing Temurin specific lines from release file in $DIR" + sed -i "" '/^BUILD_SOURCE=.*$/d' "${DIR}/release" + sed -i "" '/^BUILD_SOURCE_REPO=.*$/d' "${DIR}/release" + sed -i "" '/^SOURCE_REPO=.*$/d' "${DIR}/release" + sed -i "" '/^FULL_VERSION=.*$/d' "${DIR}/release" + sed -i "" '/^SEMANTIC_VERSION=.*$/d' "${DIR}/release" + sed -i "" '/^BUILD_INFO=.*$/d' "${DIR}/release" + sed -i "" '/^JVM_VARIANT=.*$/d' "${DIR}/release" + sed -i "" '/^JVM_VERSION=.*$/d' "${DIR}/release" + sed -i "" '/^IMAGE_TYPE=.*$/d' "${DIR}/release" + + echo "Removing SOURCE= from ${DIR}/release file, as Temurin builds from Adoptium mirror repo _adopt tag" + sed -i "" '/^SOURCE=.*$/d' "${DIR}/release" + else + echo "Removing Temurin specific lines from release file in $DIR" + sed -i '/^BUILD_SOURCE=.*$/d' "${DIR}/release" + sed -i '/^BUILD_SOURCE_REPO=.*$/d' "${DIR}/release" + sed -i '/^SOURCE_REPO=.*$/d' "${DIR}/release" + sed -i '/^FULL_VERSION=.*$/d' "${DIR}/release" + sed -i '/^SEMANTIC_VERSION=.*$/d' "${DIR}/release" + sed -i '/^BUILD_INFO=.*$/d' "${DIR}/release" + sed -i '/^JVM_VARIANT=.*$/d' "${DIR}/release" + sed -i '/^JVM_VERSION=.*$/d' "${DIR}/release" + sed -i '/^IMAGE_TYPE=.*$/d' "${DIR}/release" + + 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 @@ -433,6 +460,23 @@ function cleanTemurinFiles() { rm -rf "${DIR}/demo" } +# Temurin release file metadata BUILD_INFO/SOURCE can/will be different +function cleanTemurinBuildInfo() { + local DIR="$1" + + echo "Cleaning any Temurin build-scripts release file BUILD_INFO from ${DIR}" + + if [[ $(uname) =~ Darwin* ]]; then + sed -i "" '/^BUILD_SOURCE=.*$/d' "${DIR}/release" + sed -i "" '/^BUILD_SOURCE_REPO=.*$/d' "${DIR}/release" + sed -i "" '/^BUILD_INFO=.*$/d' "${DIR}/release" + else + sed -i '/^BUILD_SOURCE=.*$/d' "${DIR}/release" + sed -i '/^BUILD_SOURCE_REPO=.*$/d' "${DIR}/release" + sed -i '/^BUILD_INFO=.*$/d' "${DIR}/release" + fi +} + # Patch the Vendor strings from the BootJDK in jrt-fs/jar MANIFEST function patchManifests() { local JDK_DIR="$1" diff --git a/tooling/reproducible/repro_process.sh b/tooling/reproducible/repro_process.sh index d63373cae..ea01a5afe 100755 --- a/tooling/reproducible/repro_process.sh +++ b/tooling/reproducible/repro_process.sh @@ -23,7 +23,7 @@ OS="$2" expandJDK "$JDK_DIR" "$OS" -removeGeneratedClasses "$JDK_DIR" "$OS" +removeGeneratedClasses "$JDK_DIR" if [[ "$OS" =~ CYGWIN* ]] || [[ "$OS" =~ Darwin* ]]; then # Remove existing signature From 9f17fa95861c176eb1d64caa8115e3959ee7e40c Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Wed, 4 Sep 2024 14:39:19 -0400 Subject: [PATCH 09/11] Update exclude lists Signed-off-by: Sophia Guo --- .../reproducible/linux_repro_build_compare.sh | 6 ++-- tooling/reproducible/repro_common.sh | 28 +++++++++++-------- tooling/reproducible/repro_process.sh | 4 +-- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/tooling/reproducible/linux_repro_build_compare.sh b/tooling/reproducible/linux_repro_build_compare.sh index 53a9c5d3b..9c2957e54 100755 --- a/tooling/reproducible/linux_repro_build_compare.sh +++ b/tooling/reproducible/linux_repro_build_compare.sh @@ -188,7 +188,7 @@ elif [[ $JDK_PARAM =~ tar.gz ]]; then tar xpfz "$JDK_PARAM" --strip-components=1 -C "$PWD/jdk-${TEMURIN_VERSION}" else #Local jdk dir - cp -R ${JDK_PARAM}/* ${sourceJDK} + cp -R "${JDK_PARAM}"/* "${sourceJDK}" fi echo "Rebuild args for makejdk_any_platform.sh are: $TEMURIN_BUILD_ARGS" @@ -204,9 +204,7 @@ cp "$ScriptPath"/repro_*.sh "$PWD" chmod +x "$PWD"/repro_*.sh rc=0 set +e -echo "./repro_compare.sh temurin $sourceJDK temurin tarJDK Linux 2>&1" | sh & -wait -rc=$? +./repro_compare.sh temurin $sourceJDK temurin tarJDK/jdk-$TEMURIN_VERSION Linux 2>&1 || rc=$? set -e if [ $rc -eq 0 ]; then diff --git a/tooling/reproducible/repro_common.sh b/tooling/reproducible/repro_common.sh index 7809ce6fe..adefcb062 100755 --- a/tooling/reproducible/repro_common.sh +++ b/tooling/reproducible/repro_common.sh @@ -327,12 +327,24 @@ function processModuleInfo() { fi } -# Remove non-relevant files -function removeGeneratedClasses() { +# Remove excluded files known to differ +# NOTICE - Vendor specfic notice text file +# cacerts - Vendors use different cacerts +# classlist - Used to generate CDS archives, can vary due to different build machine environment +# classes.jsa, classes_nocoops.jsa - CDS archive caches will differ due to Vendor string differences +function removeExcludedFiles() { local JDK_DIR="$1" - - rm -rf "$JDK_DIR/bin/server/classes.jsa" - rm -rf "$JDK_DIR/bin/server/classes_nocoops.jsa" + excluded="NOTICE cacerts classlist classes.jsa classes_nocoops.jsa" + echo "Removing excluded files known to differ: ${excluded}" + for exclude in $excluded + do + FILES=$(find "${JDK_DIR}" -type f -name "$exclude") + for f in $FILES + do + echo "Removing $f" + rm -f "$f" + done + done } # Remove all Signatures @@ -418,9 +430,6 @@ function cleanTemurinFiles() { echo "Cleaning Temurin build-scripts specific files and metadata from ${DIR}" - echo "Removing Temurin NOTICE file from $DIR" - rm "${DIR}"/NOTICE - if [[ $(uname) =~ Darwin* ]]; then echo "Removing Temurin specific lines from release file in $DIR" sed -i "" '/^BUILD_SOURCE=.*$/d' "${DIR}/release" @@ -451,9 +460,6 @@ function cleanTemurinFiles() { 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 - echo "Removing any JDK image files not shipped by Temurin(*.pdb, *.pdb, demo) in $DIR" find "${DIR}" -type f -name "*.pdb" -delete find "${DIR}" -type f -name "*.map" -delete diff --git a/tooling/reproducible/repro_process.sh b/tooling/reproducible/repro_process.sh index ea01a5afe..e991681f4 100755 --- a/tooling/reproducible/repro_process.sh +++ b/tooling/reproducible/repro_process.sh @@ -23,7 +23,7 @@ OS="$2" expandJDK "$JDK_DIR" "$OS" -removeGeneratedClasses "$JDK_DIR" +removeExcludedFiles "$JDK_DIR" if [[ "$OS" =~ CYGWIN* ]] || [[ "$OS" =~ Darwin* ]]; then # Remove existing signature @@ -39,6 +39,6 @@ fi patchManifests "${JDK_DIR}" echo "***********" -echo "SUCCESS :-)" +echo " Preprocess ${JDK_DIR} SUCCESS :-)" echo "***********" From 1f9c37622587c521f59cd1f6cb06ba092259c40f Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Wed, 4 Sep 2024 16:25:18 -0400 Subject: [PATCH 10/11] Linter issue Signed-off-by: Sophia Guo --- tooling/reproducible/linux_repro_build_compare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/reproducible/linux_repro_build_compare.sh b/tooling/reproducible/linux_repro_build_compare.sh index 9c2957e54..da41e6d4f 100755 --- a/tooling/reproducible/linux_repro_build_compare.sh +++ b/tooling/reproducible/linux_repro_build_compare.sh @@ -204,7 +204,7 @@ cp "$ScriptPath"/repro_*.sh "$PWD" chmod +x "$PWD"/repro_*.sh rc=0 set +e -./repro_compare.sh temurin $sourceJDK temurin tarJDK/jdk-$TEMURIN_VERSION Linux 2>&1 || rc=$? +./repro_compare.sh temurin "$sourceJDK" temurin tarJDK/jdk-"$TEMURIN_VERSION" Linux 2>&1 || rc=$? set -e if [ $rc -eq 0 ]; then From 04d67d2d98eac37ec3a635bffb8221cdcfc45d09 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Thu, 5 Sep 2024 09:23:47 -0400 Subject: [PATCH 11/11] Revert some changes Signed-off-by: Sophia Guo --- .../reproducible/linux_repro_build_compare.sh | 2 +- tooling/reproducible/repro_common.sh | 30 ++++++++----------- tooling/reproducible/repro_process.sh | 2 +- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/tooling/reproducible/linux_repro_build_compare.sh b/tooling/reproducible/linux_repro_build_compare.sh index da41e6d4f..1aceb48d3 100755 --- a/tooling/reproducible/linux_repro_build_compare.sh +++ b/tooling/reproducible/linux_repro_build_compare.sh @@ -187,7 +187,7 @@ if [[ $JDK_PARAM =~ ^https?:// ]]; then elif [[ $JDK_PARAM =~ tar.gz ]]; then tar xpfz "$JDK_PARAM" --strip-components=1 -C "$PWD/jdk-${TEMURIN_VERSION}" else - #Local jdk dir + # Local jdk dir cp -R "${JDK_PARAM}"/* "${sourceJDK}" fi diff --git a/tooling/reproducible/repro_common.sh b/tooling/reproducible/repro_common.sh index adefcb062..4e3bf8bce 100755 --- a/tooling/reproducible/repro_common.sh +++ b/tooling/reproducible/repro_common.sh @@ -327,24 +327,15 @@ function processModuleInfo() { fi } -# Remove excluded files known to differ -# NOTICE - Vendor specfic notice text file -# cacerts - Vendors use different cacerts -# classlist - Used to generate CDS archives, can vary due to different build machine environment -# classes.jsa, classes_nocoops.jsa - CDS archive caches will differ due to Vendor string differences -function removeExcludedFiles() { +# Remove windowns generate classes jdk/bin/server/classes.jsa & jdk/bin/server/classes_nocoops.jsa +function removeGeneratedClasses() { local JDK_DIR="$1" - excluded="NOTICE cacerts classlist classes.jsa classes_nocoops.jsa" - echo "Removing excluded files known to differ: ${excluded}" - for exclude in $excluded - do - FILES=$(find "${JDK_DIR}" -type f -name "$exclude") - for f in $FILES - do - echo "Removing $f" - rm -f "$f" - done - done + local OS="$2" + + if [[ "$OS" =~ CYGWIN* ]] || [[ "$OS" =~ Darwin* ]]; then + rm -rf "$JDK_DIR/bin/server/classes.jsa" + rm -rf "$JDK_DIR/bin/server/classes_nocoops.jsa" + fi } # Remove all Signatures @@ -429,6 +420,8 @@ 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 if [[ $(uname) =~ Darwin* ]]; then echo "Removing Temurin specific lines from release file in $DIR" @@ -459,6 +452,9 @@ 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 echo "Removing any JDK image files not shipped by Temurin(*.pdb, *.pdb, demo) in $DIR" find "${DIR}" -type f -name "*.pdb" -delete diff --git a/tooling/reproducible/repro_process.sh b/tooling/reproducible/repro_process.sh index e991681f4..92b246f2a 100755 --- a/tooling/reproducible/repro_process.sh +++ b/tooling/reproducible/repro_process.sh @@ -23,7 +23,7 @@ OS="$2" expandJDK "$JDK_DIR" "$OS" -removeExcludedFiles "$JDK_DIR" +removeGeneratedClasses "$JDK_DIR" "$OS" if [[ "$OS" =~ CYGWIN* ]] || [[ "$OS" =~ Darwin* ]]; then # Remove existing signature