]> git.droids-corp.org - dpdk.git/commitdiff
devtools: adjust verbosity of ABI check
authorThomas Monjalon <thomas@monjalon.net>
Wed, 2 Dec 2020 17:15:21 +0000 (18:15 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 12 Jan 2021 23:04:33 +0000 (00:04 +0100)
The scripts gen-abi.sh and check-abi.sh are updated
to print error messages to stderr so they are likely never ignored.

When called from test-meson-builds.sh, the standard messages on stdout
can be more quiet depending on the verbosity settings.
The beginning of the ABI check is announced in verbose mode.
The commands are printed in very verbose mode.
The check result details are available in verbose mode.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
devtools/check-abi.sh
devtools/gen-abi.sh
devtools/test-meson-builds.sh

index ab6748cfbc6b9f8934542a99047bfe30822d4c0d..9835e346da7e1e155fc74d3722ecef7d8464bf55 100755 (executable)
@@ -3,7 +3,7 @@
 # Copyright (c) 2019 Red Hat, Inc.
 
 if [ $# != 2 ] && [ $# != 3 ]; then
-       echo "Usage: $0 refdir newdir [warnonly]"
+       echo "Usage: $0 refdir newdir [warnonly]" >&2
        exit 1
 fi
 
@@ -13,23 +13,23 @@ warnonly=${3:-}
 ABIDIFF_OPTIONS="--suppr $(dirname $0)/libabigail.abignore --no-added-syms"
 
 if [ ! -d $refdir ]; then
-       echo "Error: reference directory '$refdir' does not exist."
+       echo "Error: reference directory '$refdir' does not exist." >&2
        exit 1
 fi
 incdir=$(find $refdir -type d -a -name include)
 if [ -z "$incdir" ] || [ ! -e "$incdir" ]; then
-       echo "WARNING: could not identify a include directory for $refdir, expect false positives..."
+       echo "WARNING: could not identify an include directory for $refdir, expect false positives..." >&2
 else
        ABIDIFF_OPTIONS="$ABIDIFF_OPTIONS --headers-dir1 $incdir"
 fi
 
 if [ ! -d $newdir ]; then
-       echo "Error: directory to check '$newdir' does not exist."
+       echo "Error: directory to check '$newdir' does not exist." >&2
        exit 1
 fi
 incdir2=$(find $newdir -type d -a -name include)
 if [ -z "$incdir2" ] || [ ! -e "$incdir2" ]; then
-       echo "WARNING: could not identify a include directory for $newdir, expect false positives..."
+       echo "WARNING: could not identify an include directory for $newdir, expect false positives..." >&2
 else
        ABIDIFF_OPTIONS="$ABIDIFF_OPTIONS --headers-dir2 $incdir2"
 fi
@@ -46,23 +46,23 @@ for dump in $(find $refdir -name "*.dump"); do
        fi
        dump2=$(find $newdir -name $name)
        if [ -z "$dump2" ] || [ ! -e "$dump2" ]; then
-               echo "Error: can't find $name in $newdir"
+               echo "Error: cannot find $name in $newdir" >&2
                error=1
                continue
        fi
        abidiff $ABIDIFF_OPTIONS $dump $dump2 || {
                abiret=$?
-               echo "Error: ABI issue reported for 'abidiff $ABIDIFF_OPTIONS $dump $dump2'"
+               echo "Error: ABI issue reported for 'abidiff $ABIDIFF_OPTIONS $dump $dump2'" >&2
                error=1
                echo
                if [ $(($abiret & 3)) -ne 0 ]; then
-                       echo "ABIDIFF_ERROR|ABIDIFF_USAGE_ERROR, this could be a script or environment issue."
+                       echo "ABIDIFF_ERROR|ABIDIFF_USAGE_ERROR, this could be a script or environment issue." >&2
                fi
                if [ $(($abiret & 4)) -ne 0 ]; then
-                       echo "ABIDIFF_ABI_CHANGE, this change requires a review (abidiff flagged this as a potential issue)."
+                       echo "ABIDIFF_ABI_CHANGE, this change requires a review (abidiff flagged this as a potential issue)." >&2
                fi
                if [ $(($abiret & 8)) -ne 0 ]; then
-                       echo "ABIDIFF_ABI_INCOMPATIBLE_CHANGE, this change breaks the ABI."
+                       echo "ABIDIFF_ABI_INCOMPATIBLE_CHANGE, this change breaks the ABI." >&2
                fi
                echo
        }
index c44b0e228a920b350e09ad412dcd9796291c9dd7..f15a3b9aaf223fa93e1db14cb9aa63970df8cec7 100755 (executable)
@@ -3,13 +3,13 @@
 # Copyright (c) 2019 Red Hat, Inc.
 
 if [ $# != 1 ]; then
-       echo "Usage: $0 installdir"
+       echo "Usage: $0 installdir" >&2
        exit 1
 fi
 
 installdir=$1
 if [ ! -d $installdir ]; then
-       echo "Error: install directory '$installdir' does not exist."
+       echo "Error: install directory '$installdir' does not exist." >&2
        exit 1
 fi
 
index 7280b7a93d53f5049e751aa85240edf935a4c5cc..00e3d0b4432bbf9f441f283cfedce2f460ef3b50 100755 (executable)
@@ -191,10 +191,15 @@ build () # <directory> <target compiler | cross file> <meson options>
 
                install_target $builds_dir/$targetdir \
                        $(readlink -f $builds_dir/$targetdir/install)
+               echo "Checking ABI compatibility of $targetdir" >&$verbose
+               echo $srcdir/devtools/gen-abi.sh \
+                       $(readlink -f $builds_dir/$targetdir/install) >&$veryverbose
                $srcdir/devtools/gen-abi.sh \
-                       $(readlink -f $builds_dir/$targetdir/install)
+                       $(readlink -f $builds_dir/$targetdir/install) >&$veryverbose
+               echo $srcdir/devtools/check-abi.sh $abirefdir/$targetdir \
+                       $(readlink -f $builds_dir/$targetdir/install) >&$veryverbose
                $srcdir/devtools/check-abi.sh $abirefdir/$targetdir \
-                       $(readlink -f $builds_dir/$targetdir/install)
+                       $(readlink -f $builds_dir/$targetdir/install) >&$verbose
        fi
 }