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-arm64' | egrep "$pattern"
48 # put linux first in the target list to get all the architectures up front.
50 selectedtargets | grep 'linux' | sort
54 selectedtargets | grep -v 'linux' | sort
57 # Note words in $targets are separated by both newlines and spaces.
58 targets="$(linux_targets) $(non_linux_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
77 # Build and vet everything.
78 # cmd/go/internal/work/exec.go enables the same vet flags during go test of std cmd
79 # and should be kept in sync with any vet flag changes here.
80 if ! "$GOROOT/bin/go" build std cmd || ! "$GOROOT/bin/go" vet -unsafeptr=false std cmd; then
88 if [ "$failed" = "true" ]; then
90 echo "Build(s) failed." 1>&2