From b7c12b354bbe2d3a4113a7347a6ee1008e24affc Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Wed, 21 Aug 2024 16:20:32 -0400 Subject: [PATCH] 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