Skip to content

Commit

Permalink
No need to unzip jdk as repro_process.sh is called
Browse files Browse the repository at this point in the history
Signed-off-by: Sophia Guo <[email protected]>
  • Loading branch information
sophia-guo committed May 10, 2024
1 parent d10020f commit a2be8ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 36 deletions.
3 changes: 2 additions & 1 deletion test/system/reproducibleCompare/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
</test>
<test>
<testCaseName>Rebuild_Same_JDK_Reproducibility_Test_win</testCaseName>
<command>$(TEST_ROOT)$(D)system$(D)reproducibleCompare$(D)windows_repro_build_compare.sh $(SBOM_FILE) $(JDK_FILE); \
<command>ls $(TEST_ROOT)$(D)system$(D)reproducibleCompare$(D); \
$(TEST_ROOT)$(D)system$(D)reproducibleCompare$(D)windows_repro_build_compare.sh $(SBOM_FILE) $(JDK_FILE); \
$(TEST_STATUS)
</command>
<levels>
Expand Down
46 changes: 11 additions & 35 deletions tooling/reproducible/windows_repro_build_compare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -670,37 +670,10 @@ Build_JDK() {
Compare_JDK() {
echo "Comparing JDKs"
echo ""
cd "$WORK_DIR"
# Unzip And Rename The Source JDK
echo "Unzip Source"
unzip -q -o src_jdk_dist.zip
original_directory_name=$(find . -maxdepth 1 -type d | tail -1)
mv "$original_directory_name" src_jdk

#Unzip And Rename The Target JDK
echo "Unzip Target"
unzip -q -o reproJDK.zip
original_directory_name=$(find . -maxdepth 1 -type d | grep -v src_jdk | tail -1)
mv "$original_directory_name" tar_jdk

# These Two Files Are Generate Classes And Should Be Removed Prior To Running The Comparison
# jdk/bin/server/classes.jsa & jdk/bin/server/classes_nocoops.jsa

if [ -f "$WORK_DIR/src_jdk/bin/server/classes.jsa" ] ; then
rm -rf "$WORK_DIR/src_jdk/bin/server/classes.jsa"
fi

if [ -f "$WORK_DIR/tar_jdk/bin/server/classes.jsa" ] ; then
rm -rf "$WORK_DIR/tar_jdk/bin/server/classes.jsa"
fi

if [ -f "$WORK_DIR/src_jdk/bin/server/classes_nocoops.jsa" ] ; then
rm -rf "$WORK_DIR/src_jdk/bin/server/classes_nocoops.jsa"
fi

if [ -f "$WORK_DIR/tar_jdk/bin/server/classes_nocoops.jsa" ] ; then
rm -rf "$WORK_DIR/tar_jdk/bin/server/classes_nocoops.jsa"
fi
# should move to repro_common.sh

# Ensure Signtool Is In The Path
TOOLCOUNT=$(find "$SIGNTOOL_BASE" | grep $msvsArch | grep -ic "signtool.exe$")
Expand Down Expand Up @@ -733,26 +706,29 @@ Compare_JDK() {

CPW=$(cygpath -u "$SIGNPATHWIN")
export PATH="$PATH:$CPW"


mkdir "$WORK_DIR/src_jdk"
mkdir "$WORK_DIR/tar_jdk"
cp "$WORK_DIR/src_jdk_dist.zip" "$WORK_DIR/src_jdk"
cp "$WORK_DIR/reproJDK.zip" "$WORK_DIR/tar_jdk"
# Run Comparison Script
echo "cd $WORK_DIR && $ScriptPath/repro_compare.sh temurin src_jdk temurin tar_jdk CYGWIN 2>&1" | sh &
echo "cd $ScriptPath && ./repro_compare.sh temurin $WORK_DIR/src_jdk temurin $WORK_DIR/tar_jdk CYGWIN 2>&1" | sh &
wait

# Display The Content Of reprotest.diff
echo ""
echo "---------------------------------------------"
echo "Output From JDK Comparison Script"
echo "---------------------------------------------"
cat "$WORK_DIR/reprotest.diff"
cat "$ScriptPath/reprotest.diff"
echo ""
echo "---------------------------------------------"
echo "Copying Output To $(dirname "$0")"

if [ -z "$REPORT_DIR" ]; then
REPORT_DIR="$ScriptPath"
if [ -n "$REPORT_DIR" ]; then
cp "$ScriptPath/reprotest.diff" "$REPORT_DIR"
cp "$WORK_DIR/reproJDK.zip" "$REPORT_DIR"
fi
cp "$WORK_DIR/reprotest.diff" "$REPORT_DIR"
cp "$WORK_DIR/reproJDK.zip" "$REPORT_DIR"
}

Clean_Up_Everything() {
Expand Down

0 comments on commit a2be8ce

Please sign in to comment.