Skip to contentSkip to conversation

devtools: fix meson build test to exit on failure

PATCH Superseded Bruce Richardson 2 participants 3 messages Mar 12, 2019 – Mar 13, 2019 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devtools: fix meson build test to exit on failure

When piping the ninja command through cat, we lose the error value from the call to ninja in the case of failure. This prevents the script from exiting at the first broken build Fix this by setting the "pipefile" shell option.

Fixes 4bcb9b768604 ("devtools: add verbose option to meson build test")
---
 devtools/test-meson-builds.sh | 2 ++
 1 file changed, 2 insertions(+)
devtools/test-meson-builds.sh +2 -0
index f82a0fd6c..9f5620583 100755
@@ -7,6 +7,8 @@
 # * if a build-directory already exists we assume it was properly configured
 # Run ninja after configuration is done.
 
+set -o pipefail
+
 srcdir=$(dirname $(readlink -f $0))/..
 MESON=${MESON:-meson}
 use_shared="--default-library=shared"
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/1 devtools: fix meson build test to exit on failure

When piping the ninja command through cat, we lose the error value from the call to ninja in the case of failure. This prevents the script from exiting at the first broken build. Fix this by setting the "pipefail" shell option.

Fixes 4bcb9b768604 ("devtools: add verbose option to meson build test")

---
V2: fix typo in commit message

 devtools/test-meson-builds.sh | 2 ++
 1 file changed, 2 insertions(+)
devtools/test-meson-builds.sh +2 -0
index f82a0fd6c..9f5620583 100755
@@ -7,6 +7,8 @@
 # * if a build-directory already exists we assume it was properly configured
 # Run ninja after configuration is done.
 
+set -o pipefail
+
 srcdir=$(dirname $(readlink -f $0))/..
 MESON=${MESON:-meson}
 use_shared="--default-library=shared"
Signature · 1 line
2.20.1
#2 lore raw

12/03/2019 11:18, Bruce Richardson:

Quoted 8 lines

When piping the ninja command through cat, we lose the error value from the call to ninja in the case of failure. This prevents the script from exiting at the first broken build. Fix this by setting the "pipefail" shell option.

Fixes 4bcb9b768604 ("devtools: add verbose option to meson build test")

Applied, thanks