From b6cb0f0a49974b8bc125e1ff7200c830641cb713 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Thu, 5 Sep 2024 09:23:47 -0400 Subject: [PATCH] Revert some changes Signed-off-by: Sophia Guo --- tooling/reproducible/repro_common.sh | 37 ++++++++++----------------- tooling/reproducible/repro_process.sh | 2 +- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/tooling/reproducible/repro_common.sh b/tooling/reproducible/repro_common.sh index adefcb062..b41083fdc 100755 --- a/tooling/reproducible/repro_common.sh +++ b/tooling/reproducible/repro_common.sh @@ -244,12 +244,6 @@ function removeMacOSNonComparableData() { echo "Successfully removed all MacOS dylib non-comparable UUID from ${JDK_DIR}" } -# Normalize the following ModuleAttributes that can be ordered differently -# depending on how the vendor has signed and re-packed the JMODs -# - ModuleResolution: -# - ModuleTarget: -# java.base also requires the dependent module "hash:" values to be excluded -# as they differ due to the Signatures function processModuleInfo() { if [[ "$OS" =~ CYGWIN* ]] || [[ "$OS" =~ Darwin* ]]; then echo "Normalizing ModuleAttributes order in module-info.class, converting to javap" @@ -327,24 +321,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 +414,9 @@ 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 +447,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