[llvm] r241599 - Fix bug in test-release.sh where the script would not exit if any

Dan Liew dan at su-root.co.uk
Tue Jul 7 08:50:33 PDT 2015


Author: delcypher
Date: Tue Jul  7 10:50:33 2015
New Revision: 241599

URL: http://llvm.org/viewvc/llvm-project?rev=241599&view=rev
Log:
Fix bug in test-release.sh where the script would not exit if any
of the build stages that are sent through a pipe (e.g. tee) failed.

This potentially allowed builds and/or tests to fail without anyone
noticing. It appears that for the LLVM 3.6.[01] releases this actually
happened for the Ubuntu 14.04LTS binary releases. The essence of the
issue is that without ``set -o pipefail`` the following command in bash
has a zero exit code.

false | tee /dev/null ; exit $?

Modified:
    llvm/trunk/utils/release/test-release.sh

Modified: llvm/trunk/utils/release/test-release.sh
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/release/test-release.sh?rev=241599&r1=241598&r2=241599&view=diff
==============================================================================
--- llvm/trunk/utils/release/test-release.sh (original)
+++ llvm/trunk/utils/release/test-release.sh Tue Jul  7 10:50:33 2015
@@ -348,7 +348,11 @@ function package_release() {
     cd $cwd
 }
 
-set -e                          # Exit if any command fails
+# Exit if any command fails
+# Note: pipefail is necessary for running build commands through
+# a pipe (i.e. it changes the output of ``false | tee /dev/null ; echo $?``)
+set -e
+set -o pipefail
 
 if [ "$do_checkout" = "yes" ]; then
     export_sources





More information about the llvm-commits mailing list