<p>Martin Roth has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/20656">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">util/abuild: Set exit code on failure<br><br>Currently, the what-jenkins-does target doesn't stop if abuild fails.<br>This change gives a command line parameter to abuild with tells it to<br>exit with a non-zero errorlevel if any of the builds failed.<br><br>This will be particularly useful for concourse which doesn't parse the<br>junit.xml files, and only knows whether a build passed or failed by the<br>errorlevel.<br><br>Change-Id: Ic2be5deaedacd3f55db8e0b14a2b7b39cc44664e<br>Signed-off-by: Martin Roth <martinroth@google.com><br>---<br>M util/abuild/abuild<br>1 file changed, 10 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/20656/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/util/abuild/abuild b/util/abuild/abuild<br>index 8637e6f..a11562b 100755<br>--- a/util/abuild/abuild<br>+++ b/util/abuild/abuild<br>@@ -50,6 +50,9 @@<br> # Did any board fail to build?<br> failed=0<br> <br>+# Exit with a non-zero errorlevel on failure<br>+exitcode=0<br>+<br> # default: don't save checksums<br> checksum_file=""<br> <br>@@ -529,6 +532,7 @@<br>     [-c|--cpus <numcpus>]         Build on <numcpus> at the same time<br>     [-C|--config]                 Configure-only mode<br>     [-d|--dir <dir>]              Directory containing config files<br>+    [-e|--exitcode                Exit with a non-zero errorlevel on failure<br>     [-J|--junit]                  Write JUnit formatted xml log file<br>     [-K|--kconfig <name>]         Prepend file to generated Kconfig<br>     [-l|--loglevel <num>]         Set loglevel<br>@@ -599,12 +603,12 @@<br> # shellcheck disable=SC2086<br> if [ "${getoptbrand:0:6}" == "getopt" ]; then<br>    # Detected GNU getopt that supports long options.<br>-    args=$(getopt -l version,verbose,quiet,help,all,target:,payloads:,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang,clean,outdir:,chromeos,xmlfile:,kconfig:,dir:,root:,recursive,checksum:,timeless -o Vvqhat:p:c:sJCl:rP:uyBLzo:xX:K:d:R:I -- "$@") || exit 1<br>+      args=$(getopt -l version,verbose,quiet,help,all,target:,payloads:,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang,clean,outdir:,chromeos,xmlfile:,kconfig:,dir:,root:,recursive,checksum:,timeless,exitcode -o Vvqhat:p:c:sJCl:rP:uyBLzo:xX:K:d:R:Ie -- "$@") || exit 1<br>     eval set -- $args<br>     retval=$?<br> else<br>      # Detected non-GNU getopt<br>-    args=$(getopt Vvqhat:p:c:sJCl:rP:uyBLzo:xX:K:d:R:I "$@")<br>+   args=$(getopt Vvqhat:p:c:sJCl:rP:uyBLzo:xX:K:d:R:Ie "$@")<br>   set -- $args<br>  retval=$?<br> fi<br>@@ -627,6 +631,7 @@<br>           -t|--target)    shift; target="$1"; shift;;<br>                 -a|--all)       shift; buildall=true;;<br>                -d|--dir)       shift; configdir="$1"; shift;;<br>+             -e|--exitcode)  shift; exitcode=1;;<br>           -r|--remove)    shift; remove=true;;<br>          -v|--verbose)   shift; verbose=true; verboseopt='V=1';;<br>               -q|--quiet)     shift; quiet=true;;<br>@@ -848,6 +853,9 @@<br>              printf "%s configuration(s) failed:\n" "$( wc -l < "$FAILED_BOARDS" )"<br>               cat "$FAILED_BOARDS"<br>                echo<br>+         if [ "$exitcode" != "0" ]; then<br>+                  failed=1<br>+             fi<br>    else<br>          printf "All %s tested configurations passed.\n" "$( wc -l < "$PASSED_BOARDS" )"<br>      fi<br></pre><p>To view, visit <a href="https://review.coreboot.org/20656">change 20656</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/20656"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ic2be5deaedacd3f55db8e0b14a2b7b39cc44664e </div>
<div style="display:none"> Gerrit-Change-Number: 20656 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Martin Roth <martinroth@google.com> </div>