author | chegar |
Thu, 17 Oct 2019 20:27:44 +0100 | |
branch | datagramsocketimpl-branch |
changeset 58677 | 13588c901957 |
parent 55018 | ecb7b9a98f0e |
child 58035 | 378007c18687 |
child 58678 | 9cf78a70fa4f |
permissions | -rw-r--r-- |
14111 | 1 |
#!/bin/bash |
2 |
# |
|
48912 | 3 |
# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. |
14111 | 4 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 |
# |
|
6 |
# This code is free software; you can redistribute it and/or modify it |
|
7 |
# under the terms of the GNU General Public License version 2 only, as |
|
8 |
# published by the Free Software Foundation. |
|
9 |
# |
|
10 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
11 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
14 |
# accompanied this code). |
|
15 |
# |
|
16 |
# You should have received a copy of the GNU General Public License version |
|
17 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
18 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
19 |
# |
|
20 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
21 |
# or visit www.oracle.com if you need additional information or have any |
|
22 |
# questions. |
|
23 |
# |
|
24 |
||
28356 | 25 |
# This script is processed by configure before it's usable. It is run from |
14111 | 26 |
# the root of the build directory. |
27 |
||
28 |
||
29157 | 29 |
################################################################################ |
14111 | 30 |
|
31 |
# Check that we are run via the wrapper generated by configure |
|
47252 | 32 |
if [ -z "$TOPDIR" ]; then |
14111 | 33 |
echo "Error: You must run this script using build/[conf]/compare.sh" |
34 |
exit 1 |
|
35 |
fi |
|
36 |
||
37 |
if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then |
|
29157 | 38 |
FULLDUMP_CMD="$OTOOL -v -V -h -X -d" |
14111 | 39 |
LDD_CMD="$OTOOL -L" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
40 |
DIS_CMD="$OTOOL -v -V -t" |
14111 | 41 |
STAT_PRINT_SIZE="-f %z" |
42 |
elif [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
|
43 |
FULLDUMP_CMD="$DUMPBIN -all" |
|
37032
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
44 |
LDD_CMD="$DUMPBIN -dependents" |
14111 | 45 |
DIS_CMD="$DUMPBIN -disasm:nobytes" |
46 |
STAT_PRINT_SIZE="-c %s" |
|
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
47 |
elif [ "$OPENJDK_TARGET_OS" = "aix" ]; then |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
48 |
FULLDUMP_CMD="dump -h -r -t -n -X64" |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
49 |
LDD_CMD="$LDD" |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
50 |
DIS_CMD="$OBJDUMP -d" |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
51 |
STAT_PRINT_SIZE="-c %s" |
14111 | 52 |
else |
53 |
FULLDUMP_CMD="$READELF -a" |
|
54 |
LDD_CMD="$LDD" |
|
55 |
DIS_CMD="$OBJDUMP -d" |
|
56 |
STAT_PRINT_SIZE="-c %s" |
|
57 |
fi |
|
58 |
||
47252 | 59 |
COMPARE_EXCEPTIONS_INCLUDE="$TOPDIR/make/scripts/compare_exceptions.sh.incl" |
14111 | 60 |
if [ ! -e "$COMPARE_EXCEPTIONS_INCLUDE" ]; then |
61 |
echo "Error: Cannot locate the exceptions file, it should have been here: $COMPARE_EXCEPTIONS_INCLUDE" |
|
62 |
exit 1 |
|
63 |
fi |
|
64 |
# Include exception definitions |
|
65 |
. "$COMPARE_EXCEPTIONS_INCLUDE" |
|
66 |
||
29157 | 67 |
################################################################################ |
51781 | 68 |
# |
69 |
# Disassembly diff filters. These filters try to filter out ephemeral parts of the |
|
70 |
# disassembly, such as hard-coded addresses, to be able to catch "actual" differences. |
|
71 |
||
72 |
if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then |
|
73 |
if [ "$OPENJDK_TARGET_CPU" = "sparcv9" ]; then |
|
74 |
DIS_DIFF_FILTER="$SED \ |
|
75 |
-e 's/^[0-9a-f]\{16\}/<ADDR>:/' \ |
|
76 |
-e 's/^ *[0-9a-f]\{3,12\}:/ <ADDR>:/' \ |
|
77 |
-e 's/: [0-9a-f][0-9a-f]\( [0-9a-f][0-9a-f]\)\{2,10\}/: <NUMS>/' \ |
|
78 |
-e 's/\$[a-zA-Z0-9_\$]\{15\}\./<SYM>./' \ |
|
79 |
-e 's/, [0-9a-fx\-]\{1,8\}/, <ADDR>/g' \ |
|
80 |
-e 's/0x[0-9a-f]\{1,8\}/<HEX>/g' \ |
|
81 |
-e 's/\! [0-9a-f]\{1,8\} /! <ADDR> /' \ |
|
82 |
-e 's/call [0-9a-f]\{4,7\}/call <ADDR>/' \ |
|
83 |
-e 's/%hi(0),/%hi(<HEX>),/' \ |
|
84 |
" |
|
85 |
elif [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then |
|
86 |
# Random strings looking like this differ: <.XAKoKoPIac2W0OA. |
|
87 |
DIS_DIFF_FILTER="$SED \ |
|
88 |
-e 's/<\.[A-Za-z0-9]\{\15}\./<.SYM./' \ |
|
89 |
" |
|
90 |
fi |
|
91 |
elif [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
|
92 |
if [ "$OPENJDK_TARGET_CPU" = "x86" ]; then |
|
93 |
DIS_DIFF_FILTER="$SED -r \ |
|
94 |
-e 's/^ [0-9A-F]{16}: //' \ |
|
95 |
-e 's/^ [0-9A-F]{8}: / <ADDR>: /' \ |
|
96 |
-e 's/(offset \?\?)_C@_.*/\1<SYM>/' \ |
|
97 |
-e 's/[@?][A-Za-z0-9_]{1,25}/<SYM>/' \ |
|
98 |
-e 's/([-,+])[0-9A-F]{2,16}/\1<HEXSTR>/g' \ |
|
99 |
-e 's/\[[0-9A-F]{4,16}h\]/[<HEXSTR>]/' \ |
|
100 |
-e 's/: ([a-z]{2}[a-z ]{2}) [0-9A-F]{2,16}h?$/: \1 <HEXSTR>/' \ |
|
101 |
-e 's/_20[0-9]{2}_[0-1][0-9]_[0-9]{2}/_<DATE>/' \ |
|
102 |
" |
|
103 |
elif [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then |
|
104 |
DIS_DIFF_FILTER="$SED -r \ |
|
105 |
-e 's/^ [0-9A-F]{16}: //' \ |
|
106 |
-e 's/\[[0-9A-F]{4,16}h\]/[<HEXSTR>]/' \ |
|
107 |
-e 's/([,+])[0-9A-F]{2,16}h/\1<HEXSTR>/' \ |
|
108 |
-e 's/([a-z]{2}[a-z ]{2}) [0-9A-F]{4,16}$/\1 <HEXSTR>/' \ |
|
109 |
-e 's/\[\?\?_C@_.*/[<SYM>]/' \ |
|
110 |
" |
|
111 |
fi |
|
112 |
elif [ "$OPENJDK_TARGET_OS" = "macosx" ]; then |
|
113 |
DIS_DIFF_FILTER="LANG=C $SED \ |
|
114 |
-e 's/0x[0-9a-f]\{3,16\}/<HEXSTR>/g' -e 's/^[0-9a-f]\{12,20\}/<ADDR>/' \ |
|
115 |
-e 's/-20[0-9][0-9]-[0-1][0-9]-[0-3][0-9]-[0-2][0-9]\{5\}/<DATE>/g' \ |
|
116 |
-e 's/), built on .*/), <DATE>/' \ |
|
117 |
" |
|
118 |
fi |
|
119 |
||
120 |
################################################################################ |
|
14111 | 121 |
# Compare text files and ignore specific differences: |
122 |
# |
|
123 |
# * Timestamps in Java sources generated by idl2java |
|
124 |
# * Sorting order and cleanup style in .properties files |
|
125 |
||
126 |
diff_text() { |
|
127 |
OTHER_FILE=$1 |
|
128 |
THIS_FILE=$2 |
|
129 |
||
130 |
SUFFIX="${THIS_FILE##*.}" |
|
36789 | 131 |
NAME="${THIS_FILE##*/}" |
14111 | 132 |
|
133 |
TMP=1 |
|
134 |
||
135 |
if [[ "$THIS_FILE" = *"META-INF/MANIFEST.MF" ]]; then |
|
28356 | 136 |
# Filter out date string, ant version and java version differences. |
20049 | 137 |
TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \ |
14111 | 138 |
$GREP '^[<>]' | \ |
139 |
$SED -e '/[<>] Ant-Version: Apache Ant .*/d' \ |
|
28356 | 140 |
-e '/[<>] Created-By: .* (Oracle [Corpatin)]*/d' \ |
141 |
-e '/[<>] [Corpatin]*)/d' \ |
|
142 |
-e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d') |
|
14111 | 143 |
fi |
144 |
if test "x$SUFFIX" = "xjava"; then |
|
20049 | 145 |
TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \ |
14111 | 146 |
$GREP '^[<>]' | \ |
147 |
$SED -e '/[<>] \* from.*\.idl/d' \ |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
148 |
-e '/[<>] .*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \ |
36789 | 149 |
-e '/[<>] .*[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}.*/d' \ |
48912 | 150 |
-e '/[<>] \*.*[0-9]\{4\} \(at \)*[0-9][0-9]*:[0-9]\{2\}:[0-9]\{2\}.*/d' \ |
14111 | 151 |
-e '/\/\/ Generated from input file.*/d' \ |
152 |
-e '/\/\/ This file was generated AUTOMATICALLY from a template file.*/d' \ |
|
153 |
-e '/\/\/ java GenerateCharacter.*/d') |
|
154 |
fi |
|
155 |
# Ignore date strings in class files. |
|
25854 | 156 |
# Anonymous lambda classes get randomly assigned counters in their names. |
14111 | 157 |
if test "x$SUFFIX" = "xclass"; then |
48912 | 158 |
if [ "$NAME" = "SystemModules\$all.class" ] \ |
159 |
|| [ "$NAME" = "SystemModules\$default.class" ]; then |
|
160 |
# The SystemModules\$*.classes are not comparable as they contain the |
|
161 |
# module hashes which would require a whole other level of |
|
162 |
# reproducible builds to get reproducible. There is also random |
|
163 |
# order of map initialization. |
|
39204 | 164 |
TMP="" |
165 |
elif [ "$NAME" = "module-info.class" ]; then |
|
166 |
# The module-info.class have several issues with random ordering of |
|
167 |
# elements in HashSets. |
|
36789 | 168 |
MODULES_CLASS_FILTER="$SED \ |
169 |
-e 's/,$//' \ |
|
170 |
-e 's/;$//' \ |
|
171 |
-e 's/^ *[0-9]*://' \ |
|
172 |
-e 's/#[0-9]* */#/' \ |
|
173 |
-e 's/ *\/\// \/\//' \ |
|
174 |
-e 's/aload *[0-9]*/aload X/' \ |
|
175 |
-e 's/ldc_w/ldc /' \ |
|
176 |
| $SORT \ |
|
177 |
" |
|
178 |
$JAVAP -c -constants -l -p "${OTHER_FILE}" \ |
|
179 |
| eval "$MODULES_CLASS_FILTER" > ${OTHER_FILE}.javap & |
|
180 |
$JAVAP -c -constants -l -p "${THIS_FILE}" \ |
|
181 |
| eval "$MODULES_CLASS_FILTER" > ${THIS_FILE}.javap & |
|
182 |
wait |
|
183 |
TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap) |
|
14111 | 184 |
# To improve performance when large diffs are found, do a rough filtering of classes |
185 |
# elibeble for these exceptions |
|
36789 | 186 |
elif $GREP -R -e '[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}' \ |
187 |
-e 'lambda\$[a-zA-Z0-9]*\$[0-9]' ${THIS_FILE} > /dev/null |
|
188 |
then |
|
189 |
$JAVAP -c -constants -l -p "${OTHER_FILE}" > ${OTHER_FILE}.javap & |
|
190 |
$JAVAP -c -constants -l -p "${THIS_FILE}" > ${THIS_FILE}.javap & |
|
191 |
wait |
|
14111 | 192 |
TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \ |
193 |
$GREP '^[<>]' | \ |
|
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
194 |
$SED -e '/[<>].*[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}.*/d' \ |
25854 | 195 |
-e '/[<>].*lambda\$[a-zA-Z0-9]*\$[0-9]*/d') |
14111 | 196 |
fi |
197 |
fi |
|
198 |
if test "x$SUFFIX" = "xproperties"; then |
|
25854 | 199 |
# Filter out date string differences. |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
200 |
TMP=$(LC_ALL=C $DIFF $OTHER_FILE $THIS_FILE | \ |
25854 | 201 |
$GREP '^[<>]' | \ |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
202 |
$SED -e '/[<>].*[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}.*/d') |
25854 | 203 |
fi |
28356 | 204 |
if test "x$SUFFIX" = "xhtml"; then |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
205 |
# Some javadoc versions do not put quotes around font size |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
206 |
HTML_FILTER="$SED \ |
29157 | 207 |
-e 's/<font size=-1>/<font size=\"-1\">/g'" |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
208 |
$CAT $THIS_FILE | eval "$HTML_FILTER" > $THIS_FILE.filtered |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
209 |
$CAT $OTHER_FILE | eval "$HTML_FILTER" > $OTHER_FILE.filtered |
29157 | 210 |
TMP=$(LC_ALL=C $DIFF $OTHER_FILE.filtered $THIS_FILE.filtered | \ |
25854 | 211 |
$GREP '^[<>]' | \ |
29157 | 212 |
$SED -e '/[<>] <!-- Generated by javadoc .* on .* -->/d' \ |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
213 |
-e '/[<>] <meta name="date" content=".*">/d' ) |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
214 |
fi |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
215 |
if test "$NAME" = "BenchmarkList"; then |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
216 |
$SORT $THIS_FILE > $THIS_FILE.sorted |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
217 |
$SORT $OTHER_FILE > $OTHER_FILE.sorted |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
218 |
TMP=$($DIFF $THIS_FILE.sorted $OTHER_FILE.sorted) |
14111 | 219 |
fi |
220 |
if test -n "$TMP"; then |
|
221 |
echo Files $OTHER_FILE and $THIS_FILE differ |
|
222 |
return 1 |
|
223 |
fi |
|
224 |
||
225 |
return 0 |
|
226 |
} |
|
227 |
||
29157 | 228 |
################################################################################ |
14111 | 229 |
# Compare directory structure |
230 |
||
231 |
compare_dirs() { |
|
232 |
THIS_DIR=$1 |
|
233 |
OTHER_DIR=$2 |
|
234 |
WORK_DIR=$3 |
|
235 |
||
236 |
mkdir -p $WORK_DIR |
|
237 |
||
238 |
(cd $OTHER_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_other) |
|
239 |
(cd $THIS_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_this) |
|
240 |
||
25854 | 241 |
$DIFF $WORK_DIR/dirs_other $WORK_DIR/dirs_this > $WORK_DIR/dirs_diff |
28356 | 242 |
|
14111 | 243 |
echo -n Directory structure... |
244 |
if [ -s $WORK_DIR/dirs_diff ]; then |
|
245 |
echo Differences found. |
|
246 |
REGRESSIONS=true |
|
247 |
# Differences in directories found. |
|
248 |
ONLY_OTHER=$($GREP '<' $WORK_DIR/dirs_diff) |
|
249 |
if [ "$ONLY_OTHER" ]; then |
|
250 |
echo Only in $OTHER |
|
251 |
$GREP '<' $WORK_DIR/dirs_diff | $SED 's|< ./| |g' |
|
252 |
fi |
|
253 |
ONLY_THIS=$($GREP '>' $WORK_DIR/dirs_diff) |
|
254 |
if [ "$ONLY_THIS" ]; then |
|
255 |
echo Only in $THIS |
|
256 |
$GREP '>' $WORK_DIR/dirs_diff | $SED 's|> ./| |g' |
|
257 |
fi |
|
258 |
else |
|
259 |
echo Identical! |
|
260 |
fi |
|
261 |
} |
|
262 |
||
263 |
||
29157 | 264 |
################################################################################ |
14111 | 265 |
# Compare file structure |
266 |
||
267 |
compare_files() { |
|
268 |
THIS_DIR=$1 |
|
269 |
OTHER_DIR=$2 |
|
270 |
WORK_DIR=$3 |
|
271 |
||
272 |
$MKDIR -p $WORK_DIR |
|
273 |
||
274 |
(cd $OTHER_DIR && $FIND . ! -type d | $SORT > $WORK_DIR/files_other) |
|
275 |
(cd $THIS_DIR && $FIND . ! -type d | $SORT > $WORK_DIR/files_this) |
|
28356 | 276 |
|
14111 | 277 |
$DIFF $WORK_DIR/files_other $WORK_DIR/files_this > $WORK_DIR/files_diff |
278 |
||
279 |
echo -n File names... |
|
280 |
if [ -s $WORK_DIR/files_diff ]; then |
|
281 |
echo Differences found. |
|
282 |
REGRESSIONS=true |
|
283 |
# Differences in files found. |
|
284 |
ONLY_OTHER=$($GREP '<' $WORK_DIR/files_diff) |
|
285 |
if [ "$ONLY_OTHER" ]; then |
|
286 |
echo Only in $OTHER |
|
287 |
$GREP '<' $WORK_DIR/files_diff | $SED 's|< ./| |g' |
|
288 |
fi |
|
289 |
ONLY_THIS=$($GREP '>' $WORK_DIR/files_diff) |
|
290 |
if [ "$ONLY_THIS" ]; then |
|
291 |
echo Only in $THIS |
|
292 |
$GREP '>' $WORK_DIR/files_diff | $SED 's|> ./| |g' |
|
293 |
fi |
|
294 |
else |
|
295 |
echo Identical! |
|
296 |
fi |
|
297 |
} |
|
298 |
||
299 |
||
29157 | 300 |
################################################################################ |
14111 | 301 |
# Compare permissions |
302 |
||
303 |
compare_permissions() { |
|
304 |
THIS_DIR=$1 |
|
305 |
OTHER_DIR=$2 |
|
306 |
WORK_DIR=$3 |
|
307 |
||
308 |
mkdir -p $WORK_DIR |
|
309 |
||
310 |
echo -n Permissions... |
|
311 |
found="" |
|
312 |
for f in `cd $OTHER_DIR && $FIND . -type f` |
|
313 |
do |
|
314 |
if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi |
|
315 |
if [ ! -f ${THIS_DIR}/$f ]; then continue; fi |
|
316 |
OP=`ls -l ${OTHER_DIR}/$f | awk '{printf("%.10s\n", $1);}'` |
|
317 |
TP=`ls -l ${THIS_DIR}/$f | awk '{printf("%.10s\n", $1);}'` |
|
318 |
if [ "$OP" != "$TP" ] |
|
319 |
then |
|
28356 | 320 |
if [ -z "$found" ]; then echo ; found="yes"; fi |
321 |
$PRINTF "\tother: ${OP} this: ${TP}\t$f\n" |
|
14111 | 322 |
fi |
323 |
done |
|
28356 | 324 |
if [ -z "$found" ]; then |
14111 | 325 |
echo "Identical!" |
326 |
else |
|
327 |
REGRESSIONS=true |
|
328 |
fi |
|
329 |
} |
|
330 |
||
29157 | 331 |
################################################################################ |
14111 | 332 |
# Compare file command output |
333 |
||
334 |
compare_file_types() { |
|
335 |
THIS_DIR=$1 |
|
336 |
OTHER_DIR=$2 |
|
337 |
WORK_DIR=$3 |
|
338 |
||
339 |
$MKDIR -p $WORK_DIR |
|
340 |
||
37972 | 341 |
FILE_TYPES_FILTER="$SED \ |
342 |
-e 's/BuildID[^,]*//' \ |
|
343 |
-e 's/last modified: .*//' \ |
|
344 |
" |
|
345 |
||
14111 | 346 |
echo -n File types... |
347 |
found="" |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
348 |
# The file command does not know about jmod files and this sometimes results |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
349 |
# in different types being detected more or less randomly. |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
350 |
for f in $(cd $OTHER_DIR && $FIND . ! -type d -a ! -name "*.jmod") |
14111 | 351 |
do |
352 |
if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi |
|
353 |
if [ ! -f ${THIS_DIR}/$f ]; then continue; fi |
|
37972 | 354 |
OF=$(cd ${OTHER_DIR} && $FILE -h $f | eval $FILE_TYPES_FILTER) |
355 |
TF=$(cd ${THIS_DIR} && $FILE -h $f | eval $FILE_TYPES_FILTER) |
|
14111 | 356 |
if [ "$OF" != "$TF" ] |
357 |
then |
|
28356 | 358 |
if [ "`echo $OF | $GREP -c 'Zip archive data'`" -gt 0 ] \ |
359 |
&& [ "`echo $TF | $GREP -c 'Zip archive data'`" -gt 0 ] |
|
360 |
then |
|
361 |
# the way we produce zip-files make it so that directories are stored in |
|
362 |
# old file but not in new (only files with full-path) this makes file |
|
363 |
# report them as different |
|
364 |
continue |
|
365 |
else |
|
366 |
if [ -z "$found" ]; then echo ; found="yes"; fi |
|
367 |
$PRINTF "\tother: ${OF}\n\tthis : ${TF}\n" |
|
368 |
fi |
|
14111 | 369 |
fi |
370 |
done |
|
28356 | 371 |
if [ -z "$found" ]; then |
14111 | 372 |
echo "Identical!" |
373 |
else |
|
374 |
REGRESSIONS=true |
|
375 |
fi |
|
376 |
} |
|
377 |
||
29157 | 378 |
################################################################################ |
14111 | 379 |
# Compare the rest of the files |
380 |
||
381 |
compare_general_files() { |
|
382 |
THIS_DIR=$1 |
|
383 |
OTHER_DIR=$2 |
|
384 |
WORK_DIR=$3 |
|
28356 | 385 |
|
29157 | 386 |
GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" \ |
387 |
! -name "*.zip" ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \ |
|
36506 | 388 |
! -name "modules" ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \ |
29157 | 389 |
! -name "*.cpl" ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \ |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
390 |
! -name "*.lib" ! -name "*.war" ! -name "*.jmod" ! -name "*.exe" \ |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
391 |
! -name "*.obj" ! -name "*.o" ! -name "jspawnhelper" ! -name "*.a" \ |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
392 |
! -name "*.tar.gz" ! -name "classes.jsa" ! -name "gtestLauncher" \ |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
393 |
! -name "*.map" \ |
14111 | 394 |
| $GREP -v "./bin/" | $SORT | $FILTER) |
395 |
||
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
396 |
echo Other files with binary differences... |
14111 | 397 |
for f in $GENERAL_FILES |
398 |
do |
|
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
399 |
# Skip all files in test/*/native |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
400 |
if [[ "$f" == */native/* ]]; then |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
401 |
continue |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
402 |
fi |
14111 | 403 |
if [ -e $OTHER_DIR/$f ]; then |
14466
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
404 |
SUFFIX="${f##*.}" |
14111 | 405 |
if [ "$(basename $f)" = "release" ]; then |
36789 | 406 |
# In release file, ignore differences in change numbers and order |
407 |
# of modules in list. |
|
14111 | 408 |
OTHER_FILE=$WORK_DIR/$f.other |
409 |
THIS_FILE=$WORK_DIR/$f.this |
|
410 |
$MKDIR -p $(dirname $OTHER_FILE) |
|
411 |
$MKDIR -p $(dirname $THIS_FILE) |
|
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
412 |
RELEASE_FILTER="$SED \ |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
413 |
-e 's/\:[0-9a-f]\{12,12\}/:CHANGE/g' \ |
36789 | 414 |
-e 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}/<DATE>/g' \ |
415 |
-e 's/^#.*/#COMMENT/g' \ |
|
416 |
-e 's/MODULES=/MODULES=\'$'\n/' \ |
|
417 |
-e 's/,/\'$'\n/g' \ |
|
418 |
| $SORT |
|
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
419 |
" |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
420 |
$CAT $OTHER_DIR/$f | eval "$RELEASE_FILTER" > $OTHER_FILE |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
421 |
$CAT $THIS_DIR/$f | eval "$RELEASE_FILTER" > $THIS_FILE |
14466
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
422 |
elif [ "x$SUFFIX" = "xhtml" ]; then |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
423 |
# Ignore time stamps in docs files |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
424 |
OTHER_FILE=$WORK_DIR/$f.other |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
425 |
THIS_FILE=$WORK_DIR/$f.this |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
426 |
$MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE) |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
427 |
# Older versions of compare might have left soft links with |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
428 |
# these names. |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
429 |
$RM $OTHER_FILE $THIS_FILE |
15058
61c4ac49cbda
8005635: build-infra: Support building install in jprt
erikj
parents:
14466
diff
changeset
|
430 |
#Note that | doesn't work on mac sed. |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
431 |
HTML_FILTER="$SED \ |
47217 | 432 |
-e 's/20[0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6,7\}/<DATE>/g' \ |
39112 | 433 |
-e 's/20[0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}/<DATE>/g' \ |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
434 |
-e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \ |
39112 | 435 |
-e 's/[A-Z][a-z]*, [A-Z][a-z]* [0-9][0-9]*, [0-9]\{4\} [0-9][0-9:]* [AMP]\{2,2\} [A-Z][A-Z]*/<DATE>/' \ |
436 |
-e 's/from .*\.idl/\.idl/' \ |
|
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
437 |
" |
36789 | 438 |
$CAT $OTHER_DIR/$f | eval "$HTML_FILTER" > $OTHER_FILE & |
439 |
$CAT $THIS_DIR/$f | eval "$HTML_FILTER" > $THIS_FILE & |
|
440 |
wait |
|
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
441 |
elif [[ "$f" = *"/lib/classlist" ]] || [ "$SUFFIX" = "jar_contents" ]; then |
39204 | 442 |
# The classlist files may have some lines in random order |
443 |
OTHER_FILE=$WORK_DIR/$f.other |
|
444 |
THIS_FILE=$WORK_DIR/$f.this |
|
445 |
$MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE) |
|
446 |
$RM $OTHER_FILE $THIS_FILE |
|
447 |
$CAT $OTHER_DIR/$f | $SORT > $OTHER_FILE |
|
448 |
$CAT $THIS_DIR/$f | $SORT > $THIS_FILE |
|
14111 | 449 |
else |
450 |
OTHER_FILE=$OTHER_DIR/$f |
|
451 |
THIS_FILE=$THIS_DIR/$f |
|
452 |
fi |
|
453 |
DIFF_OUT=$($DIFF $OTHER_FILE $THIS_FILE 2>&1) |
|
454 |
if [ -n "$DIFF_OUT" ]; then |
|
455 |
echo $f |
|
456 |
REGRESSIONS=true |
|
457 |
if [ "$SHOW_DIFFS" = "true" ]; then |
|
458 |
echo "$DIFF_OUT" |
|
459 |
fi |
|
460 |
fi |
|
461 |
fi |
|
462 |
done |
|
463 |
||
464 |
||
465 |
} |
|
466 |
||
29157 | 467 |
################################################################################ |
14111 | 468 |
# Compare zip file |
469 |
||
470 |
compare_zip_file() { |
|
471 |
THIS_DIR=$1 |
|
472 |
OTHER_DIR=$2 |
|
473 |
WORK_DIR=$3 |
|
474 |
ZIP_FILE=$4 |
|
15179
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
475 |
# Optionally provide different name for other zipfile |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
476 |
OTHER_ZIP_FILE=$5 |
14111 | 477 |
|
478 |
THIS_ZIP=$THIS_DIR/$ZIP_FILE |
|
15179
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
479 |
if [ -n "$OTHER_ZIP_FILE" ]; then |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
480 |
OTHER_ZIP=$OTHER_DIR/$OTHER_ZIP_FILE |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
481 |
else |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
482 |
OTHER_ZIP=$OTHER_DIR/$ZIP_FILE |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
483 |
fi |
14111 | 484 |
|
485 |
THIS_SUFFIX="${THIS_ZIP##*.}" |
|
486 |
OTHER_SUFFIX="${OTHER_ZIP##*.}" |
|
487 |
if [ "$THIS_SUFFIX" != "$OTHER_SUFFIX" ]; then |
|
28356 | 488 |
echo "The files do not have the same suffix type! ($THIS_SUFFIX != $OTHER_SUFFIX)" |
14111 | 489 |
return 2 |
490 |
fi |
|
491 |
||
492 |
TYPE="$THIS_SUFFIX" |
|
493 |
||
494 |
if $CMP $OTHER_ZIP $THIS_ZIP > /dev/null |
|
495 |
then |
|
496 |
return 0 |
|
497 |
fi |
|
498 |
# Not quite identical, the might still contain the same data. |
|
499 |
# Unpack the jar/zip files in temp dirs |
|
28356 | 500 |
|
14111 | 501 |
THIS_UNZIPDIR=$WORK_DIR/$ZIP_FILE.this |
502 |
OTHER_UNZIPDIR=$WORK_DIR/$ZIP_FILE.other |
|
503 |
$RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR |
|
504 |
$MKDIR -p $THIS_UNZIPDIR |
|
505 |
$MKDIR -p $OTHER_UNZIPDIR |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
506 |
if [ "$TYPE" = "jar" -o "$TYPE" = "war" -o "$TYPE" = "zip" ] |
27560 | 507 |
then |
36506 | 508 |
(cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP) |
509 |
(cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP) |
|
37972 | 510 |
elif [ "$TYPE" = "gz" ] |
511 |
then |
|
512 |
(cd $THIS_UNZIPDIR && $GUNZIP -c $THIS_ZIP | $TAR xf -) |
|
513 |
(cd $OTHER_UNZIPDIR && $GUNZIP -c $OTHER_ZIP | $TAR xf -) |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
514 |
elif [ "$TYPE" = "jmod" ] |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
515 |
then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
516 |
(cd $THIS_UNZIPDIR && $JMOD extract $THIS_ZIP) |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
517 |
(cd $OTHER_UNZIPDIR && $JMOD extract $OTHER_ZIP) |
36506 | 518 |
else |
27560 | 519 |
(cd $THIS_UNZIPDIR && $JIMAGE extract $THIS_ZIP) |
520 |
(cd $OTHER_UNZIPDIR && $JIMAGE extract $OTHER_ZIP) |
|
521 |
fi |
|
14111 | 522 |
|
14280
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
523 |
# Find all archives inside and unzip them as well to compare the contents rather than |
15058
61c4ac49cbda
8005635: build-infra: Support building install in jprt
erikj
parents:
14466
diff
changeset
|
524 |
# the archives. pie.jar.pack.gz i app3.war is corrupt, skip it. |
47217 | 525 |
EXCEPTIONS="pie.jar.pack.gz jdk.pack" |
526 |
for pack in $($FIND $THIS_UNZIPDIR \( -name "*.pack" -o -name "*.pack.gz" \) -a \ |
|
527 |
! -name pie.jar.pack.gz -a ! -name jdk.pack); do |
|
14280
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
528 |
($UNPACK200 $pack $pack.jar) |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
529 |
# Filter out the unzipped archives from the diff below. |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
530 |
EXCEPTIONS="$EXCEPTIONS $pack $pack.jar" |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
531 |
done |
47217 | 532 |
for pack in $($FIND $OTHER_UNZIPDIR \( -name "*.pack" -o -name "*.pack.gz" \) -a \ |
533 |
! -name pie.jar.pack.gz -a ! -name jdk.pack); do |
|
14280
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
534 |
($UNPACK200 $pack $pack.jar) |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
535 |
EXCEPTIONS="$EXCEPTIONS $pack $pack.jar" |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
536 |
done |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
537 |
for zip in $($FIND $THIS_UNZIPDIR -name "*.jar" -o -name "*.zip"); do |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
538 |
$MKDIR $zip.unzip |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
539 |
(cd $zip.unzip && $UNARCHIVE $zip) |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
540 |
EXCEPTIONS="$EXCEPTIONS $zip" |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
541 |
done |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
542 |
for zip in $($FIND $OTHER_UNZIPDIR -name "*.jar" -o -name "*.zip"); do |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
543 |
$MKDIR $zip.unzip |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
544 |
(cd $zip.unzip && $UNARCHIVE $zip) |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
545 |
EXCEPTIONS="$EXCEPTIONS $zip" |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
546 |
done |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
547 |
|
14111 | 548 |
CONTENTS_DIFF_FILE=$WORK_DIR/$ZIP_FILE.diff |
549 |
# On solaris, there is no -q option. |
|
550 |
if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then |
|
20049 | 551 |
LC_ALL=C $DIFF -r $OTHER_UNZIPDIR $THIS_UNZIPDIR \ |
14111 | 552 |
| $GREP -v -e "^<" -e "^>" -e "^Common subdirectories:" \ |
553 |
> $CONTENTS_DIFF_FILE |
|
554 |
else |
|
20049 | 555 |
LC_ALL=C $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE |
14111 | 556 |
fi |
557 |
||
558 |
ONLY_OTHER=$($GREP "^Only in $OTHER_UNZIPDIR" $CONTENTS_DIFF_FILE) |
|
559 |
ONLY_THIS=$($GREP "^Only in $THIS_UNZIPDIR" $CONTENTS_DIFF_FILE) |
|
560 |
||
561 |
return_value=0 |
|
562 |
||
563 |
if [ -n "$ONLY_OTHER" ]; then |
|
564 |
echo " Only OTHER $ZIP_FILE contains:" |
|
565 |
echo "$ONLY_OTHER" | sed "s|Only in $OTHER_UNZIPDIR| |"g | sed 's|: |/|g' |
|
566 |
return_value=1 |
|
567 |
fi |
|
568 |
||
569 |
if [ -n "$ONLY_THIS" ]; then |
|
570 |
echo " Only THIS $ZIP_FILE contains:" |
|
571 |
echo "$ONLY_THIS" | sed "s|Only in $THIS_UNZIPDIR| |"g | sed 's|: |/|g' |
|
572 |
return_value=1 |
|
573 |
fi |
|
574 |
||
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
575 |
if [ "$CMP_ZIPS_CONTENTS" = "true" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
576 |
if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
577 |
DIFFING_FILES=$($GREP -e 'differ$' -e '^diff ' $CONTENTS_DIFF_FILE \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
578 |
| $SED -e 's/^Files //g' -e 's/diff -r //g' | $CUT -f 1 -d ' ' \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
579 |
| $SED "s|$OTHER_UNZIPDIR/||g") |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
580 |
else |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
581 |
DIFFING_FILES=$($GREP -e "differ$" $CONTENTS_DIFF_FILE \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
582 |
| $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g") |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
583 |
fi |
14111 | 584 |
|
42506
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
585 |
$RM -f $WORK_DIR/$ZIP_FILE.diffs |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
586 |
for file in $DIFFING_FILES; do |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
587 |
if [[ "$ACCEPTED_JARZIP_CONTENTS $EXCEPTIONS" != *"$file"* ]]; then |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
588 |
diff_text $OTHER_UNZIPDIR/$file $THIS_UNZIPDIR/$file >> $WORK_DIR/$ZIP_FILE.diffs |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
589 |
fi |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
590 |
done |
14111 | 591 |
|
42506
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
592 |
if [ -s "$WORK_DIR/$ZIP_FILE.diffs" ]; then |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
593 |
return_value=1 |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
594 |
echo " Differing files in $ZIP_FILE" |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
595 |
$CAT $WORK_DIR/$ZIP_FILE.diffs | $GREP 'differ$' | cut -f 2 -d ' ' | \ |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
596 |
$SED "s|$OTHER_UNZIPDIR| |g" > $WORK_DIR/$ZIP_FILE.difflist |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
597 |
$CAT $WORK_DIR/$ZIP_FILE.difflist |
14111 | 598 |
|
42506
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
599 |
if [ -n "$SHOW_DIFFS" ]; then |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
600 |
for i in $(cat $WORK_DIR/$ZIP_FILE.difflist) ; do |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
601 |
if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
602 |
LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
603 |
elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
604 |
LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
605 |
else |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
606 |
LC_ALL=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
607 |
fi |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
608 |
done |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
609 |
fi |
14111 | 610 |
fi |
611 |
fi |
|
612 |
||
613 |
return $return_value |
|
614 |
} |
|
615 |
||
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
616 |
################################################################################ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
617 |
# Compare jmod file |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
618 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
619 |
compare_jmod_file() { |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
620 |
THIS_DIR=$1 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
621 |
OTHER_DIR=$2 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
622 |
WORK_DIR=$3 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
623 |
JMOD_FILE=$4 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
624 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
625 |
THIS_JMOD=$THIS_DIR/$JMOD_FILE |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
626 |
OTHER_JMOD=$OTHER_DIR/$JMOD_FILE |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
627 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
628 |
if $CMP $OTHER_JMOD $THIS_JMOD > /dev/null; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
629 |
return 0 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
630 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
631 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
632 |
THIS_JMOD_LIST=$WORK_DIR/$JMOD_FILE.list.this |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
633 |
OTHER_JMOD_LIST=$WORK_DIR/$JMOD_FILE.list.other |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
634 |
mkdir -p $(dirname $THIS_JMOD_LIST) $(dirname $OTHER_JMOD_LIST) |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
635 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
636 |
$JMOD list $THIS_JMOD | sort > $THIS_JMOD_LIST |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
637 |
$JMOD list $OTHER_JMOD | sort > $OTHER_JMOD_LIST |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
638 |
JMOD_LIST_DIFF_FILE=$WORK_DIR/$JMOD_FILE.list.diff |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
639 |
LC_ALL=C $DIFF $THIS_JMOD_LIST $OTHER_JMOD_LIST > $JMOD_LIST_DIFF_FILE |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
640 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
641 |
ONLY_THIS=$($GREP "^<" $JMOD_LIST_DIFF_FILE) |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
642 |
ONLY_OTHER=$($GREP "^>" $JMOD_LIST_DIFF_FILE) |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
643 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
644 |
if [ -n "$ONLY_OTHER" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
645 |
echo " Only OTHER $JMOD_FILE contains:" |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
646 |
echo "$ONLY_OTHER" | sed "s|^>| |"g | sed 's|: |/|g' |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
647 |
return_value=1 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
648 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
649 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
650 |
if [ -n "$ONLY_THIS" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
651 |
echo " Only THIS $JMOD_FILE contains:" |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
652 |
echo "$ONLY_THIS" | sed "s|^<| |"g | sed 's|: |/|g' |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
653 |
return_value=1 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
654 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
655 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
656 |
return $return_value |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
657 |
} |
14111 | 658 |
|
29157 | 659 |
################################################################################ |
14111 | 660 |
# Compare all zip files |
661 |
||
662 |
compare_all_zip_files() { |
|
663 |
THIS_DIR=$1 |
|
664 |
OTHER_DIR=$2 |
|
665 |
WORK_DIR=$3 |
|
666 |
||
37972 | 667 |
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" -o -name "*.tar.gz" \ |
668 |
| $SORT | $FILTER ) |
|
14111 | 669 |
|
670 |
if [ -n "$ZIPS" ]; then |
|
37972 | 671 |
echo Zip/tar.gz files... |
14111 | 672 |
|
673 |
return_value=0 |
|
674 |
for f in $ZIPS; do |
|
675 |
if [ -f "$OTHER_DIR/$f" ]; then |
|
676 |
compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f |
|
677 |
if [ "$?" != "0" ]; then |
|
678 |
return_value=1 |
|
679 |
REGRESSIONS=true |
|
680 |
fi |
|
681 |
fi |
|
682 |
done |
|
683 |
fi |
|
684 |
||
685 |
return $return_value |
|
686 |
} |
|
687 |
||
29157 | 688 |
################################################################################ |
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
689 |
# Compare all jmod files |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
690 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
691 |
compare_all_jmod_files() { |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
692 |
THIS_DIR=$1 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
693 |
OTHER_DIR=$2 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
694 |
WORK_DIR=$3 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
695 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
696 |
JMODS=$(cd $THIS_DIR && $FIND . -type f -name "*.jmod" | $SORT | $FILTER ) |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
697 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
698 |
if [ -n "$JMODS" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
699 |
echo Jmod files... |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
700 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
701 |
return_value=0 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
702 |
for f in $JMODS; do |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
703 |
if [ -f "$OTHER_DIR/$f" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
704 |
compare_jmod_file $THIS_DIR $OTHER_DIR $WORK_DIR $f |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
705 |
if [ "$?" != "0" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
706 |
return_value=1 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
707 |
REGRESSIONS=true |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
708 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
709 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
710 |
done |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
711 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
712 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
713 |
return $return_value |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
714 |
} |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
715 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
716 |
################################################################################ |
14111 | 717 |
# Compare all jar files |
718 |
||
719 |
compare_all_jar_files() { |
|
720 |
THIS_DIR=$1 |
|
721 |
OTHER_DIR=$2 |
|
722 |
WORK_DIR=$3 |
|
723 |
||
724 |
# TODO filter? |
|
25854 | 725 |
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.jar" -o -name "*.war" \ |
36789 | 726 |
-o -name "modules" | $SORT | $FILTER) |
14111 | 727 |
|
728 |
if [ -n "$ZIPS" ]; then |
|
729 |
echo Jar files... |
|
730 |
||
731 |
return_value=0 |
|
732 |
for f in $ZIPS; do |
|
733 |
if [ -f "$OTHER_DIR/$f" ]; then |
|
734 |
compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f |
|
735 |
if [ "$?" != "0" ]; then |
|
736 |
return_value=1 |
|
737 |
REGRESSIONS=true |
|
738 |
fi |
|
739 |
fi |
|
740 |
done |
|
741 |
fi |
|
742 |
||
743 |
return $return_value |
|
744 |
} |
|
745 |
||
29157 | 746 |
################################################################################ |
14111 | 747 |
# Compare binary (executable/library) file |
748 |
||
749 |
compare_bin_file() { |
|
750 |
THIS_DIR=$1 |
|
751 |
OTHER_DIR=$2 |
|
752 |
WORK_DIR=$3 |
|
753 |
BIN_FILE=$4 |
|
25854 | 754 |
OTHER_BIN_FILE=$5 |
14111 | 755 |
|
756 |
THIS_FILE=$THIS_DIR/$BIN_FILE |
|
25854 | 757 |
if [ -n "$OTHER_BIN_FILE" ]; then |
758 |
OTHER_FILE=$OTHER_DIR/$OTHER_BIN_FILE |
|
759 |
else |
|
760 |
OTHER_FILE=$OTHER_DIR/$BIN_FILE |
|
761 |
fi |
|
14111 | 762 |
NAME=$(basename $BIN_FILE) |
763 |
WORK_FILE_BASE=$WORK_DIR/$BIN_FILE |
|
764 |
FILE_WORK_DIR=$(dirname $WORK_FILE_BASE) |
|
765 |
||
766 |
$MKDIR -p $FILE_WORK_DIR |
|
767 |
||
28356 | 768 |
# Make soft links to original files from work dir to facilitate debugging |
769 |
$LN -f -s $THIS_FILE $WORK_FILE_BASE.this |
|
770 |
$LN -f -s $OTHER_FILE $WORK_FILE_BASE.other |
|
771 |
||
14111 | 772 |
ORIG_THIS_FILE="$THIS_FILE" |
773 |
ORIG_OTHER_FILE="$OTHER_FILE" |
|
774 |
||
32811
df82db312e58
8135060: Stop building Xcode projects in install build
erikj
parents:
31310
diff
changeset
|
775 |
if [ "$STRIP_ALL" = "true" ] || [[ "$STRIP_BEFORE_COMPARE" = *"$BIN_FILE"* ]]; then |
14111 | 776 |
THIS_STRIPPED_FILE=$FILE_WORK_DIR/this/$NAME |
777 |
OTHER_STRIPPED_FILE=$FILE_WORK_DIR/other/$NAME |
|
778 |
$MKDIR -p $FILE_WORK_DIR/this $FILE_WORK_DIR/other |
|
779 |
$CP $THIS_FILE $THIS_STRIPPED_FILE |
|
780 |
$CP $OTHER_FILE $OTHER_STRIPPED_FILE |
|
781 |
$STRIP $THIS_STRIPPED_FILE |
|
782 |
$STRIP $OTHER_STRIPPED_FILE |
|
783 |
THIS_FILE="$THIS_STRIPPED_FILE" |
|
784 |
OTHER_FILE="$OTHER_STRIPPED_FILE" |
|
785 |
fi |
|
786 |
||
787 |
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
|
28356 | 788 |
unset _NT_SYMBOL_PATH |
41949 | 789 |
if [ "$(uname -o)" = "Cygwin" ]; then |
790 |
THIS=$(cygpath -msa $THIS) |
|
791 |
OTHER=$(cygpath -msa $OTHER) |
|
28356 | 792 |
fi |
41949 | 793 |
# Build an _NT_SYMBOL_PATH that contains all known locations for |
794 |
# pdb files. |
|
795 |
PDB_DIRS="$(ls -d \ |
|
796 |
{$OTHER,$THIS}/support/modules_{cmds,libs}/{*,*/*} \ |
|
797 |
{$OTHER,$THIS}/support/native/java.base/java_objs \ |
|
798 |
)" |
|
799 |
export _NT_SYMBOL_PATH="$(echo $PDB_DIRS | tr ' ' ';')" |
|
14111 | 800 |
fi |
801 |
||
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
802 |
if cmp $OTHER_FILE $THIS_FILE > /dev/null; then |
14111 | 803 |
# The files were bytewise identical. |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
804 |
if [ -n "$VERBOSE" ]; then |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
805 |
echo " : : : : : : $BIN_FILE" |
14111 | 806 |
fi |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
807 |
return 0 |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
808 |
fi |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
809 |
if [ -z "$SKIP_BIN_DIFF" ]; then |
14111 | 810 |
BIN_MSG=" diff " |
811 |
if [[ "$ACCEPTED_BIN_DIFF" != *"$BIN_FILE"* ]]; then |
|
812 |
DIFF_BIN=true |
|
813 |
if [[ "$KNOWN_BIN_DIFF" != *"$BIN_FILE"* ]]; then |
|
814 |
BIN_MSG="*$BIN_MSG*" |
|
815 |
REGRESSIONS=true |
|
816 |
else |
|
817 |
BIN_MSG=" $BIN_MSG " |
|
818 |
fi |
|
819 |
else |
|
820 |
BIN_MSG="($BIN_MSG)" |
|
821 |
DIFF_BIN= |
|
822 |
fi |
|
55018
ecb7b9a98f0e
8224145: Build compare script fails intermittently on test image native libraries
erikj
parents:
54325
diff
changeset
|
823 |
else |
ecb7b9a98f0e
8224145: Build compare script fails intermittently on test image native libraries
erikj
parents:
54325
diff
changeset
|
824 |
BIN_MSG= |
ecb7b9a98f0e
8224145: Build compare script fails intermittently on test image native libraries
erikj
parents:
54325
diff
changeset
|
825 |
DIFF_BIN= |
14111 | 826 |
fi |
827 |
||
828 |
if [ -n "$STAT" ]; then |
|
829 |
THIS_SIZE=$($STAT $STAT_PRINT_SIZE "$THIS_FILE") |
|
830 |
OTHER_SIZE=$($STAT $STAT_PRINT_SIZE "$OTHER_FILE") |
|
831 |
else |
|
832 |
THIS_SIZE=$(ls -l "$THIS_FILE" | awk '{ print $5 }') |
|
833 |
OTHER_SIZE=$(ls -l "$OTHER_FILE" | awk '{ print $5 }') |
|
834 |
fi |
|
835 |
if [ $THIS_SIZE -ne $OTHER_SIZE ]; then |
|
836 |
DIFF_SIZE_NUM=$($EXPR $THIS_SIZE - $OTHER_SIZE) |
|
837 |
DIFF_SIZE_REL=$($EXPR $THIS_SIZE \* 100 / $OTHER_SIZE) |
|
838 |
SIZE_MSG=$($PRINTF "%3d%% %4d" $DIFF_SIZE_REL $DIFF_SIZE_NUM) |
|
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
839 |
if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* || "$ACCEPTED_SMALL_SIZE_DIFF" = "true" ]] \ |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
840 |
&& [ "$DIFF_SIZE_REL" -gt 98 ] \ |
28356 | 841 |
&& [ "$DIFF_SIZE_REL" -lt 102 ]; then |
14111 | 842 |
SIZE_MSG="($SIZE_MSG)" |
843 |
DIFF_SIZE= |
|
14458 | 844 |
elif [ "$OPENJDK_TARGET_OS" = "windows" ] \ |
28356 | 845 |
&& [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \ |
846 |
&& [ "$DIFF_SIZE_NUM" = 512 ]; then |
|
847 |
# On windows, size of binaries increase in 512 increments. |
|
14458 | 848 |
SIZE_MSG="($SIZE_MSG)" |
849 |
DIFF_SIZE= |
|
850 |
elif [ "$OPENJDK_TARGET_OS" = "windows" ] \ |
|
28356 | 851 |
&& [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \ |
852 |
&& [ "$DIFF_SIZE_NUM" = -512 ]; then |
|
853 |
# On windows, size of binaries increase in 512 increments. |
|
14111 | 854 |
SIZE_MSG="($SIZE_MSG)" |
855 |
DIFF_SIZE= |
|
856 |
else |
|
857 |
if [[ "$ACCEPTED_SIZE_DIFF" != *"$BIN_FILE"* ]]; then |
|
858 |
DIFF_SIZE=true |
|
859 |
if [[ "$KNOWN_SIZE_DIFF" != *"$BIN_FILE"* ]]; then |
|
860 |
SIZE_MSG="*$SIZE_MSG*" |
|
861 |
REGRESSIONS=true |
|
862 |
else |
|
863 |
SIZE_MSG=" $SIZE_MSG " |
|
864 |
fi |
|
865 |
else |
|
866 |
SIZE_MSG="($SIZE_MSG)" |
|
867 |
DIFF_SIZE= |
|
868 |
fi |
|
869 |
fi |
|
870 |
else |
|
871 |
SIZE_MSG=" " |
|
872 |
DIFF_SIZE= |
|
873 |
if [[ "$KNOWN_SIZE_DIFF $ACCEPTED_SIZE_DIFF" = *"$BIN_FILE"* ]]; then |
|
874 |
SIZE_MSG=" ! " |
|
875 |
fi |
|
876 |
fi |
|
877 |
||
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
878 |
if [ "$SORT_ALL_SYMBOLS" = "true" ] || [[ "$SORT_SYMBOLS" = *"$BIN_FILE"* ]]; then |
14111 | 879 |
SYM_SORT_CMD="sort" |
880 |
else |
|
881 |
SYM_SORT_CMD="cat" |
|
882 |
fi |
|
883 |
||
37402 | 884 |
if [ -n "$SYMBOLS_DIFF_FILTER" ] && [ -z "$NEED_SYMBOLS_DIFF_FILTER" ] \ |
885 |
|| [[ "$NEED_SYMBOLS_DIFF_FILTER" = *"$BIN_FILE"* ]]; then |
|
886 |
this_SYMBOLS_DIFF_FILTER="$SYMBOLS_DIFF_FILTER" |
|
887 |
else |
|
888 |
this_SYMBOLS_DIFF_FILTER="$CAT" |
|
889 |
fi |
|
890 |
||
14111 | 891 |
# Check symbols |
892 |
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
|
893 |
# The output from dumpbin on windows differs depending on if the debug symbol |
|
894 |
# files are still around at the location the binary is pointing too. Need |
|
28356 | 895 |
# to filter out that extra information. |
896 |
$DUMPBIN -exports $OTHER_FILE | $GREP -E '^ +[0-9A-F]+ +[0-9A-F]+ [0-9A-F]+' | sed 's/ = .*//g' | cut -c27- | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other |
|
897 |
$DUMPBIN -exports $THIS_FILE | $GREP -E '^ +[0-9A-F]+ +[0-9A-F]+ [0-9A-F]+' | sed 's/ = .*//g' | cut -c27- | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this |
|
14111 | 898 |
elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then |
899 |
# Some symbols get seemingly random 15 character prefixes. Filter them out. |
|
900 |
$NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] [\.\$]\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other |
|
28356 | 901 |
$NM -a $ORIG_THIS_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] [\.\$]\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
902 |
elif [ "$OPENJDK_TARGET_OS" = "aix" ]; then |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
903 |
$OBJDUMP -T $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
904 |
$OBJDUMP -T $ORIG_THIS_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this |
35747 | 905 |
elif [ "$OPENJDK_TARGET_OS" = "macosx" ]; then |
906 |
$NM -j $ORIG_OTHER_FILE 2> /dev/null | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other |
|
907 |
$NM -j $ORIG_THIS_FILE 2> /dev/null | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this |
|
14111 | 908 |
else |
37402 | 909 |
$NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME \ |
910 |
| $AWK '{print $2, $3, $4, $5}' \ |
|
911 |
| eval "$this_SYMBOLS_DIFF_FILTER" \ |
|
912 |
| $SYM_SORT_CMD \ |
|
913 |
> $WORK_FILE_BASE.symbols.other |
|
914 |
$NM -a $ORIG_THIS_FILE 2> /dev/null | $GREP -v $NAME \ |
|
915 |
| $AWK '{print $2, $3, $4, $5}' \ |
|
916 |
| eval "$this_SYMBOLS_DIFF_FILTER" \ |
|
917 |
| $SYM_SORT_CMD \ |
|
918 |
> $WORK_FILE_BASE.symbols.this |
|
14111 | 919 |
fi |
28356 | 920 |
|
20049 | 921 |
LC_ALL=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff |
14111 | 922 |
if [ -s $WORK_FILE_BASE.symbols.diff ]; then |
923 |
SYM_MSG=" diff " |
|
924 |
if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then |
|
925 |
DIFF_SYM=true |
|
926 |
if [[ "$KNOWN_SYM_DIFF" != *"$BIN_FILE"* ]]; then |
|
927 |
SYM_MSG="*$SYM_MSG*" |
|
928 |
REGRESSIONS=true |
|
929 |
else |
|
930 |
SYM_MSG=" $SYM_MSG " |
|
931 |
fi |
|
932 |
else |
|
28356 | 933 |
SYM_MSG="($SYM_MSG)" |
14111 | 934 |
DIFF_SYM= |
935 |
fi |
|
936 |
else |
|
937 |
SYM_MSG=" " |
|
938 |
DIFF_SYM= |
|
939 |
if [[ "$KNOWN_SYM_DIFF $ACCEPTED_SYM_DIFF" = *"$BIN_FILE"* ]]; then |
|
940 |
SYM_MSG=" ! " |
|
941 |
fi |
|
942 |
fi |
|
943 |
||
944 |
# Check dependencies |
|
945 |
if [ -n "$LDD_CMD" ]; then |
|
37032
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
946 |
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
947 |
LDD_FILTER="$GREP \.dll" |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
948 |
else |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
949 |
LDD_FILTER="$CAT" |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
950 |
fi |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
951 |
(cd $FILE_WORK_DIR && $CP $OTHER_FILE . && $LDD_CMD $NAME 2>/dev/null \ |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
952 |
| $LDD_FILTER | $AWK '{ print $1;}' | $SORT \ |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
953 |
| $TEE $WORK_FILE_BASE.deps.other \ |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
954 |
| $UNIQ > $WORK_FILE_BASE.deps.other.uniq) |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
955 |
(cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME 2</dev/null \ |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
956 |
| $LDD_FILTER | $AWK '{ print $1;}' | $SORT \ |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
957 |
| $TEE $WORK_FILE_BASE.deps.this \ |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
958 |
| $UNIQ > $WORK_FILE_BASE.deps.this.uniq) |
28356 | 959 |
(cd $FILE_WORK_DIR && $RM -f $NAME) |
960 |
||
37032
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
961 |
LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this \ |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
962 |
> $WORK_FILE_BASE.deps.diff |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
963 |
LC_ALL=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq \ |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
964 |
> $WORK_FILE_BASE.deps.diff.uniq |
28356 | 965 |
|
966 |
if [ -s $WORK_FILE_BASE.deps.diff ]; then |
|
14111 | 967 |
if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then |
28356 | 968 |
DEP_MSG=" diff " |
14111 | 969 |
else |
28356 | 970 |
DEP_MSG=" redun " |
14111 | 971 |
fi |
972 |
if [[ "$ACCEPTED_DEP_DIFF" != *"$BIN_FILE"* ]]; then |
|
28356 | 973 |
DIFF_DEP=true |
974 |
if [[ "$KNOWN_DEP_DIFF" != *"$BIN_FILE"* ]]; then |
|
14111 | 975 |
DEP_MSG="*$DEP_MSG*" |
976 |
REGRESSIONS=true |
|
28356 | 977 |
else |
14111 | 978 |
DEP_MSG=" $DEP_MSG " |
28356 | 979 |
fi |
14111 | 980 |
else |
28356 | 981 |
DEP_MSG="($DEP_MSG)" |
982 |
DIFF_DEP= |
|
14111 | 983 |
fi |
28356 | 984 |
else |
985 |
DEP_MSG=" " |
|
986 |
DIFF_DEP= |
|
14111 | 987 |
if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then |
988 |
DEP_MSG=" ! " |
|
989 |
fi |
|
28356 | 990 |
fi |
14111 | 991 |
else |
28356 | 992 |
DEP_MSG=" - " |
14111 | 993 |
fi |
28356 | 994 |
|
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
995 |
# Some linux compilers add a unique Build ID |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
996 |
if [ "$OPENJDK_TARGET_OS" = "linux" ]; then |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
997 |
BUILD_ID_FILTER="$SED -r 's/(Build ID:) [0-9a-f]{40}/\1/'" |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
998 |
else |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
999 |
BUILD_ID_FILTER="$CAT" |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
1000 |
fi |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
1001 |
|
14111 | 1002 |
# Compare fulldump output |
1003 |
if [ -n "$FULLDUMP_CMD" ] && [ -z "$SKIP_FULLDUMP_DIFF" ]; then |
|
29157 | 1004 |
if [ -z "$FULLDUMP_DIFF_FILTER" ]; then |
1005 |
FULLDUMP_DIFF_FILTER="$CAT" |
|
1006 |
fi |
|
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
1007 |
$FULLDUMP_CMD $OTHER_FILE | eval "$BUILD_ID_FILTER" | eval "$FULLDUMP_DIFF_FILTER" \ |
37402 | 1008 |
> $WORK_FILE_BASE.fulldump.other 2>&1 & |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
1009 |
$FULLDUMP_CMD $THIS_FILE | eval "$BUILD_ID_FILTER" | eval "$FULLDUMP_DIFF_FILTER" \ |
37402 | 1010 |
> $WORK_FILE_BASE.fulldump.this 2>&1 & |
1011 |
wait |
|
29157 | 1012 |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1013 |
LC_ALL=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this \ |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1014 |
> $WORK_FILE_BASE.fulldump.diff |
28356 | 1015 |
|
14111 | 1016 |
if [ -s $WORK_FILE_BASE.fulldump.diff ]; then |
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1017 |
FULLDUMP_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.fulldump.diff | awk '{print $5}') |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1018 |
FULLDUMP_MSG=$($PRINTF "%8d" $FULLDUMP_DIFF_SIZE) |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1019 |
if [[ "$ACCEPTED_FULLDUMP_DIFF" != *"$BIN_FILE"* ]]; then |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1020 |
DIFF_FULLDUMP=true |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1021 |
if [[ "$KNOWN_FULLDUMP_DIFF" != *"$BIN_FILE"* ]]; then |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1022 |
FULLDUMP_MSG="*$FULLDUMP_MSG*" |
14111 | 1023 |
REGRESSIONS=true |
1024 |
else |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1025 |
FULLDUMP_MSG=" $FULLDUMP_MSG " |
14111 | 1026 |
fi |
1027 |
else |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1028 |
FULLDUMP_MSG="($FULLDUMP_MSG)" |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1029 |
DIFF_FULLDUMP= |
14111 | 1030 |
fi |
1031 |
else |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1032 |
FULLDUMP_MSG=" " |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1033 |
DIFF_FULLDUMP= |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1034 |
if [[ "$KNOWN_FULLDUMP_DIFF $ACCEPTED_FULLDUMP_DIFF" = *"$BIN_FILE"* ]]; then |
37972 | 1035 |
FULLDUMP_MSG=" ! " |
14111 | 1036 |
fi |
1037 |
fi |
|
1038 |
fi |
|
1039 |
||
1040 |
# Compare disassemble output |
|
1041 |
if [ -n "$DIS_CMD" ] && [ -z "$SKIP_DIS_DIFF" ]; then |
|
37402 | 1042 |
this_DIS_DIFF_FILTER="$CAT" |
1043 |
if [ -n "$DIS_DIFF_FILTER" ]; then |
|
1044 |
if [ -z "$NEED_DIS_DIFF_FILTER" ] \ |
|
1045 |
|| [[ "$NEED_DIS_DIFF_FILTER" = *"$BIN_FILE"* ]]; then |
|
1046 |
this_DIS_DIFF_FILTER="$DIS_DIFF_FILTER" |
|
1047 |
fi |
|
28356 | 1048 |
fi |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1049 |
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1050 |
DIS_GREP_ARG=-a |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1051 |
else |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1052 |
DIS_GREP_ARG= |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1053 |
fi |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1054 |
$DIS_CMD $OTHER_FILE | $GREP $DIS_GREP_ARG -v $NAME \ |
37402 | 1055 |
| eval "$this_DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.other 2>&1 & |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1056 |
$DIS_CMD $THIS_FILE | $GREP $DIS_GREP_ARG -v $NAME \ |
37402 | 1057 |
| eval "$this_DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.this 2>&1 & |
1058 |
wait |
|
28356 | 1059 |
|
20049 | 1060 |
LC_ALL=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff |
28356 | 1061 |
|
14111 | 1062 |
if [ -s $WORK_FILE_BASE.dis.diff ]; then |
1063 |
DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}') |
|
1064 |
DIS_MSG=$($PRINTF "%8d" $DIS_DIFF_SIZE) |
|
1065 |
if [[ "$ACCEPTED_DIS_DIFF" != *"$BIN_FILE"* ]]; then |
|
1066 |
DIFF_DIS=true |
|
37402 | 1067 |
if [ "$MAX_KNOWN_DIS_DIFF_SIZE" = "" ]; then |
1068 |
MAX_KNOWN_DIS_DIFF_SIZE="0" |
|
1069 |
fi |
|
1070 |
if [[ "$KNOWN_DIS_DIFF" = *"$BIN_FILE"* ]] \ |
|
1071 |
&& [ "$DIS_DIFF_SIZE" -lt "$MAX_KNOWN_DIS_DIFF_SIZE" ]; then |
|
1072 |
DIS_MSG=" $DIS_MSG " |
|
1073 |
else |
|
14111 | 1074 |
DIS_MSG="*$DIS_MSG*" |
1075 |
REGRESSIONS=true |
|
1076 |
fi |
|
1077 |
else |
|
1078 |
DIS_MSG="($DIS_MSG)" |
|
1079 |
DIFF_DIS= |
|
1080 |
fi |
|
1081 |
else |
|
1082 |
DIS_MSG=" " |
|
1083 |
DIFF_DIS= |
|
1084 |
if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then |
|
1085 |
DIS_MSG=" ! " |
|
1086 |
fi |
|
1087 |
fi |
|
1088 |
fi |
|
1089 |
||
1090 |
||
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1091 |
if [ -n "$DIFF_BIN$DIFF_SIZE$DIFF_SYM$DIFF_DEP$DIFF_FULLDUMP$DIFF_DIS" ] || [ -n "$VERBOSE" ]; then |
14111 | 1092 |
if [ -n "$BIN_MSG" ]; then echo -n "$BIN_MSG:"; fi |
1093 |
if [ -n "$SIZE_MSG" ]; then echo -n "$SIZE_MSG:"; fi |
|
1094 |
if [ -n "$SYM_MSG" ]; then echo -n "$SYM_MSG:"; fi |
|
1095 |
if [ -n "$DEP_MSG" ]; then echo -n "$DEP_MSG:"; fi |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1096 |
if [ -n "$FULLDUMP_MSG" ]; then echo -n "$FULLDUMP_MSG:"; fi |
14111 | 1097 |
if [ -n "$DIS_MSG" ]; then echo -n "$DIS_MSG:"; fi |
1098 |
echo " $BIN_FILE" |
|
1099 |
if [ "$SHOW_DIFFS" = "true" ]; then |
|
1100 |
if [ -s "$WORK_FILE_BASE.symbols.diff" ]; then |
|
1101 |
echo "Symbols diff:" |
|
1102 |
$CAT $WORK_FILE_BASE.symbols.diff |
|
1103 |
fi |
|
1104 |
if [ -s "$WORK_FILE_BASE.deps.diff" ]; then |
|
1105 |
echo "Deps diff:" |
|
1106 |
$CAT $WORK_FILE_BASE.deps.diff |
|
1107 |
fi |
|
1108 |
if [ -s "$WORK_FILE_BASE.fulldump.diff" ]; then |
|
1109 |
echo "Fulldump diff:" |
|
1110 |
$CAT $WORK_FILE_BASE.fulldump.diff |
|
1111 |
fi |
|
1112 |
if [ -s "$WORK_FILE_BASE.dis.diff" ]; then |
|
1113 |
echo "Disassembly diff:" |
|
1114 |
$CAT $WORK_FILE_BASE.dis.diff |
|
1115 |
fi |
|
1116 |
fi |
|
1117 |
return 1 |
|
1118 |
fi |
|
1119 |
return 0 |
|
1120 |
} |
|
1121 |
||
29157 | 1122 |
################################################################################ |
14111 | 1123 |
# Print binary diff header |
1124 |
||
1125 |
print_binary_diff_header() { |
|
1126 |
if [ -z "$SKIP_BIN_DIFF" ]; then echo -n " Binary :"; fi |
|
1127 |
if [ -z "$SKIP_SIZE_DIFF" ]; then echo -n " Size :"; fi |
|
1128 |
if [ -z "$SKIP_SYM_DIFF" ]; then echo -n " Symbols :"; fi |
|
1129 |
if [ -z "$SKIP_DEP_DIFF" ]; then echo -n " Deps :"; fi |
|
1130 |
if [ -z "$SKIP_FULLDUMP_DIFF" ]; then echo -n " Fulldump :"; fi |
|
1131 |
if [ -z "$SKIP_DIS_DIFF" ]; then echo -n " Disass :"; fi |
|
1132 |
echo |
|
1133 |
} |
|
1134 |
||
29157 | 1135 |
################################################################################ |
14111 | 1136 |
# Compare all libraries |
1137 |
||
1138 |
compare_all_libs() { |
|
1139 |
THIS_DIR=$1 |
|
1140 |
OTHER_DIR=$2 |
|
1141 |
WORK_DIR=$3 |
|
1142 |
||
28356 | 1143 |
LIBS=$(cd $THIS_DIR && $FIND . -type f \( -name 'lib*.so' -o -name '*.dylib' \ |
35370
f9b430645a18
8148120: Incremental update from build-infra project
ihse
parents:
34596
diff
changeset
|
1144 |
-o -name '*.dll' -o -name '*.obj' -o -name '*.o' -o -name '*.a' \ |
28356 | 1145 |
-o -name '*.cpl' \) | $SORT | $FILTER) |
14111 | 1146 |
|
48912 | 1147 |
# On macos, filter out the dSYM debug symbols files as they are also |
1148 |
# named *.dylib. |
|
1149 |
if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then |
|
1150 |
LIBS=$(echo "$LIBS" | $GREP -v '\.dSYM/') |
|
1151 |
fi |
|
1152 |
||
14111 | 1153 |
if [ -n "$LIBS" ]; then |
1154 |
echo Libraries... |
|
1155 |
print_binary_diff_header |
|
1156 |
for l in $LIBS; do |
|
1157 |
if [ -f "$OTHER_DIR/$l" ]; then |
|
1158 |
compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $l |
|
1159 |
if [ "$?" != "0" ]; then |
|
1160 |
return_value=1 |
|
1161 |
fi |
|
1162 |
fi |
|
1163 |
done |
|
1164 |
fi |
|
1165 |
||
1166 |
return $return_value |
|
1167 |
} |
|
1168 |
||
29157 | 1169 |
################################################################################ |
14111 | 1170 |
# Compare all executables |
1171 |
||
1172 |
compare_all_execs() { |
|
1173 |
THIS_DIR=$1 |
|
1174 |
OTHER_DIR=$2 |
|
1175 |
WORK_DIR=$3 |
|
1176 |
||
1177 |
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
|
1178 |
EXECS=$(cd $THIS_DIR && $FIND . -type f -name '*.exe' | $SORT | $FILTER) |
|
1179 |
else |
|
14280
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
1180 |
EXECS=$(cd $THIS_DIR && $FIND . -name db -prune -o -type f -perm -100 \! \ |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
1181 |
\( -name '*.so' -o -name '*.dylib' -o -name '*.dll' -o -name '*.cgi' \ |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
1182 |
-o -name '*.jar' -o -name '*.diz' -o -name 'jcontrol' -o -name '*.properties' \ |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
1183 |
-o -name '*.data' -o -name '*.bfc' -o -name '*.src' -o -name '*.txt' \ |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
1184 |
-o -name '*.cfg' -o -name 'meta-index' -o -name '*.properties.ja' \ |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1185 |
-o -name '*.xml' -o -name '*.html' -o -name '*.png' -o -name 'README' \ |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1186 |
-o -name '*.zip' -o -name '*.jimage' -o -name '*.java' -o -name '*.mf' \ |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1187 |
-o -name '*.jpg' -o -name '*.wsdl' -o -name '*.js' -o -name '*.sh' \ |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1188 |
-o -name '*.bat' -o -name '*LICENSE' -o -name '*.d' -o -name '*store' \ |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1189 |
-o -name 'blacklist' -o -name '*certs' -o -name '*.ttf' \ |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1190 |
-o -name '*.jfc' -o -name '*.dat' -o -name 'release' -o -name '*.dir'\ |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1191 |
-o -name '*.sym' -o -name '*.idl' -o -name '*.h' -o -name '*.access' \ |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1192 |
-o -name '*.template' -o -name '*.policy' -o -name '*.security' \ |
48912 | 1193 |
-o -name 'COPYRIGHT' -o -name '*.1' -o -name '*.debuginfo' \ |
14280
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
1194 |
-o -name 'classlist' \) | $SORT | $FILTER) |
14111 | 1195 |
fi |
1196 |
||
1197 |
if [ -n "$EXECS" ]; then |
|
1198 |
echo Executables... |
|
1199 |
print_binary_diff_header |
|
1200 |
for e in $EXECS; do |
|
1201 |
if [ -f "$OTHER_DIR/$e" ]; then |
|
1202 |
compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $e |
|
1203 |
if [ "$?" != "0" ]; then |
|
1204 |
return_value=1 |
|
1205 |
fi |
|
1206 |
fi |
|
1207 |
done |
|
1208 |
fi |
|
1209 |
||
1210 |
return $return_value |
|
1211 |
} |
|
1212 |
||
29157 | 1213 |
################################################################################ |
14111 | 1214 |
# Initiate configuration |
1215 |
||
33441
ce975712c050
8141439: Fix compare.sh -o <otherdir> (broken by JDK-8136813)
ihse
parents:
33031
diff
changeset
|
1216 |
THIS="$SCRIPT_DIR" |
14111 | 1217 |
echo "$THIS" |
1218 |
THIS_SCRIPT="$0" |
|
1219 |
||
1220 |
if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "-?" ] || [ "$1" = "/h" ] || [ "$1" = "/?" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then |
|
1221 |
echo "bash ./compare.sh [OPTIONS] [FILTER]" |
|
1222 |
echo "" |
|
1223 |
echo "-all Compare all files in all known ways" |
|
1224 |
echo "-names Compare the file names and directory structure" |
|
1225 |
echo "-perms Compare the permission bits on all files and directories" |
|
1226 |
echo "-types Compare the output of the file command on all files" |
|
1227 |
echo "-general Compare the files not convered by the specialized comparisons" |
|
42506
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
1228 |
echo "-zips Compare the contents of all zip files and files in them" |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
1229 |
echo "-zips-names Compare the file names inside all zip files" |
14111 | 1230 |
echo "-jars Compare the contents of all jar files" |
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1231 |
echo "-jmods Compare the listings of all jmod files" |
14111 | 1232 |
echo "-libs Compare all native libraries" |
1233 |
echo "-execs Compare all executables" |
|
1234 |
echo "-v Verbose output, does not hide known differences" |
|
1235 |
echo "-vv More verbose output, shows diff output of all comparisons" |
|
1236 |
echo "-o [OTHER] Compare with build in other directory. Will default to the old build directory" |
|
1237 |
echo "" |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1238 |
echo "--sort-symbols Sort all symbols before comparing" |
32811
df82db312e58
8135060: Stop building Xcode projects in install build
erikj
parents:
31310
diff
changeset
|
1239 |
echo "--strip Strip all binaries before comparing" |
35747 | 1240 |
echo "--clean Clean all previous comparison results first" |
32811
df82db312e58
8135060: Stop building Xcode projects in install build
erikj
parents:
31310
diff
changeset
|
1241 |
echo "" |
14111 | 1242 |
echo "[FILTER] List filenames in the image to compare, works for jars, zips, libs and execs" |
1243 |
echo "Example:" |
|
47217 | 1244 |
echo "bash ./make/scripts/compareimages.sh CodePointIM.jar" |
15179
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1245 |
echo "" |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1246 |
echo "-2zips <file1> <file2> Compare two zip files only" |
25854 | 1247 |
echo "-2bins <file1> <file2> Compare two binary files only" |
1248 |
echo "-2dirs <dir1> <dir2> Compare two directories as if they were images" |
|
15179
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1249 |
echo "" |
14111 | 1250 |
exit 10 |
1251 |
fi |
|
1252 |
||
1253 |
CMP_NAMES=false |
|
1254 |
CMP_PERMS=false |
|
1255 |
CMP_TYPES=false |
|
1256 |
CMP_GENERAL=false |
|
1257 |
CMP_ZIPS=false |
|
42506
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
1258 |
CMP_ZIPS_CONTENTS=true |
14111 | 1259 |
CMP_JARS=false |
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1260 |
CMP_JMODS=false |
14111 | 1261 |
CMP_LIBS=false |
1262 |
CMP_EXECS=false |
|
1263 |
||
1264 |
while [ -n "$1" ]; do |
|
1265 |
case "$1" in |
|
1266 |
-v) |
|
1267 |
VERBOSE=true |
|
1268 |
;; |
|
1269 |
-vv) |
|
1270 |
VERBOSE=true |
|
1271 |
SHOW_DIFFS=true |
|
1272 |
;; |
|
1273 |
-o) |
|
1274 |
OTHER="$2" |
|
1275 |
shift |
|
1276 |
;; |
|
1277 |
-all) |
|
1278 |
CMP_NAMES=true |
|
1279 |
if [ "$OPENJDK_TARGET_OS" != "windows" ]; then |
|
1280 |
CMP_PERMS=true |
|
1281 |
fi |
|
1282 |
CMP_TYPES=true |
|
1283 |
CMP_GENERAL=true |
|
1284 |
CMP_ZIPS=true |
|
1285 |
CMP_JARS=true |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1286 |
CMP_JMODS=true |
14111 | 1287 |
CMP_LIBS=true |
1288 |
CMP_EXECS=true |
|
1289 |
;; |
|
1290 |
-names) |
|
1291 |
CMP_NAMES=true |
|
1292 |
;; |
|
1293 |
-perms) |
|
1294 |
CMP_PERMS=true |
|
1295 |
;; |
|
1296 |
-types) |
|
1297 |
CMP_TYPES=true |
|
1298 |
;; |
|
1299 |
-general) |
|
1300 |
CMP_GENERAL=true |
|
1301 |
;; |
|
1302 |
-zips) |
|
1303 |
CMP_ZIPS=true |
|
42506
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
1304 |
CMP_ZIPS_CONTENTS=true |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
1305 |
;; |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
1306 |
-zips-names) |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
1307 |
CMP_ZIPS=true |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
1308 |
CMP_ZIPS_CONTENTS=false |
14111 | 1309 |
;; |
1310 |
-jars) |
|
1311 |
CMP_JARS=true |
|
1312 |
;; |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1313 |
-jmods) |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1314 |
CMP_JMODS=true |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1315 |
;; |
14111 | 1316 |
-libs) |
1317 |
CMP_LIBS=true |
|
1318 |
;; |
|
1319 |
-execs) |
|
1320 |
CMP_EXECS=true |
|
1321 |
;; |
|
25854 | 1322 |
-2dirs) |
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1323 |
THIS="$(cd "$2" > /dev/null && pwd )" |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1324 |
OTHER="$(cd "$3" > /dev/null && pwd )" |
25854 | 1325 |
THIS_BASE_DIR="$THIS" |
1326 |
OTHER_BASE_DIR="$OTHER" |
|
1327 |
SKIP_DEFAULT=true |
|
1328 |
shift |
|
1329 |
shift |
|
1330 |
;; |
|
15179
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1331 |
-2zips) |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1332 |
CMP_2_ZIPS=true |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1333 |
THIS_FILE=$2 |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1334 |
OTHER_FILE=$3 |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1335 |
shift |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1336 |
shift |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1337 |
;; |
25854 | 1338 |
-2bins) |
1339 |
CMP_2_BINS=true |
|
1340 |
THIS_FILE=$2 |
|
1341 |
OTHER_FILE=$3 |
|
1342 |
shift |
|
1343 |
shift |
|
1344 |
;; |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1345 |
--sort-symbols) |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1346 |
SORT_ALL_SYMBOLS=true |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1347 |
;; |
32811
df82db312e58
8135060: Stop building Xcode projects in install build
erikj
parents:
31310
diff
changeset
|
1348 |
--strip) |
df82db312e58
8135060: Stop building Xcode projects in install build
erikj
parents:
31310
diff
changeset
|
1349 |
STRIP_ALL=true |
df82db312e58
8135060: Stop building Xcode projects in install build
erikj
parents:
31310
diff
changeset
|
1350 |
;; |
35747 | 1351 |
--clean) |
1352 |
CLEAN_OUTPUT=true |
|
1353 |
;; |
|
14111 | 1354 |
*) |
1355 |
CMP_NAMES=false |
|
1356 |
CMP_PERMS=false |
|
1357 |
CMP_TYPES=false |
|
1358 |
CMP_ZIPS=true |
|
1359 |
CMP_JARS=true |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1360 |
CMP_JMODS=true |
14111 | 1361 |
CMP_LIBS=true |
1362 |
CMP_EXECS=true |
|
28356 | 1363 |
|
14111 | 1364 |
if [ -z "$FILTER" ]; then |
1365 |
FILTER="$GREP" |
|
1366 |
fi |
|
1367 |
FILTER="$FILTER -e $1" |
|
1368 |
;; |
|
1369 |
esac |
|
1370 |
shift |
|
1371 |
done |
|
1372 |
||
35747 | 1373 |
if [ "$STRIP_ALL" = "true" ] && [ -z "$STRIP" ]; then |
1374 |
echo Warning: Not stripping even with --strip, since strip is missing on this platform |
|
1375 |
STRIP_ALL=false |
|
1376 |
fi |
|
1377 |
||
48912 | 1378 |
COMPARE_ROOT=$OUTPUTDIR/compare-support |
35747 | 1379 |
if [ "$CLEAN_OUTPUT" = "true" ]; then |
1380 |
echo Cleaning old output in $COMPARE_ROOT. |
|
1381 |
$RM -rf $COMPARE_ROOT |
|
1382 |
fi |
|
1383 |
$MKDIR -p $COMPARE_ROOT |
|
1384 |
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
|
1385 |
if [ "$(uname -o)" = "Cygwin" ]; then |
|
1386 |
COMPARE_ROOT=$(cygpath -msa $COMPARE_ROOT) |
|
1387 |
fi |
|
1388 |
fi |
|
1389 |
||
15179
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1390 |
if [ "$CMP_2_ZIPS" = "true" ]; then |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1391 |
THIS_DIR="$(dirname $THIS_FILE)" |
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1392 |
THIS_DIR="$(cd "$THIS_DIR" > /dev/null && pwd )" |
15179
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1393 |
OTHER_DIR="$(dirname $OTHER_FILE)" |
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1394 |
OTHER_DIR="$(cd "$OTHER_DIR" > /dev/null && pwd )" |
15179
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1395 |
THIS_FILE_NAME="$(basename $THIS_FILE)" |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1396 |
OTHER_FILE_NAME="$(basename $OTHER_FILE)" |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1397 |
echo Comparing $THIS_DIR/$THIS_FILE_NAME and $OTHER_DIR/$OTHER_FILE_NAME |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1398 |
compare_zip_file $THIS_DIR $OTHER_DIR $COMPARE_ROOT/2zips $THIS_FILE_NAME $OTHER_FILE_NAME |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1399 |
exit |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1400 |
fi |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1401 |
|
25854 | 1402 |
if [ "$CMP_2_BINS" = "true" ]; then |
1403 |
THIS_DIR="$(dirname $THIS_FILE)" |
|
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1404 |
THIS_DIR="$(cd "$THIS_DIR" > /dev/null && pwd )" |
25854 | 1405 |
OTHER_DIR="$(dirname $OTHER_FILE)" |
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1406 |
OTHER_DIR="$(cd "$OTHER_DIR" > /dev/null && pwd )" |
25854 | 1407 |
THIS_FILE_NAME="$(basename $THIS_FILE)" |
1408 |
OTHER_FILE_NAME="$(basename $OTHER_FILE)" |
|
1409 |
echo Comparing $THIS_DIR/$THIS_FILE_NAME and $OTHER_DIR/$OTHER_FILE_NAME |
|
1410 |
compare_bin_file $THIS_DIR $OTHER_DIR $COMPARE_ROOT/2bins $THIS_FILE_NAME $OTHER_FILE_NAME |
|
1411 |
exit |
|
1412 |
fi |
|
1413 |
||
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1414 |
if [ "$CMP_NAMES" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1415 |
&& [ "$CMP_TYPES" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1416 |
&& [ "$CMP_PERMS" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1417 |
&& [ "$CMP_GENERAL" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1418 |
&& [ "$CMP_ZIPS" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1419 |
&& [ "$CMP_JARS" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1420 |
&& [ "$CMP_JMODS" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1421 |
&& [ "$CMP_LIBS" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1422 |
&& [ "$CMP_EXECS" = "false" ]; then |
14111 | 1423 |
CMP_NAMES=true |
1424 |
CMP_PERMS=true |
|
1425 |
CMP_TYPES=true |
|
1426 |
CMP_GENERAL=true |
|
1427 |
CMP_ZIPS=true |
|
1428 |
CMP_JARS=true |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1429 |
CMP_JMODS=true |
14111 | 1430 |
CMP_LIBS=true |
1431 |
CMP_EXECS=true |
|
1432 |
fi |
|
1433 |
||
1434 |
if [ -z "$FILTER" ]; then |
|
1435 |
FILTER="$CAT" |
|
1436 |
fi |
|
1437 |
||
25854 | 1438 |
if [ "$SKIP_DEFAULT" != "true" ]; then |
1439 |
if [ -z "$OTHER" ]; then |
|
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
1440 |
echo "Nothing to compare to, set with -o" |
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
1441 |
exit 1 |
25854 | 1442 |
else |
1443 |
if [ ! -d "$OTHER" ]; then |
|
1444 |
echo "Other build directory does not exist:" |
|
1445 |
echo "$OTHER" |
|
1446 |
exit 1 |
|
1447 |
fi |
|
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1448 |
OTHER="$( cd "$OTHER" > /dev/null && pwd )" |
25854 | 1449 |
echo "Comparing to:" |
14111 | 1450 |
echo "$OTHER" |
25854 | 1451 |
echo |
14111 | 1452 |
fi |
1453 |
||
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
1454 |
# Find the common images to compare, prioritizing later build stages |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1455 |
if [ -d "$THIS/images/jdk" ] && [ -d "$OTHER/images/jdk" ]; then |
29157 | 1456 |
THIS_JDK="$THIS/images/jdk" |
1457 |
OTHER_JDK="$OTHER/images/jdk" |
|
49291 | 1458 |
echo "Selecting normal images for JDK compare" |
42288
600cfdaa270a
8170576: Silence error message in compare.sh when selecting images
ihse
parents:
41949
diff
changeset
|
1459 |
elif [ -d "$(ls -d $THIS/licensee-src/build/*/images/jdk 2> /dev/null)" ] \ |
600cfdaa270a
8170576: Silence error message in compare.sh when selecting images
ihse
parents:
41949
diff
changeset
|
1460 |
&& [ -d "$(ls -d $OTHER/licensee-src/build/*/images/jdk 2> /dev/null)" ] |
39204 | 1461 |
then |
1462 |
echo "Selecting licensee images for compare" |
|
1463 |
# Simply override the THIS and OTHER dir with the build dir from |
|
1464 |
# the nested licensee source build for the rest of the script |
|
1465 |
# execution. |
|
1466 |
OLD_THIS="$THIS" |
|
1467 |
OLD_OTHER="$OTHER" |
|
1468 |
THIS="$(ls -d $THIS/licensee-src/build/*)" |
|
1469 |
OTHER="$(ls -d $OTHER/licensee-src/build/*)" |
|
1470 |
THIS_JDK="$THIS/images/jdk" |
|
1471 |
OTHER_JDK="$OTHER/images/jdk" |
|
1472 |
# Rewrite the path to tools that are used from the build |
|
1473 |
JIMAGE="$(echo "$JIMAGE" | $SED "s|$OLD_THIS|$THIS|g")" |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1474 |
JMOD="$(echo "$JMOD" | $SED "s|$OLD_THIS|$THIS|g")" |
39204 | 1475 |
JAVAP="$(echo "$JAVAP" | $SED "s|$OLD_THIS|$THIS|g")" |
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
1476 |
else |
28356 | 1477 |
echo "No common images found." |
1478 |
exit 1 |
|
14111 | 1479 |
fi |
31310 | 1480 |
echo " $THIS_JDK" |
1481 |
echo " $OTHER_JDK" |
|
14111 | 1482 |
|
31310 | 1483 |
if [ -d "$THIS/images/jdk-bundle" -o -d "$THIS/deploy/images/jdk-bundle" ] \ |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1484 |
&& [ -d "$OTHER/images/jdk-bundle" -o -d "$OTHER/deploy/images/jdk-bundle" ]; then |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1485 |
if [ -d "$THIS/deploy/images/jdk-bundle" ]; then |
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1486 |
THIS_JDK_BUNDLE="$THIS/deploy/images/jdk-bundle" |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1487 |
else |
31310 | 1488 |
THIS_JDK_BUNDLE="$THIS/images/jdk-bundle" |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1489 |
fi |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1490 |
if [ -d "$OTHER/deploy/images/jdk-bundle" ]; then |
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1491 |
OTHER_JDK_BUNDLE="$OTHER/deploy/images/jdk-bundle" |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1492 |
else |
31310 | 1493 |
OTHER_JDK_BUNDLE="$OTHER/images/jdk-bundle" |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1494 |
fi |
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1495 |
echo "Also comparing jdk macosx bundles" |
31310 | 1496 |
echo " $THIS_JDK_BUNDLE" |
1497 |
echo " $OTHER_JDK_BUNDLE" |
|
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
1498 |
fi |
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
1499 |
|
50928
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1500 |
THIS_SEC_DIR="$THIS/images" |
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1501 |
OTHER_SEC_DIR="$OTHER/images" |
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1502 |
if [ -f "$THIS_SEC_DIR/sec-bin.zip" ] && [ -f "$OTHER_SEC_DIR/sec-bin.zip" ]; then |
49291 | 1503 |
OTHER_SEC_BIN="$OTHER_SEC_DIR/sec-bin.zip" |
1504 |
THIS_SEC_BIN="$THIS_SEC_DIR/sec-bin.zip" |
|
50928
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1505 |
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1506 |
if [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then |
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1507 |
JGSS_WINDOWS_BIN="jgss-windows-x64-bin.zip" |
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1508 |
else |
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1509 |
JGSS_WINDOWS_BIN="jgss-windows-i586-bin.zip" |
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1510 |
fi |
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1511 |
OTHER_SEC_WINDOWS_BIN="$OTHER_SEC_DIR/sec-windows-bin.zip" |
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1512 |
OTHER_JGSS_WINDOWS_BIN="$OTHER_SEC_DIR/$JGSS_WINDOWS_BIN" |
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1513 |
THIS_SEC_WINDOWS_BIN="$THIS_SEC_DIR/sec-windows-bin.zip" |
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1514 |
THIS_JGSS_WINDOWS_BIN="$THIS_SEC_DIR/$JGSS_WINDOWS_BIN" |
25854 | 1515 |
fi |
1516 |
fi |
|
14466
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1517 |
|
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1518 |
if [ -d "$THIS/images/docs" ] && [ -d "$OTHER/images/docs" ]; then |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1519 |
THIS_DOCS="$THIS/images/docs" |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1520 |
OTHER_DOCS="$OTHER/images/docs" |
28356 | 1521 |
echo "Also comparing docs" |
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
1522 |
else |
25854 | 1523 |
echo "WARNING! Docs haven't been built and won't be compared." |
1524 |
fi |
|
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1525 |
|
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1526 |
if [ -d "$THIS/images/test" ] && [ -d "$OTHER/images/test" ]; then |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1527 |
THIS_TEST="$THIS/images/test" |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1528 |
OTHER_TEST="$OTHER/images/test" |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1529 |
echo "Also comparing test image" |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1530 |
else |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1531 |
echo "WARNING! Test haven't been built and won't be compared." |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1532 |
fi |
15063
16aa1979a584
8005723: build-infra: in new infra build, sec-windows-bin-zip and jgss-windows-*-bin.zip are missing
erikj
parents:
15062
diff
changeset
|
1533 |
fi |
15062 | 1534 |
|
29157 | 1535 |
################################################################################ |
14111 | 1536 |
# Do the work |
1537 |
||
1538 |
if [ "$CMP_NAMES" = "true" ]; then |
|
29157 | 1539 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
1540 |
echo -n "JDK " |
|
1541 |
compare_dirs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
|
49291 | 1542 |
echo -n "JDK " |
1543 |
compare_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
|
1544 |
fi |
|
29157 | 1545 |
if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then |
1546 |
echo -n "JDK Bundle " |
|
1547 |
compare_dirs $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle |
|
28356 | 1548 |
|
29157 | 1549 |
echo -n "JDK Bundle " |
1550 |
compare_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle |
|
14111 | 1551 |
fi |
14466
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1552 |
if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1553 |
echo -n "Docs " |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1554 |
compare_dirs $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1555 |
echo -n "Docs " |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1556 |
compare_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1557 |
fi |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1558 |
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1559 |
echo -n "Test " |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1560 |
compare_dirs $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1561 |
echo -n "Test " |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1562 |
compare_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1563 |
fi |
25854 | 1564 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
1565 |
compare_dirs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
|
1566 |
compare_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
|
1567 |
fi |
|
14111 | 1568 |
fi |
1569 |
||
49291 | 1570 |
if [ "$CMP_LIBS" = "true" ]; then |
29157 | 1571 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
1572 |
echo -n "JDK " |
|
49291 | 1573 |
compare_all_libs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
14111 | 1574 |
fi |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1575 |
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1576 |
echo -n "Test " |
55018
ecb7b9a98f0e
8224145: Build compare script fails intermittently on test image native libraries
erikj
parents:
54325
diff
changeset
|
1577 |
STRIP_ALL_bak="$STRIP_ALL" |
ecb7b9a98f0e
8224145: Build compare script fails intermittently on test image native libraries
erikj
parents:
54325
diff
changeset
|
1578 |
if [ "$STRIP_TESTS_BEFORE_COMPARE" = "true" ]; then |
ecb7b9a98f0e
8224145: Build compare script fails intermittently on test image native libraries
erikj
parents:
54325
diff
changeset
|
1579 |
STRIP_ALL="true" |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1580 |
fi |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1581 |
compare_all_libs $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test |
55018
ecb7b9a98f0e
8224145: Build compare script fails intermittently on test image native libraries
erikj
parents:
54325
diff
changeset
|
1582 |
STRIP_ALL="$STRIP_ALL_bak" |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1583 |
fi |
25854 | 1584 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
49291 | 1585 |
compare_all_libs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
25854 | 1586 |
fi |
14111 | 1587 |
fi |
1588 |
||
49291 | 1589 |
if [ "$CMP_EXECS" = "true" ]; then |
29157 | 1590 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1591 |
echo -n "JDK " |
49291 | 1592 |
compare_all_execs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
14111 | 1593 |
fi |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1594 |
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1595 |
echo -n "Test " |
55018
ecb7b9a98f0e
8224145: Build compare script fails intermittently on test image native libraries
erikj
parents:
54325
diff
changeset
|
1596 |
STRIP_ALL_bak="$STRIP_ALL" |
ecb7b9a98f0e
8224145: Build compare script fails intermittently on test image native libraries
erikj
parents:
54325
diff
changeset
|
1597 |
if [ "$STRIP_TESTS_BEFORE_COMPARE" = "true" ]; then |
ecb7b9a98f0e
8224145: Build compare script fails intermittently on test image native libraries
erikj
parents:
54325
diff
changeset
|
1598 |
STRIP_ALL="true" |
ecb7b9a98f0e
8224145: Build compare script fails intermittently on test image native libraries
erikj
parents:
54325
diff
changeset
|
1599 |
fi |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1600 |
compare_all_execs $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test |
55018
ecb7b9a98f0e
8224145: Build compare script fails intermittently on test image native libraries
erikj
parents:
54325
diff
changeset
|
1601 |
STRIP_ALL="$STRIP_ALL_bak" |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1602 |
fi |
25854 | 1603 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
49291 | 1604 |
compare_all_execs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
25854 | 1605 |
fi |
14111 | 1606 |
fi |
1607 |
||
1608 |
if [ "$CMP_GENERAL" = "true" ]; then |
|
29157 | 1609 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
1610 |
echo -n "JDK " |
|
1611 |
compare_general_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
|
49291 | 1612 |
fi |
29157 | 1613 |
if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then |
1614 |
echo -n "JDK Bundle " |
|
1615 |
compare_general_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle |
|
14111 | 1616 |
fi |
14466
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1617 |
if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1618 |
echo -n "Docs " |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1619 |
compare_general_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1620 |
fi |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1621 |
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1622 |
echo -n "Test " |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1623 |
compare_general_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1624 |
fi |
25854 | 1625 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
1626 |
compare_general_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
|
1627 |
fi |
|
14111 | 1628 |
fi |
1629 |
||
1630 |
if [ "$CMP_ZIPS" = "true" ]; then |
|
29157 | 1631 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1632 |
echo -n "JDK " |
29157 | 1633 |
compare_all_zip_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
14111 | 1634 |
fi |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1635 |
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1636 |
echo -n "Test " |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1637 |
compare_all_zip_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1638 |
fi |
15062 | 1639 |
if [ -n "$THIS_SEC_BIN" ] && [ -n "$OTHER_SEC_BIN" ]; then |
1640 |
if [ -n "$(echo $THIS_SEC_BIN | $FILTER)" ]; then |
|
1641 |
echo "sec-bin.zip..." |
|
15068
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1642 |
compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin sec-bin.zip |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1643 |
fi |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1644 |
fi |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1645 |
if [ -n "$THIS_SEC_WINDOWS_BIN" ] && [ -n "$OTHER_SEC_WINDOWS_BIN" ]; then |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1646 |
if [ -n "$(echo $THIS_SEC_WINDOWS_BIN | $FILTER)" ]; then |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1647 |
echo "sec-windows-bin.zip..." |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1648 |
compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin sec-windows-bin.zip |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1649 |
fi |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1650 |
fi |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1651 |
if [ -n "$THIS_JGSS_WINDOWS_BIN" ] && [ -n "$OTHER_JGSS_WINDOWS_BIN" ]; then |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1652 |
if [ -n "$(echo $THIS_JGSS_WINDOWS_BIN | $FILTER)" ]; then |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1653 |
echo "$JGSS_WINDOWS_BIN..." |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1654 |
compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin $JGSS_WINDOWS_BIN |
15062 | 1655 |
fi |
1656 |
fi |
|
25854 | 1657 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
1658 |
compare_all_zip_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
|
1659 |
fi |
|
14111 | 1660 |
fi |
1661 |
||
1662 |
if [ "$CMP_JARS" = "true" ]; then |
|
29157 | 1663 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1664 |
echo -n "JDK " |
29157 | 1665 |
compare_all_jar_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
14111 | 1666 |
fi |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1667 |
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1668 |
echo -n "Test " |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1669 |
compare_all_jar_files $THIS_TEST $OTHER_TEST $COMPARE_ROOT/test |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1670 |
fi |
25854 | 1671 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
1672 |
compare_all_jar_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
|
1673 |
fi |
|
14111 | 1674 |
fi |
1675 |
||
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1676 |
if [ "$CMP_JMODS" = "true" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1677 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1678 |
compare_all_jmod_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1679 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1680 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1681 |
compare_all_jmod_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1682 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1683 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1684 |
|
49291 | 1685 |
if [ "$CMP_PERMS" = "true" ]; then |
29157 | 1686 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
1687 |
echo -n "JDK " |
|
49291 | 1688 |
compare_permissions $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
1689 |
fi |
|
25854 | 1690 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
49291 | 1691 |
compare_permissions $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
25854 | 1692 |
fi |
14111 | 1693 |
fi |
1694 |
||
49291 | 1695 |
if [ "$CMP_TYPES" = "true" ]; then |
29157 | 1696 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
49291 | 1697 |
echo -n "JDK " |
1698 |
compare_file_types $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
|
1699 |
fi |
|
1700 |
if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then |
|
1701 |
echo -n "JDK Bundle " |
|
1702 |
compare_file_types $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle |
|
14111 | 1703 |
fi |
54325
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1704 |
if [ -n "$THIS_TEST" ] && [ -n "$OTHER_TEST" ]; then |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1705 |
echo -n "Test " |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1706 |
compare_file_types $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
04f1a0f925db
8220530: Build compare script does not compare the contents of the test image
erikj
parents:
53570
diff
changeset
|
1707 |
fi |
25854 | 1708 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
49291 | 1709 |
compare_file_types $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
25854 | 1710 |
fi |
14111 | 1711 |
fi |
1712 |
||
1713 |
echo |
|
1714 |
||
1715 |
if [ -n "$REGRESSIONS" ]; then |
|
1716 |
echo "REGRESSIONS FOUND!" |
|
1717 |
echo |
|
1718 |
exit 1 |
|
1719 |
else |
|
1720 |
echo "No regressions found" |
|
1721 |
echo |
|
1722 |
exit 0 |
|
1723 |
fi |