From: Andrew Bartlett Date: Tue, 21 Jun 2022 07:23:26 +0000 (+1200) Subject: build: Ensure that SAMBA_GENERATOR() tasks fail on error X-Git-Tag: tevent-0.13.0~339 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9788e92bf1251b4791ca84e83aa9437101e7d436;p=thirdparty%2Fsamba.git build: Ensure that SAMBA_GENERATOR() tasks fail on error Previously the error from inside the shell was eaten. This showed up particularly as a failure to notice errors when running xsltproc to build the manpages. Signed-off-by: Andrew Bartlett Reviewed-by: Andreas Schneider Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Wed Jun 22 16:43:30 UTC 2022 on sn-devel-184 --- diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 063f9d2ed75..79f352878a8 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -913,12 +913,19 @@ def SAMBA_GENERATOR(bld, name, rule, source='', target='', dep_vars.append('ruledeps') dep_vars.append('SAMBA_GENERATOR_VARS') + shell=isinstance(rule, str) + + # This ensures that if the command (executed in the shell) fails + # (returns non-zero), the build fails + if shell: + rule = "set -e; " + rule + bld.SET_BUILD_GROUP(group) t = bld( rule=rule, source=bld.EXPAND_VARIABLES(source, vars=vars), + shell=shell, target=target, - shell=isinstance(rule, str), update_outputs=True, before='c', ext_out='.c',