8220530: Build compare script does not compare the contents of the test image

Reviewed-by: tbell
This commit is contained in:
Erik Joelsson 2019-03-28 08:37:05 -07:00
parent 47b9d898ab
commit 5031959c88
3 changed files with 95 additions and 135 deletions

View File

@ -755,7 +755,11 @@ var getJibProfilesProfiles = function (input, common, data) {
profiles[cmpBaselineName] = clone(profiles[name + suffix]);
// Only compare the images target. This should pressumably be expanded
// to include more build targets when possible.
profiles[cmpBaselineName].default_make_targets = [ "images" ];
profiles[cmpBaselineName].default_make_targets = [ "images", "test-image" ];
if (name == "linux-x64") {
profiles[cmpBaselineName].default_make_targets
= concat(profiles[cmpBaselineName].default_make_targets, "docs");
}
profiles[cmpBaselineName].make_args = [ "COMPARE_BUILD=CONF=" ];
// Do not inherit artifact definitions from base profile
delete profiles[cmpBaselineName].artifacts;

View File

@ -212,6 +212,11 @@ diff_text() {
$SED -e '/[<>] <!-- Generated by javadoc .* on .* -->/d' \
-e '/[<>] <meta name="date" content=".*">/d' )
fi
if test "$NAME" = "BenchmarkList"; then
$SORT $THIS_FILE > $THIS_FILE.sorted
$SORT $OTHER_FILE > $OTHER_FILE.sorted
TMP=$($DIFF $THIS_FILE.sorted $OTHER_FILE.sorted)
fi
if test -n "$TMP"; then
echo Files $OTHER_FILE and $THIS_FILE differ
return 1
@ -382,17 +387,19 @@ compare_general_files() {
! -name "*.zip" ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
! -name "modules" ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \
! -name "*.cpl" ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \
! -name "*.lib" ! -name "*.war" ! -name "JavaControlPanel" ! -name "*.jmod" \
! -name "*.obj" ! -name "*.o" ! -name "JavaControlPanelHelper" \
! -name "JavaUpdater" ! -name "JavaWSApplicationStub" \
! -name "jspawnhelper" ! -name "JavawsLauncher" ! -name "*.a" \
! -name "finish_installation" ! -name "Sparkle" ! -name "*.tar.gz" \
! -name "classes.jsa" \
! -name "*.lib" ! -name "*.war" ! -name "*.jmod" ! -name "*.exe" \
! -name "*.obj" ! -name "*.o" ! -name "jspawnhelper" ! -name "*.a" \
! -name "*.tar.gz" ! -name "classes.jsa" ! -name "gtestLauncher" \
! -name "*.map" \
| $GREP -v "./bin/" | $SORT | $FILTER)
echo Other files with binary differences...
for f in $GENERAL_FILES
do
# Skip all files in test/*/native
if [[ "$f" == */native/* ]]; then
continue
fi
if [ -e $OTHER_DIR/$f ]; then
SUFFIX="${f##*.}"
if [ "$(basename $f)" = "release" ]; then
@ -431,7 +438,7 @@ compare_general_files() {
$CAT $OTHER_DIR/$f | eval "$HTML_FILTER" > $OTHER_FILE &
$CAT $THIS_DIR/$f | eval "$HTML_FILTER" > $THIS_FILE &
wait
elif [[ "$f" = *"/lib/classlist" ]]; then
elif [[ "$f" = *"/lib/classlist" ]] || [ "$SUFFIX" = "jar_contents" ]; then
# The classlist files may have some lines in random order
OTHER_FILE=$WORK_DIR/$f.other
THIS_FILE=$WORK_DIR/$f.this
@ -792,7 +799,6 @@ compare_bin_file() {
export _NT_SYMBOL_PATH="$(echo $PDB_DIRS | tr ' ' ';')"
fi
if [ -z "$SKIP_BIN_DIFF" ]; then
if cmp $OTHER_FILE $THIS_FILE > /dev/null; then
# The files were bytewise identical.
if [ -n "$VERBOSE" ]; then
@ -800,6 +806,7 @@ compare_bin_file() {
fi
return 0
fi
if [ -z "$SKIP_BIN_DIFF" ]; then
BIN_MSG=" diff "
if [[ "$ACCEPTED_BIN_DIFF" != *"$BIN_FILE"* ]]; then
DIFF_BIN=true
@ -826,7 +833,8 @@ compare_bin_file() {
DIFF_SIZE_NUM=$($EXPR $THIS_SIZE - $OTHER_SIZE)
DIFF_SIZE_REL=$($EXPR $THIS_SIZE \* 100 / $OTHER_SIZE)
SIZE_MSG=$($PRINTF "%3d%% %4d" $DIFF_SIZE_REL $DIFF_SIZE_NUM)
if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] && [ "$DIFF_SIZE_REL" -gt 98 ] \
if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* || "$ACCEPTED_SMALL_SIZE_DIFF" = "true" ]] \
&& [ "$DIFF_SIZE_REL" -gt 98 ] \
&& [ "$DIFF_SIZE_REL" -lt 102 ]; then
SIZE_MSG="($SIZE_MSG)"
DIFF_SIZE=
@ -1440,13 +1448,8 @@ if [ "$SKIP_DEFAULT" != "true" ]; then
echo
fi
# Find the common images to compare, prioritizing later build stages
if [ -d "$THIS/install/jdk" ] && [ -d "$OTHER/install/jdk" ]; then
THIS_JDK="$THIS/install/jdk"
OTHER_JDK="$OTHER/install/jdk"
echo "Selecting install images for JDK compare"
elif [ -d "$THIS/images/jdk" ] && [ -d "$OTHER/images/jdk" ]; then
if [ -d "$THIS/images/jdk" ] && [ -d "$OTHER/images/jdk" ]; then
THIS_JDK="$THIS/images/jdk"
OTHER_JDK="$OTHER/images/jdk"
echo "Selecting normal images for JDK compare"
@ -1491,47 +1494,6 @@ if [ "$SKIP_DEFAULT" != "true" ]; then
echo " $OTHER_JDK_BUNDLE"
fi
if [ -d "$THIS/deploy/bundles" -o -d "$THIS/deploy/images/bundles" ] \
&& [ -d "$OTHER/deploy/bundles" -o -d "$OTHER/deploy/images/bundles" ]; then
if [ -d "$THIS/deploy/images/bundles" ]; then
THIS_DEPLOY_BUNDLE_DIR="$THIS/deploy/images/bundles"
else
THIS_DEPLOY_BUNDLE_DIR="$THIS/deploy/bundles"
fi
if [ -d "$OTHER/deploy/images/bundles" ]; then
OTHER_DEPLOY_BUNDLE_DIR="$OTHER/deploy/images/bundles"
else
OTHER_DEPLOY_BUNDLE_DIR="$OTHER/deploy/bundles"
fi
echo "Also comparing deploy javadoc bundles"
fi
if [ -d "$THIS/images/JavaAppletPlugin.plugin" ] \
&& [ -d "$OTHER/images/JavaAppletPlugin.plugin" -o -d "$OTHER/deploy/images/JavaAppletPlugin.plugin" ]; then
if [ -d "$THIS/images/JavaAppletPlugin.plugin" ]; then
THIS_DEPLOY_APPLET_PLUGIN_DIR="$THIS/images/JavaAppletPlugin.plugin"
else
THIS_DEPLOY_APPLET_PLUGIN_DIR="$THIS/deploy/images/JavaAppletPlugin.plugin"
fi
if [ -d "$OTHER/images/JavaAppletPlugin.plugin" ]; then
OTHER_DEPLOY_APPLET_PLUGIN_DIR="$OTHER/images/JavaAppletPlugin.plugin"
else
OTHER_DEPLOY_APPLET_PLUGIN_DIR="$OTHER/deploy/images/JavaAppletPlugin.plugin"
fi
echo "Also comparing deploy applet image"
echo " $THIS_DEPLOY_APPLET_PLUGIN_DIR"
echo " $OTHER_DEPLOY_APPLET_PLUGIN_DIR"
fi
if [ -d "$THIS/install/sparkle/Sparkle.framework" ] \
&& [ -d "$OTHER/install/sparkle/Sparkle.framework" ]; then
THIS_SPARKLE_DIR="$THIS/install/sparkle/Sparkle.framework"
OTHER_SPARKLE_DIR="$OTHER/install/sparkle/Sparkle.framework"
echo "Also comparing install sparkle framework"
echo " $THIS_SPARKLE_DIR"
echo " $OTHER_SPARKLE_DIR"
fi
THIS_SEC_DIR="$THIS/images"
OTHER_SEC_DIR="$OTHER/images"
if [ -f "$THIS_SEC_DIR/sec-bin.zip" ] && [ -f "$OTHER_SEC_DIR/sec-bin.zip" ]; then
@ -1557,6 +1519,14 @@ if [ "$SKIP_DEFAULT" != "true" ]; then
else
echo "WARNING! Docs haven't been built and won't be compared."
fi
if [ -d "$THIS/images/test" ] && [ -d "$OTHER/images/test" ]; then
THIS_TEST="$THIS/images/test"
OTHER_TEST="$OTHER/images/test"
echo "Also comparing test image"
else
echo "WARNING! Test haven't been built and won't be compared."
fi
fi
################################################################################
@ -1582,22 +1552,16 @@ if [ "$CMP_NAMES" = "true" ]; then
echo -n "Docs "
compare_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
fi
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
echo -n "Test "
compare_dirs $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
echo -n "Test "
compare_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
fi
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
compare_dirs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
compare_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
fi
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
echo -n "JavaAppletPlugin "
compare_dirs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
echo -n "JavaAppletPlugin "
compare_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
fi
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
echo -n "Sparkle.framework "
compare_dirs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
echo -n "Sparkle.framework "
compare_files $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
fi
fi
if [ "$CMP_LIBS" = "true" ]; then
@ -1605,34 +1569,38 @@ if [ "$CMP_LIBS" = "true" ]; then
echo -n "JDK "
compare_all_libs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
fi
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
echo -n "Test "
# Test native libs are never stripped so will not compare well.
SKIP_BIN_DIFF="true"
ACCEPTED_SMALL_SIZE_DIFF_bak="$ACCEPTED_SMALL_SIZE_DIFF"
if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
ACCEPTED_SMALL_SIZE_DIFF="true"
fi
compare_all_libs $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
SKIP_BIN_DIFF="false"
ACCEPTED_SMALL_SIZE_DIFF="$ACCEPTED_SMALL_SIZE_DIFF_bak"
fi
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
compare_all_libs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
fi
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
echo -n "JavaAppletPlugin "
compare_all_libs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
fi
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
echo -n "Sparkle.framework "
compare_all_libs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
fi
fi
if [ "$CMP_EXECS" = "true" ]; then
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
echo -n "JDK "
compare_all_execs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
fi
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
echo -n "Test "
# Test native executables are never stripped so will not compare well.
SKIP_BIN_DIFF="true"
compare_all_execs $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
SKIP_BIN_DIFF="false"
fi
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
compare_all_execs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
fi
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
echo -n "JavaAppletPlugin "
compare_all_execs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
fi
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
echo -n "Sparkle.framework "
compare_all_execs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
fi
fi
if [ "$CMP_GENERAL" = "true" ]; then
@ -1648,23 +1616,24 @@ if [ "$CMP_GENERAL" = "true" ]; then
echo -n "Docs "
compare_general_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs
fi
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
echo -n "Test "
compare_general_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
fi
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
compare_general_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
fi
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
echo -n "JavaAppletPlugin "
compare_general_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
fi
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
echo -n "Sparkle.framework "
compare_general_files $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
fi
fi
if [ "$CMP_ZIPS" = "true" ]; then
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
echo -n "JDK "
compare_all_zip_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
fi
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
echo -n "Test "
compare_all_zip_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
fi
if [ -n "$THIS_SEC_BIN" ] && [ -n "$OTHER_SEC_BIN" ]; then
if [ -n "$(echo $THIS_SEC_BIN | $FILTER)" ]; then
echo "sec-bin.zip..."
@ -1686,24 +1655,20 @@ if [ "$CMP_ZIPS" = "true" ]; then
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
compare_all_zip_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
fi
if [ -n "$THIS_DEPLOY_BUNDLE_DIR" ] && [ -n "$OTHER_DEPLOY_BUNDLE_DIR" ]; then
compare_all_zip_files $THIS_DEPLOY_BUNDLE_DIR $OTHER_DEPLOY_BUNDLE_DIR $COMPARE_ROOT/deploy-bundle
fi
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
compare_all_zip_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
fi
fi
if [ "$CMP_JARS" = "true" ]; then
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then
echo -n "JDK "
compare_all_jar_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
fi
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
echo -n "Test "
compare_all_jar_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test
fi
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
compare_all_jar_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
fi
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
compare_all_jar_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
fi
fi
if [ "$CMP_JMODS" = "true" ]; then
@ -1723,14 +1688,6 @@ if [ "$CMP_PERMS" = "true" ]; then
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
compare_permissions $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
fi
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
echo -n "JavaAppletPlugin "
compare_permissions $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
fi
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
echo -n "Sparkle.framework "
compare_permissions $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
fi
fi
if [ "$CMP_TYPES" = "true" ]; then
@ -1742,17 +1699,13 @@ if [ "$CMP_TYPES" = "true" ]; then
echo -n "JDK Bundle "
compare_file_types $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle
fi
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then
echo -n "Test "
compare_file_types $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk
fi
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then
compare_file_types $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir
fi
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then
echo -n "JavaAppletPlugin "
compare_file_types $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin
fi
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then
echo -n "Sparkle.framework "
compare_file_types $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle
fi
fi
echo

View File

@ -38,6 +38,7 @@ fi
if [ "$OPENJDK_TARGET_OS" = "linux" ]; then
ACCEPTED_BIN_DIFF="
./lib/server/libjvm.so
./hotspot/gtest/server/libjvm.so
"
elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
SKIP_BIN_DIFF="true"
@ -49,6 +50,7 @@ elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
./lib/libunpack.so
./lib/server/libjvm.so
./bin/unpack200
./hotspot/gtest/server/libjvm.so
"
KNOWN_DIS_DIFF="
./lib/libfontmanager.so
@ -68,5 +70,6 @@ elif [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
./lib/libosxapp.dylib
./lib/libosxui.dylib
./lib/server/libjvm.dylib
./hotspot/gtest/server/libjvm.dylib
"
fi