2 # Copyright 2015 The Go Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style
4 # license that can be found in the LICENSE file.
6 # Usage: buildall.sh [-e] [pattern]
8 # buildall.bash builds the standard library for all Go-supported
9 # architectures. It is used by the "all-compile" trybot builder,
10 # as a smoke test to quickly flag portability issues.
13 # -e: stop at first failure
15 if [ ! -f run.bash ]; then
16 echo 'buildall.bash must be run from $GOROOT/src' 1>&2
21 if [ "$1" = "-e" ]; then
26 if [ "$sete" = true ]; then
31 if [ "$pattern" = "" ]; then
36 GOROOT="$(cd .. && pwd)"
39 ../bin/go tool dist list | sed -e 's|/|-|'
45 gettargets | egrep -v 'android-arm|darwin-arm' | egrep "$pattern"
48 # put linux, nacl first in the target list to get all the architectures up front.
49 linux_nacl_targets() {
50 selectedtargets | egrep 'linux|nacl' | sort
53 non_linux_nacl_targets() {
54 selectedtargets | egrep -v 'linux|nacl' | sort
57 # Note words in $targets are separated by both newlines and spaces.
58 targets="$(linux_nacl_targets) $(non_linux_nacl_targets)"
61 for target in $targets
64 echo "### Building $target"
65 export GOOS=$(echo $target | sed 's/-.*//')
66 export GOARCH=$(echo $target | sed 's/.*-//')
68 if [ "$GOARCH" = "arm5" ]; then
72 if [ "$GOARCH" = "387" ]; then
76 if ! "$GOROOT/bin/go" build -a std cmd; then
84 if [ "$failed" = "true" ]; then
86 echo "Build(s) failed." 1>&2