]> Cypherpunks repositories - gostls13.git/commitdiff
make.bash: exit if dist fails
authorRob Pike <r@golang.org>
Mon, 19 Aug 2013 01:18:43 +0000 (11:18 +1000)
committerRob Pike <r@golang.org>
Mon, 19 Aug 2013 01:18:43 +0000 (11:18 +1000)
The shell's -e doesn't work across "eval"; need to error-check by hand.
The recent spate of Darwin build failures pointed out that if the first
run of cmd/dist fails, we keep going. We shouldn't.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/13098043

src/make.bash

index 10696e765872ef67537ee1813686900f5a071bf3..30388388f2d2b7c6c3e1eb7fb8a8942c44aaea39 100755 (executable)
@@ -117,7 +117,12 @@ if [ "$(uname)" == "Darwin" ]; then
 fi
 ${CC:-gcc} $mflag -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
 
-eval $(./cmd/dist/dist env -p)
+# -e doesn't propagate out of eval, so check success by hand.
+eval $(./cmd/dist/dist env -p || echo FAIL=true)
+if [ "$FAIL" = true ]; then
+       exit 1
+fi
+
 echo
 
 if [ "$1" = "--dist-tool" ]; then