Skip to content

Commit

Permalink
devtools: fix meson build test for plain bourne shell
Browse files Browse the repository at this point in the history
The pipefail option is not supported in /bin/sh, just in bash/ksh and
similar shells - which means it's there by default on most Linux distros
but not on e.g. FreeBSD. Therefore we check for it's presence before
setting the option, and if it's missing, we upgrade verbosity level if
needed to ensure we never hide any build failures.

Signed-off-by: Bruce Richardson <[email protected]>
Acked-by: Luca Boccassi <[email protected]>
  • Loading branch information
bruce-richardson authored and tmonjalo committed Apr 19, 2019
1 parent 890028e commit e5f7bd1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion devtools/test-meson-builds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
# * if a build-directory already exists we assume it was properly configured
# Run ninja after configuration is done.

set -o pipefail
# set pipefail option if possible
PIPEFAIL=""
set -o | grep -q pipefail && set -o pipefail && PIPEFAIL=1

srcdir=$(dirname $(readlink -f $0))/..
MESON=${MESON:-meson}
Expand Down Expand Up @@ -51,6 +53,11 @@ if [ "$1" = "-vv" ] ; then
elif [ "$1" = "-v" ] ; then
TEST_MESON_BUILD_VERBOSE=1
fi
# we can't use plain verbose when we don't have pipefail option so up-level
if [ -z "$PIPEFAIL" -a -n "$TEST_MESON_BUILD_VERBOSE" ] ; then
echo "# Missing pipefail shell option, changing VERBOSE to VERY_VERBOSE"
TEST_MESON_BUILD_VERY_VERBOSE=1
fi

# shared and static linked builds with gcc and clang
for c in gcc clang ; do
Expand Down

0 comments on commit e5f7bd1

Please sign in to comment.