author | gadams |
Mon, 04 Mar 2019 08:45:05 -0500 | |
changeset 53988 | efa9bc147d50 |
parent 53570 | ab7fcc43dab4 |
child 54325 | 04f1a0f925db |
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 |
29157 | 205 |
# Some javadoc versions do not put quotes around font size |
206 |
HTML_FILTER="$SED \ |
|
207 |
-e 's/<font size=-1>/<font size=\"-1\">/g'" |
|
208 |
$CAT $THIS_FILE | eval "$HTML_FILTER" > $THIS_FILE.filtered |
|
209 |
$CAT $OTHER_FILE | eval "$HTML_FILTER" > $OTHER_FILE.filtered |
|
210 |
TMP=$(LC_ALL=C $DIFF $OTHER_FILE.filtered $THIS_FILE.filtered | \ |
|
25854 | 211 |
$GREP '^[<>]' | \ |
29157 | 212 |
$SED -e '/[<>] <!-- Generated by javadoc .* on .* -->/d' \ |
213 |
-e '/[<>] <meta name="date" content=".*">/d' ) |
|
14111 | 214 |
fi |
215 |
if test -n "$TMP"; then |
|
216 |
echo Files $OTHER_FILE and $THIS_FILE differ |
|
217 |
return 1 |
|
218 |
fi |
|
219 |
||
220 |
return 0 |
|
221 |
} |
|
222 |
||
29157 | 223 |
################################################################################ |
14111 | 224 |
# Compare directory structure |
225 |
||
226 |
compare_dirs() { |
|
227 |
THIS_DIR=$1 |
|
228 |
OTHER_DIR=$2 |
|
229 |
WORK_DIR=$3 |
|
230 |
||
231 |
mkdir -p $WORK_DIR |
|
232 |
||
233 |
(cd $OTHER_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_other) |
|
234 |
(cd $THIS_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_this) |
|
235 |
||
25854 | 236 |
$DIFF $WORK_DIR/dirs_other $WORK_DIR/dirs_this > $WORK_DIR/dirs_diff |
28356 | 237 |
|
14111 | 238 |
echo -n Directory structure... |
239 |
if [ -s $WORK_DIR/dirs_diff ]; then |
|
240 |
echo Differences found. |
|
241 |
REGRESSIONS=true |
|
242 |
# Differences in directories found. |
|
243 |
ONLY_OTHER=$($GREP '<' $WORK_DIR/dirs_diff) |
|
244 |
if [ "$ONLY_OTHER" ]; then |
|
245 |
echo Only in $OTHER |
|
246 |
$GREP '<' $WORK_DIR/dirs_diff | $SED 's|< ./| |g' |
|
247 |
fi |
|
248 |
ONLY_THIS=$($GREP '>' $WORK_DIR/dirs_diff) |
|
249 |
if [ "$ONLY_THIS" ]; then |
|
250 |
echo Only in $THIS |
|
251 |
$GREP '>' $WORK_DIR/dirs_diff | $SED 's|> ./| |g' |
|
252 |
fi |
|
253 |
else |
|
254 |
echo Identical! |
|
255 |
fi |
|
256 |
} |
|
257 |
||
258 |
||
29157 | 259 |
################################################################################ |
14111 | 260 |
# Compare file structure |
261 |
||
262 |
compare_files() { |
|
263 |
THIS_DIR=$1 |
|
264 |
OTHER_DIR=$2 |
|
265 |
WORK_DIR=$3 |
|
266 |
||
267 |
$MKDIR -p $WORK_DIR |
|
268 |
||
269 |
(cd $OTHER_DIR && $FIND . ! -type d | $SORT > $WORK_DIR/files_other) |
|
270 |
(cd $THIS_DIR && $FIND . ! -type d | $SORT > $WORK_DIR/files_this) |
|
28356 | 271 |
|
14111 | 272 |
$DIFF $WORK_DIR/files_other $WORK_DIR/files_this > $WORK_DIR/files_diff |
273 |
||
274 |
echo -n File names... |
|
275 |
if [ -s $WORK_DIR/files_diff ]; then |
|
276 |
echo Differences found. |
|
277 |
REGRESSIONS=true |
|
278 |
# Differences in files found. |
|
279 |
ONLY_OTHER=$($GREP '<' $WORK_DIR/files_diff) |
|
280 |
if [ "$ONLY_OTHER" ]; then |
|
281 |
echo Only in $OTHER |
|
282 |
$GREP '<' $WORK_DIR/files_diff | $SED 's|< ./| |g' |
|
283 |
fi |
|
284 |
ONLY_THIS=$($GREP '>' $WORK_DIR/files_diff) |
|
285 |
if [ "$ONLY_THIS" ]; then |
|
286 |
echo Only in $THIS |
|
287 |
$GREP '>' $WORK_DIR/files_diff | $SED 's|> ./| |g' |
|
288 |
fi |
|
289 |
else |
|
290 |
echo Identical! |
|
291 |
fi |
|
292 |
} |
|
293 |
||
294 |
||
29157 | 295 |
################################################################################ |
14111 | 296 |
# Compare permissions |
297 |
||
298 |
compare_permissions() { |
|
299 |
THIS_DIR=$1 |
|
300 |
OTHER_DIR=$2 |
|
301 |
WORK_DIR=$3 |
|
302 |
||
303 |
mkdir -p $WORK_DIR |
|
304 |
||
305 |
echo -n Permissions... |
|
306 |
found="" |
|
307 |
for f in `cd $OTHER_DIR && $FIND . -type f` |
|
308 |
do |
|
309 |
if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi |
|
310 |
if [ ! -f ${THIS_DIR}/$f ]; then continue; fi |
|
311 |
OP=`ls -l ${OTHER_DIR}/$f | awk '{printf("%.10s\n", $1);}'` |
|
312 |
TP=`ls -l ${THIS_DIR}/$f | awk '{printf("%.10s\n", $1);}'` |
|
313 |
if [ "$OP" != "$TP" ] |
|
314 |
then |
|
28356 | 315 |
if [ -z "$found" ]; then echo ; found="yes"; fi |
316 |
$PRINTF "\tother: ${OP} this: ${TP}\t$f\n" |
|
14111 | 317 |
fi |
318 |
done |
|
28356 | 319 |
if [ -z "$found" ]; then |
14111 | 320 |
echo "Identical!" |
321 |
else |
|
322 |
REGRESSIONS=true |
|
323 |
fi |
|
324 |
} |
|
325 |
||
29157 | 326 |
################################################################################ |
14111 | 327 |
# Compare file command output |
328 |
||
329 |
compare_file_types() { |
|
330 |
THIS_DIR=$1 |
|
331 |
OTHER_DIR=$2 |
|
332 |
WORK_DIR=$3 |
|
333 |
||
334 |
$MKDIR -p $WORK_DIR |
|
335 |
||
37972 | 336 |
FILE_TYPES_FILTER="$SED \ |
337 |
-e 's/BuildID[^,]*//' \ |
|
338 |
-e 's/last modified: .*//' \ |
|
339 |
" |
|
340 |
||
14111 | 341 |
echo -n File types... |
342 |
found="" |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
343 |
# 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
|
344 |
# in different types being detected more or less randomly. |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
345 |
for f in $(cd $OTHER_DIR && $FIND . ! -type d -a ! -name "*.jmod") |
14111 | 346 |
do |
347 |
if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi |
|
348 |
if [ ! -f ${THIS_DIR}/$f ]; then continue; fi |
|
37972 | 349 |
OF=$(cd ${OTHER_DIR} && $FILE -h $f | eval $FILE_TYPES_FILTER) |
350 |
TF=$(cd ${THIS_DIR} && $FILE -h $f | eval $FILE_TYPES_FILTER) |
|
14111 | 351 |
if [ "$OF" != "$TF" ] |
352 |
then |
|
28356 | 353 |
if [ "`echo $OF | $GREP -c 'Zip archive data'`" -gt 0 ] \ |
354 |
&& [ "`echo $TF | $GREP -c 'Zip archive data'`" -gt 0 ] |
|
355 |
then |
|
356 |
# the way we produce zip-files make it so that directories are stored in |
|
357 |
# old file but not in new (only files with full-path) this makes file |
|
358 |
# report them as different |
|
359 |
continue |
|
360 |
else |
|
361 |
if [ -z "$found" ]; then echo ; found="yes"; fi |
|
362 |
$PRINTF "\tother: ${OF}\n\tthis : ${TF}\n" |
|
363 |
fi |
|
14111 | 364 |
fi |
365 |
done |
|
28356 | 366 |
if [ -z "$found" ]; then |
14111 | 367 |
echo "Identical!" |
368 |
else |
|
369 |
REGRESSIONS=true |
|
370 |
fi |
|
371 |
} |
|
372 |
||
29157 | 373 |
################################################################################ |
14111 | 374 |
# Compare the rest of the files |
375 |
||
376 |
compare_general_files() { |
|
377 |
THIS_DIR=$1 |
|
378 |
OTHER_DIR=$2 |
|
379 |
WORK_DIR=$3 |
|
28356 | 380 |
|
29157 | 381 |
GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" \ |
382 |
! -name "*.zip" ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \ |
|
36506 | 383 |
! -name "modules" ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \ |
29157 | 384 |
! -name "*.cpl" ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \ |
36506 | 385 |
! -name "*.lib" ! -name "*.war" ! -name "JavaControlPanel" ! -name "*.jmod" \ |
29157 | 386 |
! -name "*.obj" ! -name "*.o" ! -name "JavaControlPanelHelper" \ |
387 |
! -name "JavaUpdater" ! -name "JavaWSApplicationStub" \ |
|
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
388 |
! -name "jspawnhelper" ! -name "JavawsLauncher" ! -name "*.a" \ |
37972 | 389 |
! -name "finish_installation" ! -name "Sparkle" ! -name "*.tar.gz" \ |
52030
57862a02bf4b
8202951: Implementation of JEP 341: Default CDS Archives
jiangli
parents:
51781
diff
changeset
|
390 |
! -name "classes.jsa" \ |
14111 | 391 |
| $GREP -v "./bin/" | $SORT | $FILTER) |
392 |
||
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
393 |
echo Other files with binary differences... |
14111 | 394 |
for f in $GENERAL_FILES |
395 |
do |
|
396 |
if [ -e $OTHER_DIR/$f ]; then |
|
14466
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
397 |
SUFFIX="${f##*.}" |
14111 | 398 |
if [ "$(basename $f)" = "release" ]; then |
36789 | 399 |
# In release file, ignore differences in change numbers and order |
400 |
# of modules in list. |
|
14111 | 401 |
OTHER_FILE=$WORK_DIR/$f.other |
402 |
THIS_FILE=$WORK_DIR/$f.this |
|
403 |
$MKDIR -p $(dirname $OTHER_FILE) |
|
404 |
$MKDIR -p $(dirname $THIS_FILE) |
|
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
405 |
RELEASE_FILTER="$SED \ |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
406 |
-e 's/\:[0-9a-f]\{12,12\}/:CHANGE/g' \ |
36789 | 407 |
-e 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6\}/<DATE>/g' \ |
408 |
-e 's/^#.*/#COMMENT/g' \ |
|
409 |
-e 's/MODULES=/MODULES=\'$'\n/' \ |
|
410 |
-e 's/,/\'$'\n/g' \ |
|
411 |
| $SORT |
|
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
412 |
" |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
413 |
$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
|
414 |
$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
|
415 |
elif [ "x$SUFFIX" = "xhtml" ]; then |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
416 |
# Ignore time stamps in docs files |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
417 |
OTHER_FILE=$WORK_DIR/$f.other |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
418 |
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
|
419 |
$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
|
420 |
# 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
|
421 |
# these names. |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
422 |
$RM $OTHER_FILE $THIS_FILE |
15058
61c4ac49cbda
8005635: build-infra: Support building install in jprt
erikj
parents:
14466
diff
changeset
|
423 |
#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
|
424 |
HTML_FILTER="$SED \ |
47217 | 425 |
-e 's/20[0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}-[0-9]\{6,7\}/<DATE>/g' \ |
39112 | 426 |
-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
|
427 |
-e 's/\(-- Generated by javadoc \).*\( --\)/\1(removed)\2/' \ |
39112 | 428 |
-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>/' \ |
429 |
-e 's/from .*\.idl/\.idl/' \ |
|
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
430 |
" |
36789 | 431 |
$CAT $OTHER_DIR/$f | eval "$HTML_FILTER" > $OTHER_FILE & |
432 |
$CAT $THIS_DIR/$f | eval "$HTML_FILTER" > $THIS_FILE & |
|
433 |
wait |
|
41949 | 434 |
elif [[ "$f" = *"/lib/classlist" ]]; then |
39204 | 435 |
# The classlist files may have some lines in random order |
436 |
OTHER_FILE=$WORK_DIR/$f.other |
|
437 |
THIS_FILE=$WORK_DIR/$f.this |
|
438 |
$MKDIR -p $(dirname $OTHER_FILE) $(dirname $THIS_FILE) |
|
439 |
$RM $OTHER_FILE $THIS_FILE |
|
440 |
$CAT $OTHER_DIR/$f | $SORT > $OTHER_FILE |
|
441 |
$CAT $THIS_DIR/$f | $SORT > $THIS_FILE |
|
14111 | 442 |
else |
443 |
OTHER_FILE=$OTHER_DIR/$f |
|
444 |
THIS_FILE=$THIS_DIR/$f |
|
445 |
fi |
|
446 |
DIFF_OUT=$($DIFF $OTHER_FILE $THIS_FILE 2>&1) |
|
447 |
if [ -n "$DIFF_OUT" ]; then |
|
448 |
echo $f |
|
449 |
REGRESSIONS=true |
|
450 |
if [ "$SHOW_DIFFS" = "true" ]; then |
|
451 |
echo "$DIFF_OUT" |
|
452 |
fi |
|
453 |
fi |
|
454 |
fi |
|
455 |
done |
|
456 |
||
457 |
||
458 |
} |
|
459 |
||
29157 | 460 |
################################################################################ |
14111 | 461 |
# Compare zip file |
462 |
||
463 |
compare_zip_file() { |
|
464 |
THIS_DIR=$1 |
|
465 |
OTHER_DIR=$2 |
|
466 |
WORK_DIR=$3 |
|
467 |
ZIP_FILE=$4 |
|
15179
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
468 |
# 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
|
469 |
OTHER_ZIP_FILE=$5 |
14111 | 470 |
|
471 |
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
|
472 |
if [ -n "$OTHER_ZIP_FILE" ]; then |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
473 |
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
|
474 |
else |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
475 |
OTHER_ZIP=$OTHER_DIR/$ZIP_FILE |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
476 |
fi |
14111 | 477 |
|
478 |
THIS_SUFFIX="${THIS_ZIP##*.}" |
|
479 |
OTHER_SUFFIX="${OTHER_ZIP##*.}" |
|
480 |
if [ "$THIS_SUFFIX" != "$OTHER_SUFFIX" ]; then |
|
28356 | 481 |
echo "The files do not have the same suffix type! ($THIS_SUFFIX != $OTHER_SUFFIX)" |
14111 | 482 |
return 2 |
483 |
fi |
|
484 |
||
485 |
TYPE="$THIS_SUFFIX" |
|
486 |
||
487 |
if $CMP $OTHER_ZIP $THIS_ZIP > /dev/null |
|
488 |
then |
|
489 |
return 0 |
|
490 |
fi |
|
491 |
# Not quite identical, the might still contain the same data. |
|
492 |
# Unpack the jar/zip files in temp dirs |
|
28356 | 493 |
|
14111 | 494 |
THIS_UNZIPDIR=$WORK_DIR/$ZIP_FILE.this |
495 |
OTHER_UNZIPDIR=$WORK_DIR/$ZIP_FILE.other |
|
496 |
$RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR |
|
497 |
$MKDIR -p $THIS_UNZIPDIR |
|
498 |
$MKDIR -p $OTHER_UNZIPDIR |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
499 |
if [ "$TYPE" = "jar" -o "$TYPE" = "war" -o "$TYPE" = "zip" ] |
27560 | 500 |
then |
36506 | 501 |
(cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP) |
502 |
(cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP) |
|
37972 | 503 |
elif [ "$TYPE" = "gz" ] |
504 |
then |
|
505 |
(cd $THIS_UNZIPDIR && $GUNZIP -c $THIS_ZIP | $TAR xf -) |
|
506 |
(cd $OTHER_UNZIPDIR && $GUNZIP -c $OTHER_ZIP | $TAR xf -) |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
507 |
elif [ "$TYPE" = "jmod" ] |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
508 |
then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
509 |
(cd $THIS_UNZIPDIR && $JMOD extract $THIS_ZIP) |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
510 |
(cd $OTHER_UNZIPDIR && $JMOD extract $OTHER_ZIP) |
36506 | 511 |
else |
27560 | 512 |
(cd $THIS_UNZIPDIR && $JIMAGE extract $THIS_ZIP) |
513 |
(cd $OTHER_UNZIPDIR && $JIMAGE extract $OTHER_ZIP) |
|
514 |
fi |
|
14111 | 515 |
|
14280
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
516 |
# 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
|
517 |
# the archives. pie.jar.pack.gz i app3.war is corrupt, skip it. |
47217 | 518 |
EXCEPTIONS="pie.jar.pack.gz jdk.pack" |
519 |
for pack in $($FIND $THIS_UNZIPDIR \( -name "*.pack" -o -name "*.pack.gz" \) -a \ |
|
520 |
! -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
|
521 |
($UNPACK200 $pack $pack.jar) |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
522 |
# Filter out the unzipped archives from the diff below. |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
523 |
EXCEPTIONS="$EXCEPTIONS $pack $pack.jar" |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
524 |
done |
47217 | 525 |
for pack in $($FIND $OTHER_UNZIPDIR \( -name "*.pack" -o -name "*.pack.gz" \) -a \ |
526 |
! -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
|
527 |
($UNPACK200 $pack $pack.jar) |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
528 |
EXCEPTIONS="$EXCEPTIONS $pack $pack.jar" |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
529 |
done |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
530 |
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
|
531 |
$MKDIR $zip.unzip |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
532 |
(cd $zip.unzip && $UNARCHIVE $zip) |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
533 |
EXCEPTIONS="$EXCEPTIONS $zip" |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
534 |
done |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
535 |
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
|
536 |
$MKDIR $zip.unzip |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
537 |
(cd $zip.unzip && $UNARCHIVE $zip) |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
538 |
EXCEPTIONS="$EXCEPTIONS $zip" |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
539 |
done |
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
540 |
|
14111 | 541 |
CONTENTS_DIFF_FILE=$WORK_DIR/$ZIP_FILE.diff |
542 |
# On solaris, there is no -q option. |
|
543 |
if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then |
|
20049 | 544 |
LC_ALL=C $DIFF -r $OTHER_UNZIPDIR $THIS_UNZIPDIR \ |
14111 | 545 |
| $GREP -v -e "^<" -e "^>" -e "^Common subdirectories:" \ |
546 |
> $CONTENTS_DIFF_FILE |
|
547 |
else |
|
20049 | 548 |
LC_ALL=C $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE |
14111 | 549 |
fi |
550 |
||
551 |
ONLY_OTHER=$($GREP "^Only in $OTHER_UNZIPDIR" $CONTENTS_DIFF_FILE) |
|
552 |
ONLY_THIS=$($GREP "^Only in $THIS_UNZIPDIR" $CONTENTS_DIFF_FILE) |
|
553 |
||
554 |
return_value=0 |
|
555 |
||
556 |
if [ -n "$ONLY_OTHER" ]; then |
|
557 |
echo " Only OTHER $ZIP_FILE contains:" |
|
558 |
echo "$ONLY_OTHER" | sed "s|Only in $OTHER_UNZIPDIR| |"g | sed 's|: |/|g' |
|
559 |
return_value=1 |
|
560 |
fi |
|
561 |
||
562 |
if [ -n "$ONLY_THIS" ]; then |
|
563 |
echo " Only THIS $ZIP_FILE contains:" |
|
564 |
echo "$ONLY_THIS" | sed "s|Only in $THIS_UNZIPDIR| |"g | sed 's|: |/|g' |
|
565 |
return_value=1 |
|
566 |
fi |
|
567 |
||
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
568 |
if [ "$CMP_ZIPS_CONTENTS" = "true" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
569 |
if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
570 |
DIFFING_FILES=$($GREP -e 'differ$' -e '^diff ' $CONTENTS_DIFF_FILE \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
571 |
| $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
|
572 |
| $SED "s|$OTHER_UNZIPDIR/||g") |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
573 |
else |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
574 |
DIFFING_FILES=$($GREP -e "differ$" $CONTENTS_DIFF_FILE \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
575 |
| $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g") |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
576 |
fi |
14111 | 577 |
|
42506
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
578 |
$RM -f $WORK_DIR/$ZIP_FILE.diffs |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
579 |
for file in $DIFFING_FILES; do |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
580 |
if [[ "$ACCEPTED_JARZIP_CONTENTS $EXCEPTIONS" != *"$file"* ]]; then |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
581 |
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
|
582 |
fi |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
583 |
done |
14111 | 584 |
|
42506
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
585 |
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
|
586 |
return_value=1 |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
587 |
echo " Differing files in $ZIP_FILE" |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
588 |
$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
|
589 |
$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
|
590 |
$CAT $WORK_DIR/$ZIP_FILE.difflist |
14111 | 591 |
|
42506
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
592 |
if [ -n "$SHOW_DIFFS" ]; then |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
593 |
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
|
594 |
if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
595 |
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
|
596 |
elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
597 |
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
|
598 |
else |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
599 |
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
|
600 |
fi |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
601 |
done |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
602 |
fi |
14111 | 603 |
fi |
604 |
fi |
|
605 |
||
606 |
return $return_value |
|
607 |
} |
|
608 |
||
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
609 |
################################################################################ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
610 |
# Compare jmod file |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
611 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
612 |
compare_jmod_file() { |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
613 |
THIS_DIR=$1 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
614 |
OTHER_DIR=$2 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
615 |
WORK_DIR=$3 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
616 |
JMOD_FILE=$4 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
617 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
618 |
THIS_JMOD=$THIS_DIR/$JMOD_FILE |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
619 |
OTHER_JMOD=$OTHER_DIR/$JMOD_FILE |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
620 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
621 |
if $CMP $OTHER_JMOD $THIS_JMOD > /dev/null; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
622 |
return 0 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
623 |
fi |
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_LIST=$WORK_DIR/$JMOD_FILE.list.this |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
626 |
OTHER_JMOD_LIST=$WORK_DIR/$JMOD_FILE.list.other |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
627 |
mkdir -p $(dirname $THIS_JMOD_LIST) $(dirname $OTHER_JMOD_LIST) |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
628 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
629 |
$JMOD list $THIS_JMOD | sort > $THIS_JMOD_LIST |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
630 |
$JMOD list $OTHER_JMOD | sort > $OTHER_JMOD_LIST |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
631 |
JMOD_LIST_DIFF_FILE=$WORK_DIR/$JMOD_FILE.list.diff |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
632 |
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
|
633 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
634 |
ONLY_THIS=$($GREP "^<" $JMOD_LIST_DIFF_FILE) |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
635 |
ONLY_OTHER=$($GREP "^>" $JMOD_LIST_DIFF_FILE) |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
636 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
637 |
if [ -n "$ONLY_OTHER" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
638 |
echo " Only OTHER $JMOD_FILE contains:" |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
639 |
echo "$ONLY_OTHER" | sed "s|^>| |"g | sed 's|: |/|g' |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
640 |
return_value=1 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
641 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
642 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
643 |
if [ -n "$ONLY_THIS" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
644 |
echo " Only THIS $JMOD_FILE contains:" |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
645 |
echo "$ONLY_THIS" | sed "s|^<| |"g | sed 's|: |/|g' |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
646 |
return_value=1 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
647 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
648 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
649 |
return $return_value |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
650 |
} |
14111 | 651 |
|
29157 | 652 |
################################################################################ |
14111 | 653 |
# Compare all zip files |
654 |
||
655 |
compare_all_zip_files() { |
|
656 |
THIS_DIR=$1 |
|
657 |
OTHER_DIR=$2 |
|
658 |
WORK_DIR=$3 |
|
659 |
||
37972 | 660 |
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" -o -name "*.tar.gz" \ |
661 |
| $SORT | $FILTER ) |
|
14111 | 662 |
|
663 |
if [ -n "$ZIPS" ]; then |
|
37972 | 664 |
echo Zip/tar.gz files... |
14111 | 665 |
|
666 |
return_value=0 |
|
667 |
for f in $ZIPS; do |
|
668 |
if [ -f "$OTHER_DIR/$f" ]; then |
|
669 |
compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f |
|
670 |
if [ "$?" != "0" ]; then |
|
671 |
return_value=1 |
|
672 |
REGRESSIONS=true |
|
673 |
fi |
|
674 |
fi |
|
675 |
done |
|
676 |
fi |
|
677 |
||
678 |
return $return_value |
|
679 |
} |
|
680 |
||
29157 | 681 |
################################################################################ |
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
682 |
# Compare all jmod files |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
683 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
684 |
compare_all_jmod_files() { |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
685 |
THIS_DIR=$1 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
686 |
OTHER_DIR=$2 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
687 |
WORK_DIR=$3 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
688 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
689 |
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
|
690 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
691 |
if [ -n "$JMODS" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
692 |
echo Jmod files... |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
693 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
694 |
return_value=0 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
695 |
for f in $JMODS; do |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
696 |
if [ -f "$OTHER_DIR/$f" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
697 |
compare_jmod_file $THIS_DIR $OTHER_DIR $WORK_DIR $f |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
698 |
if [ "$?" != "0" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
699 |
return_value=1 |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
700 |
REGRESSIONS=true |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
701 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
702 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
703 |
done |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
704 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
705 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
706 |
return $return_value |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
707 |
} |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
708 |
|
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
709 |
################################################################################ |
14111 | 710 |
# Compare all jar files |
711 |
||
712 |
compare_all_jar_files() { |
|
713 |
THIS_DIR=$1 |
|
714 |
OTHER_DIR=$2 |
|
715 |
WORK_DIR=$3 |
|
716 |
||
717 |
# TODO filter? |
|
25854 | 718 |
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.jar" -o -name "*.war" \ |
36789 | 719 |
-o -name "modules" | $SORT | $FILTER) |
14111 | 720 |
|
721 |
if [ -n "$ZIPS" ]; then |
|
722 |
echo Jar files... |
|
723 |
||
724 |
return_value=0 |
|
725 |
for f in $ZIPS; do |
|
726 |
if [ -f "$OTHER_DIR/$f" ]; then |
|
727 |
compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f |
|
728 |
if [ "$?" != "0" ]; then |
|
729 |
return_value=1 |
|
730 |
REGRESSIONS=true |
|
731 |
fi |
|
732 |
fi |
|
733 |
done |
|
734 |
fi |
|
735 |
||
736 |
return $return_value |
|
737 |
} |
|
738 |
||
29157 | 739 |
################################################################################ |
14111 | 740 |
# Compare binary (executable/library) file |
741 |
||
742 |
compare_bin_file() { |
|
743 |
THIS_DIR=$1 |
|
744 |
OTHER_DIR=$2 |
|
745 |
WORK_DIR=$3 |
|
746 |
BIN_FILE=$4 |
|
25854 | 747 |
OTHER_BIN_FILE=$5 |
14111 | 748 |
|
749 |
THIS_FILE=$THIS_DIR/$BIN_FILE |
|
25854 | 750 |
if [ -n "$OTHER_BIN_FILE" ]; then |
751 |
OTHER_FILE=$OTHER_DIR/$OTHER_BIN_FILE |
|
752 |
else |
|
753 |
OTHER_FILE=$OTHER_DIR/$BIN_FILE |
|
754 |
fi |
|
14111 | 755 |
NAME=$(basename $BIN_FILE) |
756 |
WORK_FILE_BASE=$WORK_DIR/$BIN_FILE |
|
757 |
FILE_WORK_DIR=$(dirname $WORK_FILE_BASE) |
|
758 |
||
759 |
$MKDIR -p $FILE_WORK_DIR |
|
760 |
||
28356 | 761 |
# Make soft links to original files from work dir to facilitate debugging |
762 |
$LN -f -s $THIS_FILE $WORK_FILE_BASE.this |
|
763 |
$LN -f -s $OTHER_FILE $WORK_FILE_BASE.other |
|
764 |
||
14111 | 765 |
ORIG_THIS_FILE="$THIS_FILE" |
766 |
ORIG_OTHER_FILE="$OTHER_FILE" |
|
767 |
||
32811
df82db312e58
8135060: Stop building Xcode projects in install build
erikj
parents:
31310
diff
changeset
|
768 |
if [ "$STRIP_ALL" = "true" ] || [[ "$STRIP_BEFORE_COMPARE" = *"$BIN_FILE"* ]]; then |
14111 | 769 |
THIS_STRIPPED_FILE=$FILE_WORK_DIR/this/$NAME |
770 |
OTHER_STRIPPED_FILE=$FILE_WORK_DIR/other/$NAME |
|
771 |
$MKDIR -p $FILE_WORK_DIR/this $FILE_WORK_DIR/other |
|
772 |
$CP $THIS_FILE $THIS_STRIPPED_FILE |
|
773 |
$CP $OTHER_FILE $OTHER_STRIPPED_FILE |
|
774 |
$STRIP $THIS_STRIPPED_FILE |
|
775 |
$STRIP $OTHER_STRIPPED_FILE |
|
776 |
THIS_FILE="$THIS_STRIPPED_FILE" |
|
777 |
OTHER_FILE="$OTHER_STRIPPED_FILE" |
|
778 |
fi |
|
779 |
||
780 |
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
|
28356 | 781 |
unset _NT_SYMBOL_PATH |
41949 | 782 |
if [ "$(uname -o)" = "Cygwin" ]; then |
783 |
THIS=$(cygpath -msa $THIS) |
|
784 |
OTHER=$(cygpath -msa $OTHER) |
|
28356 | 785 |
fi |
41949 | 786 |
# Build an _NT_SYMBOL_PATH that contains all known locations for |
787 |
# pdb files. |
|
788 |
PDB_DIRS="$(ls -d \ |
|
789 |
{$OTHER,$THIS}/support/modules_{cmds,libs}/{*,*/*} \ |
|
790 |
{$OTHER,$THIS}/support/native/java.base/java_objs \ |
|
791 |
)" |
|
792 |
export _NT_SYMBOL_PATH="$(echo $PDB_DIRS | tr ' ' ';')" |
|
14111 | 793 |
fi |
794 |
||
795 |
if [ -z "$SKIP_BIN_DIFF" ]; then |
|
796 |
if cmp $OTHER_FILE $THIS_FILE > /dev/null; then |
|
797 |
# The files were bytewise identical. |
|
798 |
if [ -n "$VERBOSE" ]; then |
|
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
799 |
echo " : : : : : : $BIN_FILE" |
14111 | 800 |
fi |
801 |
return 0 |
|
802 |
fi |
|
803 |
BIN_MSG=" diff " |
|
804 |
if [[ "$ACCEPTED_BIN_DIFF" != *"$BIN_FILE"* ]]; then |
|
805 |
DIFF_BIN=true |
|
806 |
if [[ "$KNOWN_BIN_DIFF" != *"$BIN_FILE"* ]]; then |
|
807 |
BIN_MSG="*$BIN_MSG*" |
|
808 |
REGRESSIONS=true |
|
809 |
else |
|
810 |
BIN_MSG=" $BIN_MSG " |
|
811 |
fi |
|
812 |
else |
|
813 |
BIN_MSG="($BIN_MSG)" |
|
814 |
DIFF_BIN= |
|
815 |
fi |
|
816 |
fi |
|
817 |
||
818 |
if [ -n "$STAT" ]; then |
|
819 |
THIS_SIZE=$($STAT $STAT_PRINT_SIZE "$THIS_FILE") |
|
820 |
OTHER_SIZE=$($STAT $STAT_PRINT_SIZE "$OTHER_FILE") |
|
821 |
else |
|
822 |
THIS_SIZE=$(ls -l "$THIS_FILE" | awk '{ print $5 }') |
|
823 |
OTHER_SIZE=$(ls -l "$OTHER_FILE" | awk '{ print $5 }') |
|
824 |
fi |
|
825 |
if [ $THIS_SIZE -ne $OTHER_SIZE ]; then |
|
826 |
DIFF_SIZE_NUM=$($EXPR $THIS_SIZE - $OTHER_SIZE) |
|
827 |
DIFF_SIZE_REL=$($EXPR $THIS_SIZE \* 100 / $OTHER_SIZE) |
|
828 |
SIZE_MSG=$($PRINTF "%3d%% %4d" $DIFF_SIZE_REL $DIFF_SIZE_NUM) |
|
14458 | 829 |
if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] && [ "$DIFF_SIZE_REL" -gt 98 ] \ |
28356 | 830 |
&& [ "$DIFF_SIZE_REL" -lt 102 ]; then |
14111 | 831 |
SIZE_MSG="($SIZE_MSG)" |
832 |
DIFF_SIZE= |
|
14458 | 833 |
elif [ "$OPENJDK_TARGET_OS" = "windows" ] \ |
28356 | 834 |
&& [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \ |
835 |
&& [ "$DIFF_SIZE_NUM" = 512 ]; then |
|
836 |
# On windows, size of binaries increase in 512 increments. |
|
14458 | 837 |
SIZE_MSG="($SIZE_MSG)" |
838 |
DIFF_SIZE= |
|
839 |
elif [ "$OPENJDK_TARGET_OS" = "windows" ] \ |
|
28356 | 840 |
&& [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] \ |
841 |
&& [ "$DIFF_SIZE_NUM" = -512 ]; then |
|
842 |
# On windows, size of binaries increase in 512 increments. |
|
14111 | 843 |
SIZE_MSG="($SIZE_MSG)" |
844 |
DIFF_SIZE= |
|
845 |
else |
|
846 |
if [[ "$ACCEPTED_SIZE_DIFF" != *"$BIN_FILE"* ]]; then |
|
847 |
DIFF_SIZE=true |
|
848 |
if [[ "$KNOWN_SIZE_DIFF" != *"$BIN_FILE"* ]]; then |
|
849 |
SIZE_MSG="*$SIZE_MSG*" |
|
850 |
REGRESSIONS=true |
|
851 |
else |
|
852 |
SIZE_MSG=" $SIZE_MSG " |
|
853 |
fi |
|
854 |
else |
|
855 |
SIZE_MSG="($SIZE_MSG)" |
|
856 |
DIFF_SIZE= |
|
857 |
fi |
|
858 |
fi |
|
859 |
else |
|
860 |
SIZE_MSG=" " |
|
861 |
DIFF_SIZE= |
|
862 |
if [[ "$KNOWN_SIZE_DIFF $ACCEPTED_SIZE_DIFF" = *"$BIN_FILE"* ]]; then |
|
863 |
SIZE_MSG=" ! " |
|
864 |
fi |
|
865 |
fi |
|
866 |
||
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
867 |
if [ "$SORT_ALL_SYMBOLS" = "true" ] || [[ "$SORT_SYMBOLS" = *"$BIN_FILE"* ]]; then |
14111 | 868 |
SYM_SORT_CMD="sort" |
869 |
else |
|
870 |
SYM_SORT_CMD="cat" |
|
871 |
fi |
|
872 |
||
37402 | 873 |
if [ -n "$SYMBOLS_DIFF_FILTER" ] && [ -z "$NEED_SYMBOLS_DIFF_FILTER" ] \ |
874 |
|| [[ "$NEED_SYMBOLS_DIFF_FILTER" = *"$BIN_FILE"* ]]; then |
|
875 |
this_SYMBOLS_DIFF_FILTER="$SYMBOLS_DIFF_FILTER" |
|
876 |
else |
|
877 |
this_SYMBOLS_DIFF_FILTER="$CAT" |
|
878 |
fi |
|
879 |
||
14111 | 880 |
# Check symbols |
881 |
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
|
882 |
# The output from dumpbin on windows differs depending on if the debug symbol |
|
883 |
# files are still around at the location the binary is pointing too. Need |
|
28356 | 884 |
# to filter out that extra information. |
885 |
$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 |
|
886 |
$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 | 887 |
elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then |
888 |
# Some symbols get seemingly random 15 character prefixes. Filter them out. |
|
889 |
$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 | 890 |
$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
|
891 |
elif [ "$OPENJDK_TARGET_OS" = "aix" ]; then |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
892 |
$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
|
893 |
$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 | 894 |
elif [ "$OPENJDK_TARGET_OS" = "macosx" ]; then |
895 |
$NM -j $ORIG_OTHER_FILE 2> /dev/null | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other |
|
896 |
$NM -j $ORIG_THIS_FILE 2> /dev/null | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this |
|
14111 | 897 |
else |
37402 | 898 |
$NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME \ |
899 |
| $AWK '{print $2, $3, $4, $5}' \ |
|
900 |
| eval "$this_SYMBOLS_DIFF_FILTER" \ |
|
901 |
| $SYM_SORT_CMD \ |
|
902 |
> $WORK_FILE_BASE.symbols.other |
|
903 |
$NM -a $ORIG_THIS_FILE 2> /dev/null | $GREP -v $NAME \ |
|
904 |
| $AWK '{print $2, $3, $4, $5}' \ |
|
905 |
| eval "$this_SYMBOLS_DIFF_FILTER" \ |
|
906 |
| $SYM_SORT_CMD \ |
|
907 |
> $WORK_FILE_BASE.symbols.this |
|
14111 | 908 |
fi |
28356 | 909 |
|
20049 | 910 |
LC_ALL=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff |
14111 | 911 |
if [ -s $WORK_FILE_BASE.symbols.diff ]; then |
912 |
SYM_MSG=" diff " |
|
913 |
if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then |
|
914 |
DIFF_SYM=true |
|
915 |
if [[ "$KNOWN_SYM_DIFF" != *"$BIN_FILE"* ]]; then |
|
916 |
SYM_MSG="*$SYM_MSG*" |
|
917 |
REGRESSIONS=true |
|
918 |
else |
|
919 |
SYM_MSG=" $SYM_MSG " |
|
920 |
fi |
|
921 |
else |
|
28356 | 922 |
SYM_MSG="($SYM_MSG)" |
14111 | 923 |
DIFF_SYM= |
924 |
fi |
|
925 |
else |
|
926 |
SYM_MSG=" " |
|
927 |
DIFF_SYM= |
|
928 |
if [[ "$KNOWN_SYM_DIFF $ACCEPTED_SYM_DIFF" = *"$BIN_FILE"* ]]; then |
|
929 |
SYM_MSG=" ! " |
|
930 |
fi |
|
931 |
fi |
|
932 |
||
933 |
# Check dependencies |
|
934 |
if [ -n "$LDD_CMD" ]; then |
|
37032
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
935 |
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
936 |
LDD_FILTER="$GREP \.dll" |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
937 |
else |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
938 |
LDD_FILTER="$CAT" |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
939 |
fi |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
940 |
(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
|
941 |
| $LDD_FILTER | $AWK '{ print $1;}' | $SORT \ |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
942 |
| $TEE $WORK_FILE_BASE.deps.other \ |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
943 |
| $UNIQ > $WORK_FILE_BASE.deps.other.uniq) |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
944 |
(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
|
945 |
| $LDD_FILTER | $AWK '{ print $1;}' | $SORT \ |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
946 |
| $TEE $WORK_FILE_BASE.deps.this \ |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
947 |
| $UNIQ > $WORK_FILE_BASE.deps.this.uniq) |
28356 | 948 |
(cd $FILE_WORK_DIR && $RM -f $NAME) |
949 |
||
37032
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
950 |
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
|
951 |
> $WORK_FILE_BASE.deps.diff |
09347dc49ec8
8154237: Compare script broken for windows native library deps comparison
erikj
parents:
36789
diff
changeset
|
952 |
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
|
953 |
> $WORK_FILE_BASE.deps.diff.uniq |
28356 | 954 |
|
955 |
if [ -s $WORK_FILE_BASE.deps.diff ]; then |
|
14111 | 956 |
if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then |
28356 | 957 |
DEP_MSG=" diff " |
14111 | 958 |
else |
28356 | 959 |
DEP_MSG=" redun " |
14111 | 960 |
fi |
961 |
if [[ "$ACCEPTED_DEP_DIFF" != *"$BIN_FILE"* ]]; then |
|
28356 | 962 |
DIFF_DEP=true |
963 |
if [[ "$KNOWN_DEP_DIFF" != *"$BIN_FILE"* ]]; then |
|
14111 | 964 |
DEP_MSG="*$DEP_MSG*" |
965 |
REGRESSIONS=true |
|
28356 | 966 |
else |
14111 | 967 |
DEP_MSG=" $DEP_MSG " |
28356 | 968 |
fi |
14111 | 969 |
else |
28356 | 970 |
DEP_MSG="($DEP_MSG)" |
971 |
DIFF_DEP= |
|
14111 | 972 |
fi |
28356 | 973 |
else |
974 |
DEP_MSG=" " |
|
975 |
DIFF_DEP= |
|
14111 | 976 |
if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then |
977 |
DEP_MSG=" ! " |
|
978 |
fi |
|
28356 | 979 |
fi |
14111 | 980 |
else |
28356 | 981 |
DEP_MSG=" - " |
14111 | 982 |
fi |
28356 | 983 |
|
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
984 |
# Some linux compilers add a unique Build ID |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
985 |
if [ "$OPENJDK_TARGET_OS" = "linux" ]; then |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
986 |
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
|
987 |
else |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
988 |
BUILD_ID_FILTER="$CAT" |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
989 |
fi |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
990 |
|
14111 | 991 |
# Compare fulldump output |
992 |
if [ -n "$FULLDUMP_CMD" ] && [ -z "$SKIP_FULLDUMP_DIFF" ]; then |
|
29157 | 993 |
if [ -z "$FULLDUMP_DIFF_FILTER" ]; then |
994 |
FULLDUMP_DIFF_FILTER="$CAT" |
|
995 |
fi |
|
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
996 |
$FULLDUMP_CMD $OTHER_FILE | eval "$BUILD_ID_FILTER" | eval "$FULLDUMP_DIFF_FILTER" \ |
37402 | 997 |
> $WORK_FILE_BASE.fulldump.other 2>&1 & |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
33441
diff
changeset
|
998 |
$FULLDUMP_CMD $THIS_FILE | eval "$BUILD_ID_FILTER" | eval "$FULLDUMP_DIFF_FILTER" \ |
37402 | 999 |
> $WORK_FILE_BASE.fulldump.this 2>&1 & |
1000 |
wait |
|
29157 | 1001 |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1002 |
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
|
1003 |
> $WORK_FILE_BASE.fulldump.diff |
28356 | 1004 |
|
14111 | 1005 |
if [ -s $WORK_FILE_BASE.fulldump.diff ]; then |
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1006 |
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
|
1007 |
FULLDUMP_MSG=$($PRINTF "%8d" $FULLDUMP_DIFF_SIZE) |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1008 |
if [[ "$ACCEPTED_FULLDUMP_DIFF" != *"$BIN_FILE"* ]]; then |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1009 |
DIFF_FULLDUMP=true |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1010 |
if [[ "$KNOWN_FULLDUMP_DIFF" != *"$BIN_FILE"* ]]; then |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1011 |
FULLDUMP_MSG="*$FULLDUMP_MSG*" |
14111 | 1012 |
REGRESSIONS=true |
1013 |
else |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1014 |
FULLDUMP_MSG=" $FULLDUMP_MSG " |
14111 | 1015 |
fi |
1016 |
else |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1017 |
FULLDUMP_MSG="($FULLDUMP_MSG)" |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1018 |
DIFF_FULLDUMP= |
14111 | 1019 |
fi |
1020 |
else |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1021 |
FULLDUMP_MSG=" " |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1022 |
DIFF_FULLDUMP= |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1023 |
if [[ "$KNOWN_FULLDUMP_DIFF $ACCEPTED_FULLDUMP_DIFF" = *"$BIN_FILE"* ]]; then |
37972 | 1024 |
FULLDUMP_MSG=" ! " |
14111 | 1025 |
fi |
1026 |
fi |
|
1027 |
fi |
|
1028 |
||
1029 |
# Compare disassemble output |
|
1030 |
if [ -n "$DIS_CMD" ] && [ -z "$SKIP_DIS_DIFF" ]; then |
|
37402 | 1031 |
this_DIS_DIFF_FILTER="$CAT" |
1032 |
if [ -n "$DIS_DIFF_FILTER" ]; then |
|
1033 |
if [ -z "$NEED_DIS_DIFF_FILTER" ] \ |
|
1034 |
|| [[ "$NEED_DIS_DIFF_FILTER" = *"$BIN_FILE"* ]]; then |
|
1035 |
this_DIS_DIFF_FILTER="$DIS_DIFF_FILTER" |
|
1036 |
fi |
|
28356 | 1037 |
fi |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1038 |
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1039 |
DIS_GREP_ARG=-a |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1040 |
else |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1041 |
DIS_GREP_ARG= |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1042 |
fi |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1043 |
$DIS_CMD $OTHER_FILE | $GREP $DIS_GREP_ARG -v $NAME \ |
37402 | 1044 |
| 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
|
1045 |
$DIS_CMD $THIS_FILE | $GREP $DIS_GREP_ARG -v $NAME \ |
37402 | 1046 |
| eval "$this_DIS_DIFF_FILTER" > $WORK_FILE_BASE.dis.this 2>&1 & |
1047 |
wait |
|
28356 | 1048 |
|
20049 | 1049 |
LC_ALL=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff |
28356 | 1050 |
|
14111 | 1051 |
if [ -s $WORK_FILE_BASE.dis.diff ]; then |
1052 |
DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}') |
|
1053 |
DIS_MSG=$($PRINTF "%8d" $DIS_DIFF_SIZE) |
|
1054 |
if [[ "$ACCEPTED_DIS_DIFF" != *"$BIN_FILE"* ]]; then |
|
1055 |
DIFF_DIS=true |
|
37402 | 1056 |
if [ "$MAX_KNOWN_DIS_DIFF_SIZE" = "" ]; then |
1057 |
MAX_KNOWN_DIS_DIFF_SIZE="0" |
|
1058 |
fi |
|
1059 |
if [[ "$KNOWN_DIS_DIFF" = *"$BIN_FILE"* ]] \ |
|
1060 |
&& [ "$DIS_DIFF_SIZE" -lt "$MAX_KNOWN_DIS_DIFF_SIZE" ]; then |
|
1061 |
DIS_MSG=" $DIS_MSG " |
|
1062 |
else |
|
14111 | 1063 |
DIS_MSG="*$DIS_MSG*" |
1064 |
REGRESSIONS=true |
|
1065 |
fi |
|
1066 |
else |
|
1067 |
DIS_MSG="($DIS_MSG)" |
|
1068 |
DIFF_DIS= |
|
1069 |
fi |
|
1070 |
else |
|
1071 |
DIS_MSG=" " |
|
1072 |
DIFF_DIS= |
|
1073 |
if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then |
|
1074 |
DIS_MSG=" ! " |
|
1075 |
fi |
|
1076 |
fi |
|
1077 |
fi |
|
1078 |
||
1079 |
||
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1080 |
if [ -n "$DIFF_BIN$DIFF_SIZE$DIFF_SYM$DIFF_DEP$DIFF_FULLDUMP$DIFF_DIS" ] || [ -n "$VERBOSE" ]; then |
14111 | 1081 |
if [ -n "$BIN_MSG" ]; then echo -n "$BIN_MSG:"; fi |
1082 |
if [ -n "$SIZE_MSG" ]; then echo -n "$SIZE_MSG:"; fi |
|
1083 |
if [ -n "$SYM_MSG" ]; then echo -n "$SYM_MSG:"; fi |
|
1084 |
if [ -n "$DEP_MSG" ]; then echo -n "$DEP_MSG:"; fi |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1085 |
if [ -n "$FULLDUMP_MSG" ]; then echo -n "$FULLDUMP_MSG:"; fi |
14111 | 1086 |
if [ -n "$DIS_MSG" ]; then echo -n "$DIS_MSG:"; fi |
1087 |
echo " $BIN_FILE" |
|
1088 |
if [ "$SHOW_DIFFS" = "true" ]; then |
|
1089 |
if [ -s "$WORK_FILE_BASE.symbols.diff" ]; then |
|
1090 |
echo "Symbols diff:" |
|
1091 |
$CAT $WORK_FILE_BASE.symbols.diff |
|
1092 |
fi |
|
1093 |
if [ -s "$WORK_FILE_BASE.deps.diff" ]; then |
|
1094 |
echo "Deps diff:" |
|
1095 |
$CAT $WORK_FILE_BASE.deps.diff |
|
1096 |
fi |
|
1097 |
if [ -s "$WORK_FILE_BASE.fulldump.diff" ]; then |
|
1098 |
echo "Fulldump diff:" |
|
1099 |
$CAT $WORK_FILE_BASE.fulldump.diff |
|
1100 |
fi |
|
1101 |
if [ -s "$WORK_FILE_BASE.dis.diff" ]; then |
|
1102 |
echo "Disassembly diff:" |
|
1103 |
$CAT $WORK_FILE_BASE.dis.diff |
|
1104 |
fi |
|
1105 |
fi |
|
1106 |
return 1 |
|
1107 |
fi |
|
1108 |
return 0 |
|
1109 |
} |
|
1110 |
||
29157 | 1111 |
################################################################################ |
14111 | 1112 |
# Print binary diff header |
1113 |
||
1114 |
print_binary_diff_header() { |
|
1115 |
if [ -z "$SKIP_BIN_DIFF" ]; then echo -n " Binary :"; fi |
|
1116 |
if [ -z "$SKIP_SIZE_DIFF" ]; then echo -n " Size :"; fi |
|
1117 |
if [ -z "$SKIP_SYM_DIFF" ]; then echo -n " Symbols :"; fi |
|
1118 |
if [ -z "$SKIP_DEP_DIFF" ]; then echo -n " Deps :"; fi |
|
1119 |
if [ -z "$SKIP_FULLDUMP_DIFF" ]; then echo -n " Fulldump :"; fi |
|
1120 |
if [ -z "$SKIP_DIS_DIFF" ]; then echo -n " Disass :"; fi |
|
1121 |
echo |
|
1122 |
} |
|
1123 |
||
29157 | 1124 |
################################################################################ |
14111 | 1125 |
# Compare all libraries |
1126 |
||
1127 |
compare_all_libs() { |
|
1128 |
THIS_DIR=$1 |
|
1129 |
OTHER_DIR=$2 |
|
1130 |
WORK_DIR=$3 |
|
1131 |
||
28356 | 1132 |
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
|
1133 |
-o -name '*.dll' -o -name '*.obj' -o -name '*.o' -o -name '*.a' \ |
28356 | 1134 |
-o -name '*.cpl' \) | $SORT | $FILTER) |
14111 | 1135 |
|
48912 | 1136 |
# On macos, filter out the dSYM debug symbols files as they are also |
1137 |
# named *.dylib. |
|
1138 |
if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then |
|
1139 |
LIBS=$(echo "$LIBS" | $GREP -v '\.dSYM/') |
|
1140 |
fi |
|
1141 |
||
14111 | 1142 |
if [ -n "$LIBS" ]; then |
1143 |
echo Libraries... |
|
1144 |
print_binary_diff_header |
|
1145 |
for l in $LIBS; do |
|
1146 |
if [ -f "$OTHER_DIR/$l" ]; then |
|
1147 |
compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $l |
|
1148 |
if [ "$?" != "0" ]; then |
|
1149 |
return_value=1 |
|
1150 |
fi |
|
1151 |
fi |
|
1152 |
done |
|
1153 |
fi |
|
1154 |
||
1155 |
return $return_value |
|
1156 |
} |
|
1157 |
||
29157 | 1158 |
################################################################################ |
14111 | 1159 |
# Compare all executables |
1160 |
||
1161 |
compare_all_execs() { |
|
1162 |
THIS_DIR=$1 |
|
1163 |
OTHER_DIR=$2 |
|
1164 |
WORK_DIR=$3 |
|
1165 |
||
1166 |
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
|
1167 |
EXECS=$(cd $THIS_DIR && $FIND . -type f -name '*.exe' | $SORT | $FILTER) |
|
1168 |
else |
|
14280
7d8ad47b2dbf
8002220: build-infra: update for mac, solaris 11 issues
erikj
parents:
14111
diff
changeset
|
1169 |
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
|
1170 |
\( -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
|
1171 |
-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
|
1172 |
-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
|
1173 |
-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
|
1174 |
-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
|
1175 |
-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
|
1176 |
-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
|
1177 |
-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
|
1178 |
-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
|
1179 |
-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
|
1180 |
-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
|
1181 |
-o -name '*.template' -o -name '*.policy' -o -name '*.security' \ |
48912 | 1182 |
-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
|
1183 |
-o -name 'classlist' \) | $SORT | $FILTER) |
14111 | 1184 |
fi |
1185 |
||
1186 |
if [ -n "$EXECS" ]; then |
|
1187 |
echo Executables... |
|
1188 |
print_binary_diff_header |
|
1189 |
for e in $EXECS; do |
|
1190 |
if [ -f "$OTHER_DIR/$e" ]; then |
|
1191 |
compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $e |
|
1192 |
if [ "$?" != "0" ]; then |
|
1193 |
return_value=1 |
|
1194 |
fi |
|
1195 |
fi |
|
1196 |
done |
|
1197 |
fi |
|
1198 |
||
1199 |
return $return_value |
|
1200 |
} |
|
1201 |
||
29157 | 1202 |
################################################################################ |
14111 | 1203 |
# Initiate configuration |
1204 |
||
33441
ce975712c050
8141439: Fix compare.sh -o <otherdir> (broken by JDK-8136813)
ihse
parents:
33031
diff
changeset
|
1205 |
THIS="$SCRIPT_DIR" |
14111 | 1206 |
echo "$THIS" |
1207 |
THIS_SCRIPT="$0" |
|
1208 |
||
1209 |
if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "-?" ] || [ "$1" = "/h" ] || [ "$1" = "/?" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then |
|
1210 |
echo "bash ./compare.sh [OPTIONS] [FILTER]" |
|
1211 |
echo "" |
|
1212 |
echo "-all Compare all files in all known ways" |
|
1213 |
echo "-names Compare the file names and directory structure" |
|
1214 |
echo "-perms Compare the permission bits on all files and directories" |
|
1215 |
echo "-types Compare the output of the file command on all files" |
|
1216 |
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
|
1217 |
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
|
1218 |
echo "-zips-names Compare the file names inside all zip files" |
14111 | 1219 |
echo "-jars Compare the contents of all jar files" |
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1220 |
echo "-jmods Compare the listings of all jmod files" |
14111 | 1221 |
echo "-libs Compare all native libraries" |
1222 |
echo "-execs Compare all executables" |
|
1223 |
echo "-v Verbose output, does not hide known differences" |
|
1224 |
echo "-vv More verbose output, shows diff output of all comparisons" |
|
1225 |
echo "-o [OTHER] Compare with build in other directory. Will default to the old build directory" |
|
1226 |
echo "" |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1227 |
echo "--sort-symbols Sort all symbols before comparing" |
32811
df82db312e58
8135060: Stop building Xcode projects in install build
erikj
parents:
31310
diff
changeset
|
1228 |
echo "--strip Strip all binaries before comparing" |
35747 | 1229 |
echo "--clean Clean all previous comparison results first" |
32811
df82db312e58
8135060: Stop building Xcode projects in install build
erikj
parents:
31310
diff
changeset
|
1230 |
echo "" |
14111 | 1231 |
echo "[FILTER] List filenames in the image to compare, works for jars, zips, libs and execs" |
1232 |
echo "Example:" |
|
47217 | 1233 |
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
|
1234 |
echo "" |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1235 |
echo "-2zips <file1> <file2> Compare two zip files only" |
25854 | 1236 |
echo "-2bins <file1> <file2> Compare two binary files only" |
1237 |
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
|
1238 |
echo "" |
14111 | 1239 |
exit 10 |
1240 |
fi |
|
1241 |
||
1242 |
CMP_NAMES=false |
|
1243 |
CMP_PERMS=false |
|
1244 |
CMP_TYPES=false |
|
1245 |
CMP_GENERAL=false |
|
1246 |
CMP_ZIPS=false |
|
42506
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
1247 |
CMP_ZIPS_CONTENTS=true |
14111 | 1248 |
CMP_JARS=false |
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1249 |
CMP_JMODS=false |
14111 | 1250 |
CMP_LIBS=false |
1251 |
CMP_EXECS=false |
|
1252 |
||
1253 |
while [ -n "$1" ]; do |
|
1254 |
case "$1" in |
|
1255 |
-v) |
|
1256 |
VERBOSE=true |
|
1257 |
;; |
|
1258 |
-vv) |
|
1259 |
VERBOSE=true |
|
1260 |
SHOW_DIFFS=true |
|
1261 |
;; |
|
1262 |
-o) |
|
1263 |
OTHER="$2" |
|
1264 |
shift |
|
1265 |
;; |
|
1266 |
-all) |
|
1267 |
CMP_NAMES=true |
|
1268 |
if [ "$OPENJDK_TARGET_OS" != "windows" ]; then |
|
1269 |
CMP_PERMS=true |
|
1270 |
fi |
|
1271 |
CMP_TYPES=true |
|
1272 |
CMP_GENERAL=true |
|
1273 |
CMP_ZIPS=true |
|
1274 |
CMP_JARS=true |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1275 |
CMP_JMODS=true |
14111 | 1276 |
CMP_LIBS=true |
1277 |
CMP_EXECS=true |
|
1278 |
;; |
|
1279 |
-names) |
|
1280 |
CMP_NAMES=true |
|
1281 |
;; |
|
1282 |
-perms) |
|
1283 |
CMP_PERMS=true |
|
1284 |
;; |
|
1285 |
-types) |
|
1286 |
CMP_TYPES=true |
|
1287 |
;; |
|
1288 |
-general) |
|
1289 |
CMP_GENERAL=true |
|
1290 |
;; |
|
1291 |
-zips) |
|
1292 |
CMP_ZIPS=true |
|
42506
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
1293 |
CMP_ZIPS_CONTENTS=true |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
1294 |
;; |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
1295 |
-zips-names) |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
1296 |
CMP_ZIPS=true |
54b0b4fffab5
8170878: JDK 9 fails to build when enabling Hotspot code coverage
erikj
parents:
42288
diff
changeset
|
1297 |
CMP_ZIPS_CONTENTS=false |
14111 | 1298 |
;; |
1299 |
-jars) |
|
1300 |
CMP_JARS=true |
|
1301 |
;; |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1302 |
-jmods) |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1303 |
CMP_JMODS=true |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1304 |
;; |
14111 | 1305 |
-libs) |
1306 |
CMP_LIBS=true |
|
1307 |
;; |
|
1308 |
-execs) |
|
1309 |
CMP_EXECS=true |
|
1310 |
;; |
|
25854 | 1311 |
-2dirs) |
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1312 |
THIS="$(cd "$2" > /dev/null && pwd )" |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1313 |
OTHER="$(cd "$3" > /dev/null && pwd )" |
25854 | 1314 |
THIS_BASE_DIR="$THIS" |
1315 |
OTHER_BASE_DIR="$OTHER" |
|
1316 |
SKIP_DEFAULT=true |
|
1317 |
shift |
|
1318 |
shift |
|
1319 |
;; |
|
15179
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1320 |
-2zips) |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1321 |
CMP_2_ZIPS=true |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1322 |
THIS_FILE=$2 |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1323 |
OTHER_FILE=$3 |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1324 |
shift |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1325 |
shift |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1326 |
;; |
25854 | 1327 |
-2bins) |
1328 |
CMP_2_BINS=true |
|
1329 |
THIS_FILE=$2 |
|
1330 |
OTHER_FILE=$3 |
|
1331 |
shift |
|
1332 |
shift |
|
1333 |
;; |
|
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1334 |
--sort-symbols) |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1335 |
SORT_ALL_SYMBOLS=true |
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1336 |
;; |
32811
df82db312e58
8135060: Stop building Xcode projects in install build
erikj
parents:
31310
diff
changeset
|
1337 |
--strip) |
df82db312e58
8135060: Stop building Xcode projects in install build
erikj
parents:
31310
diff
changeset
|
1338 |
STRIP_ALL=true |
df82db312e58
8135060: Stop building Xcode projects in install build
erikj
parents:
31310
diff
changeset
|
1339 |
;; |
35747 | 1340 |
--clean) |
1341 |
CLEAN_OUTPUT=true |
|
1342 |
;; |
|
14111 | 1343 |
*) |
1344 |
CMP_NAMES=false |
|
1345 |
CMP_PERMS=false |
|
1346 |
CMP_TYPES=false |
|
1347 |
CMP_ZIPS=true |
|
1348 |
CMP_JARS=true |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1349 |
CMP_JMODS=true |
14111 | 1350 |
CMP_LIBS=true |
1351 |
CMP_EXECS=true |
|
28356 | 1352 |
|
14111 | 1353 |
if [ -z "$FILTER" ]; then |
1354 |
FILTER="$GREP" |
|
1355 |
fi |
|
1356 |
FILTER="$FILTER -e $1" |
|
1357 |
;; |
|
1358 |
esac |
|
1359 |
shift |
|
1360 |
done |
|
1361 |
||
35747 | 1362 |
if [ "$STRIP_ALL" = "true" ] && [ -z "$STRIP" ]; then |
1363 |
echo Warning: Not stripping even with --strip, since strip is missing on this platform |
|
1364 |
STRIP_ALL=false |
|
1365 |
fi |
|
1366 |
||
48912 | 1367 |
COMPARE_ROOT=$OUTPUTDIR/compare-support |
35747 | 1368 |
if [ "$CLEAN_OUTPUT" = "true" ]; then |
1369 |
echo Cleaning old output in $COMPARE_ROOT. |
|
1370 |
$RM -rf $COMPARE_ROOT |
|
1371 |
fi |
|
1372 |
$MKDIR -p $COMPARE_ROOT |
|
1373 |
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then |
|
1374 |
if [ "$(uname -o)" = "Cygwin" ]; then |
|
1375 |
COMPARE_ROOT=$(cygpath -msa $COMPARE_ROOT) |
|
1376 |
fi |
|
1377 |
fi |
|
1378 |
||
15179
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1379 |
if [ "$CMP_2_ZIPS" = "true" ]; then |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1380 |
THIS_DIR="$(dirname $THIS_FILE)" |
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1381 |
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
|
1382 |
OTHER_DIR="$(dirname $OTHER_FILE)" |
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1383 |
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
|
1384 |
THIS_FILE_NAME="$(basename $THIS_FILE)" |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1385 |
OTHER_FILE_NAME="$(basename $OTHER_FILE)" |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1386 |
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
|
1387 |
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
|
1388 |
exit |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1389 |
fi |
d5be3992e87e
8006663: build-infra: Compare two arbitrary zip/jar files with compare.sh
erikj
parents:
15068
diff
changeset
|
1390 |
|
25854 | 1391 |
if [ "$CMP_2_BINS" = "true" ]; then |
1392 |
THIS_DIR="$(dirname $THIS_FILE)" |
|
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1393 |
THIS_DIR="$(cd "$THIS_DIR" > /dev/null && pwd )" |
25854 | 1394 |
OTHER_DIR="$(dirname $OTHER_FILE)" |
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1395 |
OTHER_DIR="$(cd "$OTHER_DIR" > /dev/null && pwd )" |
25854 | 1396 |
THIS_FILE_NAME="$(basename $THIS_FILE)" |
1397 |
OTHER_FILE_NAME="$(basename $OTHER_FILE)" |
|
1398 |
echo Comparing $THIS_DIR/$THIS_FILE_NAME and $OTHER_DIR/$OTHER_FILE_NAME |
|
1399 |
compare_bin_file $THIS_DIR $OTHER_DIR $COMPARE_ROOT/2bins $THIS_FILE_NAME $OTHER_FILE_NAME |
|
1400 |
exit |
|
1401 |
fi |
|
1402 |
||
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1403 |
if [ "$CMP_NAMES" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1404 |
&& [ "$CMP_TYPES" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1405 |
&& [ "$CMP_PERMS" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1406 |
&& [ "$CMP_GENERAL" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1407 |
&& [ "$CMP_ZIPS" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1408 |
&& [ "$CMP_JARS" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1409 |
&& [ "$CMP_JMODS" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1410 |
&& [ "$CMP_LIBS" = "false" ] \ |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1411 |
&& [ "$CMP_EXECS" = "false" ]; then |
14111 | 1412 |
CMP_NAMES=true |
1413 |
CMP_PERMS=true |
|
1414 |
CMP_TYPES=true |
|
1415 |
CMP_GENERAL=true |
|
1416 |
CMP_ZIPS=true |
|
1417 |
CMP_JARS=true |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1418 |
CMP_JMODS=true |
14111 | 1419 |
CMP_LIBS=true |
1420 |
CMP_EXECS=true |
|
1421 |
fi |
|
1422 |
||
1423 |
if [ -z "$FILTER" ]; then |
|
1424 |
FILTER="$CAT" |
|
1425 |
fi |
|
1426 |
||
25854 | 1427 |
if [ "$SKIP_DEFAULT" != "true" ]; then |
1428 |
if [ -z "$OTHER" ]; then |
|
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
1429 |
echo "Nothing to compare to, set with -o" |
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
1430 |
exit 1 |
25854 | 1431 |
else |
1432 |
if [ ! -d "$OTHER" ]; then |
|
1433 |
echo "Other build directory does not exist:" |
|
1434 |
echo "$OTHER" |
|
1435 |
exit 1 |
|
1436 |
fi |
|
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1437 |
OTHER="$( cd "$OTHER" > /dev/null && pwd )" |
25854 | 1438 |
echo "Comparing to:" |
14111 | 1439 |
echo "$OTHER" |
25854 | 1440 |
echo |
14111 | 1441 |
fi |
1442 |
||
1443 |
||
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
1444 |
# Find the common images to compare, prioritizing later build stages |
27560 | 1445 |
if [ -d "$THIS/install/jdk" ] && [ -d "$OTHER/install/jdk" ]; then |
29157 | 1446 |
THIS_JDK="$THIS/install/jdk" |
1447 |
OTHER_JDK="$OTHER/install/jdk" |
|
49291 | 1448 |
echo "Selecting install images for JDK compare" |
27560 | 1449 |
elif [ -d "$THIS/images/jdk" ] && [ -d "$OTHER/images/jdk" ]; then |
29157 | 1450 |
THIS_JDK="$THIS/images/jdk" |
1451 |
OTHER_JDK="$OTHER/images/jdk" |
|
49291 | 1452 |
echo "Selecting normal images for JDK compare" |
42288
600cfdaa270a
8170576: Silence error message in compare.sh when selecting images
ihse
parents:
41949
diff
changeset
|
1453 |
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
|
1454 |
&& [ -d "$(ls -d $OTHER/licensee-src/build/*/images/jdk 2> /dev/null)" ] |
39204 | 1455 |
then |
1456 |
echo "Selecting licensee images for compare" |
|
1457 |
# Simply override the THIS and OTHER dir with the build dir from |
|
1458 |
# the nested licensee source build for the rest of the script |
|
1459 |
# execution. |
|
1460 |
OLD_THIS="$THIS" |
|
1461 |
OLD_OTHER="$OTHER" |
|
1462 |
THIS="$(ls -d $THIS/licensee-src/build/*)" |
|
1463 |
OTHER="$(ls -d $OTHER/licensee-src/build/*)" |
|
1464 |
THIS_JDK="$THIS/images/jdk" |
|
1465 |
OTHER_JDK="$OTHER/images/jdk" |
|
1466 |
# Rewrite the path to tools that are used from the build |
|
1467 |
JIMAGE="$(echo "$JIMAGE" | $SED "s|$OLD_THIS|$THIS|g")" |
|
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1468 |
JMOD="$(echo "$JMOD" | $SED "s|$OLD_THIS|$THIS|g")" |
39204 | 1469 |
JAVAP="$(echo "$JAVAP" | $SED "s|$OLD_THIS|$THIS|g")" |
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
1470 |
else |
28356 | 1471 |
echo "No common images found." |
1472 |
exit 1 |
|
14111 | 1473 |
fi |
31310 | 1474 |
echo " $THIS_JDK" |
1475 |
echo " $OTHER_JDK" |
|
14111 | 1476 |
|
31310 | 1477 |
if [ -d "$THIS/images/jdk-bundle" -o -d "$THIS/deploy/images/jdk-bundle" ] \ |
1478 |
&& [ -d "$OTHER/images/jdk-bundle" -o -d "$OTHER/deploy/images/jdk-bundle" ]; then |
|
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1479 |
if [ -d "$THIS/deploy/images/jdk-bundle" ]; then |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1480 |
THIS_JDK_BUNDLE="$THIS/deploy/images/jdk-bundle" |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1481 |
else |
31310 | 1482 |
THIS_JDK_BUNDLE="$THIS/images/jdk-bundle" |
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1483 |
fi |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1484 |
if [ -d "$OTHER/deploy/images/jdk-bundle" ]; then |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1485 |
OTHER_JDK_BUNDLE="$OTHER/deploy/images/jdk-bundle" |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1486 |
else |
31310 | 1487 |
OTHER_JDK_BUNDLE="$OTHER/images/jdk-bundle" |
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1488 |
fi |
32720
7e0e586a6817
8137014: Various improvements in build infrastructure
ihse
parents:
31310
diff
changeset
|
1489 |
echo "Also comparing jdk macosx bundles" |
31310 | 1490 |
echo " $THIS_JDK_BUNDLE" |
1491 |
echo " $OTHER_JDK_BUNDLE" |
|
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
1492 |
fi |
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
1493 |
|
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1494 |
if [ -d "$THIS/deploy/bundles" -o -d "$THIS/deploy/images/bundles" ] \ |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1495 |
&& [ -d "$OTHER/deploy/bundles" -o -d "$OTHER/deploy/images/bundles" ]; then |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1496 |
if [ -d "$THIS/deploy/images/bundles" ]; then |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1497 |
THIS_DEPLOY_BUNDLE_DIR="$THIS/deploy/images/bundles" |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1498 |
else |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1499 |
THIS_DEPLOY_BUNDLE_DIR="$THIS/deploy/bundles" |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1500 |
fi |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1501 |
if [ -d "$OTHER/deploy/images/bundles" ]; then |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1502 |
OTHER_DEPLOY_BUNDLE_DIR="$OTHER/deploy/images/bundles" |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1503 |
else |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1504 |
OTHER_DEPLOY_BUNDLE_DIR="$OTHER/deploy/bundles" |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1505 |
fi |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1506 |
echo "Also comparing deploy javadoc bundles" |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1507 |
fi |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1508 |
|
31310 | 1509 |
if [ -d "$THIS/images/JavaAppletPlugin.plugin" ] \ |
1510 |
&& [ -d "$OTHER/images/JavaAppletPlugin.plugin" -o -d "$OTHER/deploy/images/JavaAppletPlugin.plugin" ]; then |
|
1511 |
if [ -d "$THIS/images/JavaAppletPlugin.plugin" ]; then |
|
1512 |
THIS_DEPLOY_APPLET_PLUGIN_DIR="$THIS/images/JavaAppletPlugin.plugin" |
|
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1513 |
else |
31310 | 1514 |
THIS_DEPLOY_APPLET_PLUGIN_DIR="$THIS/deploy/images/JavaAppletPlugin.plugin" |
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1515 |
fi |
31310 | 1516 |
if [ -d "$OTHER/images/JavaAppletPlugin.plugin" ]; then |
1517 |
OTHER_DEPLOY_APPLET_PLUGIN_DIR="$OTHER/images/JavaAppletPlugin.plugin" |
|
1518 |
else |
|
29158
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1519 |
OTHER_DEPLOY_APPLET_PLUGIN_DIR="$OTHER/deploy/images/JavaAppletPlugin.plugin" |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1520 |
fi |
5d46751992d9
8074055: Improvements in compare.sh from build-infra
ihse
parents:
29157
diff
changeset
|
1521 |
echo "Also comparing deploy applet image" |
31310 | 1522 |
echo " $THIS_DEPLOY_APPLET_PLUGIN_DIR" |
1523 |
echo " $OTHER_DEPLOY_APPLET_PLUGIN_DIR" |
|
28356 | 1524 |
fi |
1525 |
||
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1526 |
if [ -d "$THIS/install/sparkle/Sparkle.framework" ] \ |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1527 |
&& [ -d "$OTHER/install/sparkle/Sparkle.framework" ]; then |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1528 |
THIS_SPARKLE_DIR="$THIS/install/sparkle/Sparkle.framework" |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1529 |
OTHER_SPARKLE_DIR="$OTHER/install/sparkle/Sparkle.framework" |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1530 |
echo "Also comparing install sparkle framework" |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1531 |
echo " $THIS_SPARKLE_DIR" |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1532 |
echo " $OTHER_SPARKLE_DIR" |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1533 |
fi |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1534 |
|
50928
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1535 |
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
|
1536 |
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
|
1537 |
if [ -f "$THIS_SEC_DIR/sec-bin.zip" ] && [ -f "$OTHER_SEC_DIR/sec-bin.zip" ]; then |
49291 | 1538 |
OTHER_SEC_BIN="$OTHER_SEC_DIR/sec-bin.zip" |
1539 |
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
|
1540 |
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
|
1541 |
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
|
1542 |
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
|
1543 |
else |
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1544 |
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
|
1545 |
fi |
0e7e4b28c0d9
8206087: windows-x64-cmp-baseline fails with The files do not have the same suffix type
erikj
parents:
50490
diff
changeset
|
1546 |
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
|
1547 |
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
|
1548 |
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
|
1549 |
THIS_JGSS_WINDOWS_BIN="$THIS_SEC_DIR/$JGSS_WINDOWS_BIN" |
25854 | 1550 |
fi |
1551 |
fi |
|
14466
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1552 |
|
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1553 |
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
|
1554 |
THIS_DOCS="$THIS/images/docs" |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1555 |
OTHER_DOCS="$OTHER/images/docs" |
28356 | 1556 |
echo "Also comparing docs" |
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
25854
diff
changeset
|
1557 |
else |
25854 | 1558 |
echo "WARNING! Docs haven't been built and won't be compared." |
1559 |
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
|
1560 |
fi |
15062 | 1561 |
|
29157 | 1562 |
################################################################################ |
14111 | 1563 |
# Do the work |
1564 |
||
1565 |
if [ "$CMP_NAMES" = "true" ]; then |
|
29157 | 1566 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
1567 |
echo -n "JDK " |
|
1568 |
compare_dirs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
|
49291 | 1569 |
echo -n "JDK " |
1570 |
compare_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
|
1571 |
fi |
|
29157 | 1572 |
if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then |
1573 |
echo -n "JDK Bundle " |
|
1574 |
compare_dirs $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle |
|
28356 | 1575 |
|
29157 | 1576 |
echo -n "JDK Bundle " |
1577 |
compare_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle |
|
14111 | 1578 |
fi |
14466
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1579 |
if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1580 |
echo -n "Docs " |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1581 |
compare_dirs $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1582 |
echo -n "Docs " |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1583 |
compare_files $THIS_DOCS $OTHER_DOCS $COMPARE_ROOT/docs |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1584 |
fi |
25854 | 1585 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
1586 |
compare_dirs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
|
1587 |
compare_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
|
1588 |
fi |
|
28356 | 1589 |
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then |
1590 |
echo -n "JavaAppletPlugin " |
|
1591 |
compare_dirs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin |
|
1592 |
echo -n "JavaAppletPlugin " |
|
1593 |
compare_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin |
|
1594 |
fi |
|
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1595 |
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1596 |
echo -n "Sparkle.framework " |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1597 |
compare_dirs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1598 |
echo -n "Sparkle.framework " |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1599 |
compare_files $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1600 |
fi |
14111 | 1601 |
fi |
1602 |
||
49291 | 1603 |
if [ "$CMP_LIBS" = "true" ]; then |
29157 | 1604 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
1605 |
echo -n "JDK " |
|
49291 | 1606 |
compare_all_libs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
14111 | 1607 |
fi |
25854 | 1608 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
49291 | 1609 |
compare_all_libs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
25854 | 1610 |
fi |
28356 | 1611 |
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then |
1612 |
echo -n "JavaAppletPlugin " |
|
49291 | 1613 |
compare_all_libs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin |
28356 | 1614 |
fi |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1615 |
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1616 |
echo -n "Sparkle.framework " |
49291 | 1617 |
compare_all_libs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1618 |
fi |
14111 | 1619 |
fi |
1620 |
||
49291 | 1621 |
if [ "$CMP_EXECS" = "true" ]; then |
29157 | 1622 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
49291 | 1623 |
compare_all_execs $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
14111 | 1624 |
fi |
25854 | 1625 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
49291 | 1626 |
compare_all_execs $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
25854 | 1627 |
fi |
28356 | 1628 |
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then |
1629 |
echo -n "JavaAppletPlugin " |
|
49291 | 1630 |
compare_all_execs $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin |
28356 | 1631 |
fi |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1632 |
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1633 |
echo -n "Sparkle.framework " |
49291 | 1634 |
compare_all_execs $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1635 |
fi |
14111 | 1636 |
fi |
1637 |
||
1638 |
if [ "$CMP_GENERAL" = "true" ]; then |
|
29157 | 1639 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
1640 |
echo -n "JDK " |
|
1641 |
compare_general_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
|
49291 | 1642 |
fi |
29157 | 1643 |
if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then |
1644 |
echo -n "JDK Bundle " |
|
1645 |
compare_general_files $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle |
|
14111 | 1646 |
fi |
14466
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1647 |
if [ -n "$THIS_DOCS" ] && [ -n "$OTHER_DOCS" ]; then |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1648 |
echo -n "Docs " |
2f85b948660b
8003844: build-infra: docs target isn't working properly
erikj
parents:
14458
diff
changeset
|
1649 |
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
|
1650 |
fi |
25854 | 1651 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
1652 |
compare_general_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
|
1653 |
fi |
|
28356 | 1654 |
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then |
1655 |
echo -n "JavaAppletPlugin " |
|
1656 |
compare_general_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin |
|
1657 |
fi |
|
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1658 |
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1659 |
echo -n "Sparkle.framework " |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1660 |
compare_general_files $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1661 |
fi |
14111 | 1662 |
fi |
1663 |
||
1664 |
if [ "$CMP_ZIPS" = "true" ]; then |
|
29157 | 1665 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
1666 |
compare_all_zip_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
|
14111 | 1667 |
fi |
15062 | 1668 |
if [ -n "$THIS_SEC_BIN" ] && [ -n "$OTHER_SEC_BIN" ]; then |
1669 |
if [ -n "$(echo $THIS_SEC_BIN | $FILTER)" ]; then |
|
1670 |
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
|
1671 |
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
|
1672 |
fi |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1673 |
fi |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1674 |
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
|
1675 |
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
|
1676 |
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
|
1677 |
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
|
1678 |
fi |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1679 |
fi |
4f8e8dd6e6d5
8005858: build-infra: Add missed comparison of sec-windows-bin.zip and friends to compare.sh
erikj
parents:
15063
diff
changeset
|
1680 |
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
|
1681 |
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
|
1682 |
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
|
1683 |
compare_zip_file $THIS_SEC_DIR $OTHER_SEC_DIR $COMPARE_ROOT/sec-bin $JGSS_WINDOWS_BIN |
15062 | 1684 |
fi |
1685 |
fi |
|
25854 | 1686 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
1687 |
compare_all_zip_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
|
1688 |
fi |
|
28356 | 1689 |
if [ -n "$THIS_DEPLOY_BUNDLE_DIR" ] && [ -n "$OTHER_DEPLOY_BUNDLE_DIR" ]; then |
1690 |
compare_all_zip_files $THIS_DEPLOY_BUNDLE_DIR $OTHER_DEPLOY_BUNDLE_DIR $COMPARE_ROOT/deploy-bundle |
|
1691 |
fi |
|
1692 |
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then |
|
1693 |
compare_all_zip_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin |
|
1694 |
fi |
|
14111 | 1695 |
fi |
1696 |
||
1697 |
if [ "$CMP_JARS" = "true" ]; then |
|
29157 | 1698 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
1699 |
compare_all_jar_files $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
|
14111 | 1700 |
fi |
25854 | 1701 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
1702 |
compare_all_jar_files $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
|
1703 |
fi |
|
28356 | 1704 |
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then |
1705 |
compare_all_jar_files $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin |
|
1706 |
fi |
|
14111 | 1707 |
fi |
1708 |
||
53570
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1709 |
if [ "$CMP_JMODS" = "true" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1710 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1711 |
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
|
1712 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1713 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1714 |
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
|
1715 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1716 |
fi |
ab7fcc43dab4
8217916: Build compare script is not comparing jmods
erikj
parents:
52030
diff
changeset
|
1717 |
|
49291 | 1718 |
if [ "$CMP_PERMS" = "true" ]; then |
29157 | 1719 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
1720 |
echo -n "JDK " |
|
49291 | 1721 |
compare_permissions $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
1722 |
fi |
|
25854 | 1723 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
49291 | 1724 |
compare_permissions $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
25854 | 1725 |
fi |
28356 | 1726 |
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then |
1727 |
echo -n "JavaAppletPlugin " |
|
49291 | 1728 |
compare_permissions $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin |
28356 | 1729 |
fi |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1730 |
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1731 |
echo -n "Sparkle.framework " |
49291 | 1732 |
compare_permissions $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1733 |
fi |
14111 | 1734 |
fi |
1735 |
||
49291 | 1736 |
if [ "$CMP_TYPES" = "true" ]; then |
29157 | 1737 |
if [ -n "$THIS_JDK" ] && [ -n "$OTHER_JDK" ]; then |
49291 | 1738 |
echo -n "JDK " |
1739 |
compare_file_types $THIS_JDK $OTHER_JDK $COMPARE_ROOT/jdk |
|
1740 |
fi |
|
1741 |
if [ -n "$THIS_JDK_BUNDLE" ] && [ -n "$OTHER_JDK_BUNDLE" ]; then |
|
1742 |
echo -n "JDK Bundle " |
|
1743 |
compare_file_types $THIS_JDK_BUNDLE $OTHER_JDK_BUNDLE $COMPARE_ROOT/jdk-bundle |
|
14111 | 1744 |
fi |
25854 | 1745 |
if [ -n "$THIS_BASE_DIR" ] && [ -n "$OTHER_BASE_DIR" ]; then |
49291 | 1746 |
compare_file_types $THIS_BASE_DIR $OTHER_BASE_DIR $COMPARE_ROOT/base_dir |
25854 | 1747 |
fi |
28356 | 1748 |
if [ -n "$THIS_DEPLOY_APPLET_PLUGIN_DIR" ] && [ -n "$OTHER_DEPLOY_APPLET_PLUGIN_DIR" ]; then |
1749 |
echo -n "JavaAppletPlugin " |
|
49291 | 1750 |
compare_file_types $THIS_DEPLOY_APPLET_PLUGIN_DIR $OTHER_DEPLOY_APPLET_PLUGIN_DIR $COMPARE_ROOT/plugin |
28356 | 1751 |
fi |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1752 |
if [ -n "$THIS_SPARKLE_DIR" ] && [ -n "$OTHER_SPARKLE_DIR" ]; then |
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1753 |
echo -n "Sparkle.framework " |
49291 | 1754 |
compare_file_types $THIS_SPARKLE_DIR $OTHER_SPARKLE_DIR $COMPARE_ROOT/sparkle |
35744
4f5e0998b6e9
8149479: Fix compare.sh to have a clean baseline with COMPARE_BUILD
erikj
parents:
35370
diff
changeset
|
1755 |
fi |
14111 | 1756 |
fi |
1757 |
||
1758 |
echo |
|
1759 |
||
1760 |
if [ -n "$REGRESSIONS" ]; then |
|
1761 |
echo "REGRESSIONS FOUND!" |
|
1762 |
echo |
|
1763 |
exit 1 |
|
1764 |
else |
|
1765 |
echo "No regressions found" |
|
1766 |
echo |
|
1767 |
exit 0 |
|
1768 |
fi |