Skip to content

Commit

Permalink
Testing
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 22, 2024
1 parent 7de40f0 commit 2eee94c
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions tooling/reproducible/linux_repro_build_compare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ ANT_VERSION=1.10.5
ANT_SHA=9028e2fc64491cca0f991acc09b06ee7fe644afe41d1d6caf72702ca25c4613c
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 @@ -180,42 +180,31 @@ if [ -z "$JDK_PARAM" ] && [ ! -d "jdk-${TEMURIN_VERSION}" ] ; then
JDK_PARAM="https://api.adoptium.net/v3/binary/version/jdk-${TEMURIN_VERSION}/linux/${NATIVE_API_ARCH}/jdk/hotspot/normal/eclipse?project=jdk"
fi

sourceJDK="jdk-${TEMURIN_VERSION}"
mkdir "${sourceJDK}"
if [[ $JDK_PARAM =~ ^https?:// ]]; then
echo Retrieving original tarball from adoptium.net && curl -L "$JDK_PARAM" | tar xpfz - && ls -lart "$PWD/jdk-${TEMURIN_VERSION}" || exit 1
elif [[ $JDK_PARAM =~ tar.gz ]]; then
mkdir "$PWD/jdk-${TEMURIN_VERSION}"
tar xpfz "$JDK_PARAM" --strip-components=1 -C "$PWD/jdk-${TEMURIN_VERSION}"
else
echo "Local jdk dir"
isJdkDir=true
fi

comparedDir="jdk-${TEMURIN_VERSION}"
if [ "${isJdkDir}" = true ]; then
comparedDir=$JDK_PARAM
#Local jdk dir
cp -R ${JDK_PARAM}/* ${sourceJDK}
fi

echo "Rebuild args for makejdk_any_platform.sh are: $TEMURIN_BUILD_ARGS"
#Testing disable build
# echo " cd temurin-build && ./makejdk-any-platform.sh $TEMURIN_BUILD_ARGS 2>&1 | tee build.$$.log" | sh
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 tarJDK
tar xpfz temurin-build/workspace/target/OpenJDK*-jdk_*tar.gz -C tarJDK
cp temurin-build/workspace/target/OpenJDK*-jdk_*tar.gz reproJDK.tar.gz
cp "$SBOM" SBOM.json

cp "$ScriptPath"/repro_*.sh "$PWD"
echo "under script path
files permission"
ls -l "$ScriptPath"
echo "files permission"
ls -l
chmod +x "$PWD"/repro_*.sh
rc=0
set +e

#Testing disable compare#
#echo "./repro_compare.sh temurin $comparedDir/ temurin compare/ Linux 2>&1" | sh &
echo "./repro_compare.sh temurin $sourceJDK temurin tarJDK Linux 2>&1" | sh &
wait
rc=$?
set -e
Expand Down

0 comments on commit 2eee94c

Please sign in to comment.