DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: thomas@monjalon.net
Cc: dev@dpdk.org, David Marchand <david.marchand@redhat.com>,
	Luca Boccassi <bluca@debian.org>,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH] devtools/test-meson-builds: fix support for plain bourne shell
Date: Fri, 19 Apr 2019 13:04:49 +0100	[thread overview]
Message-ID: <20190419120449.29883-1-bruce.richardson@intel.com> (raw)
Message-ID: <20190419120449.C6aAjs3KqqByqkqYhTZTB_EIvF1x7BZa35E63HIQ1cE@z> (raw)

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 <bruce.richardson@intel.com>
---
This patch is a replacement for the previous patch: "fix support for
FreeBSD" [1], which was an incorrect/incomplete fix.

[1]http://patches.dpdk.org/patch/52468/
---
 devtools/test-meson-builds.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 0ea79f461..630a1a6fe 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -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}
@@ -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
-- 
2.20.1


             reply	other threads:[~2019-04-19 12:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-19 12:04 Bruce Richardson [this message]
2019-04-19 12:04 ` Bruce Richardson
2019-04-19 12:42 ` Luca Boccassi
2019-04-19 12:42   ` Luca Boccassi
2019-04-19 21:18   ` Thomas Monjalon
2019-04-19 21:18     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190419120449.29883-1-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=bluca@debian.org \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).