Return-Path: Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:64642 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725963AbfEIII3 (ORCPT ); Thu, 9 May 2019 04:08:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1557389308; x=1588925308; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=UilDWtcVv+LNKMMDZzgF3cbhBNSCVGjPPCQeGN7wAvs=; b=kpuryaZaix4fHjFo9Ry8Prgz+P5Q2wXXWTGE5/A2TlH8LRjzRYdzvtNa 8T4Owwe3sb4f+KSJhNjjah1AAml0ncTVBKtICYUmfDXS6tG3sukpMiqM0 o0rU4p6ipvvXaBKbmhrAX0VKfte+nA/mgJCWrnXdVv12Xd3EB8RWoN+CN Y=; From: Norbert Manthey Subject: [kernel-build 2/2] kernel: forward build failures Date: Thu, 9 May 2019 10:07:17 +0200 Message-ID: <1557389237-26069-2-git-send-email-nmanthey@amazon.de> In-Reply-To: <1557389237-26069-1-git-send-email-nmanthey@amazon.de> References: <1557389237-26069-1-git-send-email-nmanthey@amazon.de> MIME-Version: 1.0 Content-Type: text/plain Sender: smatch-owner@vger.kernel.org List-ID: To: smatch@vger.kernel.org Cc: Marius Hillenbrand , David Woodhouse , Dan Carpenter , Norbert Manthey In case the kernel build fails, the calling tool chain should also return with a non-zero exit code, to indicate that the currently used tool chain is broken. This change allows to forward the exit code accordingly. Signed-off-by: Norbert Manthey --- smatch_scripts/build_kernel_data.sh | 4 +++- smatch_scripts/test_kernel.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/smatch_scripts/build_kernel_data.sh b/smatch_scripts/build_kernel_data.sh --- a/smatch_scripts/build_kernel_data.sh +++ b/smatch_scripts/build_kernel_data.sh @@ -35,7 +35,8 @@ if [ ! -e smatch_db.sqlite ] ; then fi fi -$SCRIPT_DIR/test_kernel.sh --call-tree --info --param-mapper --spammy --data=$DATA_DIR +BUILD_STATUS=0 +$SCRIPT_DIR/test_kernel.sh --call-tree --info --param-mapper --spammy --data=$DATA_DIR || BUILD_STATUS=$? for i in $SCRIPT_DIR/gen_* ; do $i smatch_warns.txt -p=kernel @@ -45,3 +46,4 @@ mv ${PROJECT}.* $DATA_DIR $DATA_DIR/db/create_db.sh -p=kernel smatch_warns.txt +exit $BUILD_STATUS diff --git a/smatch_scripts/test_kernel.sh b/smatch_scripts/test_kernel.sh --- a/smatch_scripts/test_kernel.sh +++ b/smatch_scripts/test_kernel.sh @@ -60,8 +60,10 @@ make clean find -name \*.c.smatch -exec rm \{\} \; make -j${NR_CPU} $ENDIAN -k CHECK="$CMD -p=kernel --file-output --succeed $*" \ C=1 $BUILD_PARAM $TARGET 2>&1 | tee $LOG +BUILD_STATUS=${PIPESTATUS[0]} find -name \*.c.smatch -exec cat \{\} \; -exec rm \{\} \; > $WLOG find -name \*.c.smatch.sql -exec cat \{\} \; -exec rm \{\} \; > $WLOG.sql find -name \*.c.smatch.caller_info -exec cat \{\} \; -exec rm \{\} \; > $WLOG.caller_info -echo "Done. The warnings are saved to $WLOG" +echo "Done. Build with status $BUILD_STATUS. The warnings are saved to $WLOG" +exit $BUILD_STATUS -- 2.7.4 Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrer: Christian Schlaeger, Ralf Herbrich Ust-ID: DE 289 237 879 Eingetragen am Amtsgericht Charlottenburg HRB 149173 B