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