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.bash [-e] [pattern]
8 # buildall.bash builds the standard library for all Go-supported
11 # Originally the Go build system used it as a smoke test to quickly
12 # flag portability issues in builders named "misc-compile" or "all-compile".
13 # As of CL 464955, the build system uses make.bash -compile-only instead,
14 # so this script no longer runs in any automated fashion.
17 # -e: stop at first failure
19 if [ ! -f run.bash ]; then
20 echo 'buildall.bash must be run from $GOROOT/src' 1>&2
25 if [ "$1" = "-e" ]; then
30 if [ "$sete" = true ]; then
35 if [ "$pattern" = "" ]; then
40 GOROOT="$(cd .. && pwd)"
43 ../bin/go tool dist list | sed -e 's|/|-|' |
44 egrep -v '^(android|ios)' # need C toolchain even for cross-compiling
49 gettargets | grep -E "$pattern"
52 # put linux first in the target list to get all the architectures up front.
54 selectedtargets | grep 'linux' | sort
58 selectedtargets | grep -v 'linux' | sort
61 # Note words in $targets are separated by both newlines and spaces.
62 targets="$(linux_targets) $(non_linux_targets)"
65 for target in $targets
68 echo "### Building $target"
69 export GOOS=$(echo $target | sed 's/-.*//')
70 export GOARCH=$(echo $target | sed 's/.*-//')
72 if [ "$GOARCH" = "arm5" ]; 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