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