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 "***********"