Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update reproducible comparing on linux #3921

Merged
merged 11 commits into from
Sep 6, 2024
Prev Previous commit
Revert some changes
Signed-off-by: Sophia Guo <sophia.gwf@gmail.com>
sophia-guo committed Sep 5, 2024
commit 04d67d2d98eac37ec3a635bffb8221cdcfc45d09
2 changes: 1 addition & 1 deletion tooling/reproducible/linux_repro_build_compare.sh
Original file line number Diff line number Diff line change
@@ -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

30 changes: 13 additions & 17 deletions tooling/reproducible/repro_common.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tooling/reproducible/repro_process.sh
Original file line number Diff line number Diff line change
@@ -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