Skip to content

Commit

Permalink
Move compare process to common script
Browse files Browse the repository at this point in the history
Signed-off-by: Sophia Guo <sophia.gwf@gmail.com>
  • Loading branch information
sophia-guo committed Aug 21, 2024
1 parent b86f609 commit b7c12b3
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions tooling/reproducible/linux_repro_build_compare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit b7c12b3

Please sign in to comment.