1
0
mirror of https://github.com/golang/go synced 2024-11-07 11:46:17 -07:00
go/src/buildall.bash
Brad Fitzpatrick a38a917aee all: remove the nacl port (part 1)
You were a useful port and you've served your purpose.
Thanks for all the play.

A subsequent CL will remove amd64p32 (including assembly files and
toolchain bits) and remaining bits. The amd64p32 removal will be
separated into its own CL in case we want to support the Linux x32 ABI
in the future and want our old amd64p32 support as a starting point.

Updates #30439

Change-Id: Ia3a0c7d49804adc87bf52a4dea7e3d3007f2b1cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/199499
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-10-09 06:14:44 +00:00

93 lines
2.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright 2015 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Usage: buildall.sh [-e] [pattern]
#
# buildall.bash builds the standard library for all Go-supported
# architectures. It is used by the "all-compile" trybot builder,
# as a smoke test to quickly flag portability issues.
#
# Options:
# -e: stop at first failure
if [ ! -f run.bash ]; then
echo 'buildall.bash must be run from $GOROOT/src' 1>&2
exit 1
fi
sete=false
if [ "$1" = "-e" ]; then
sete=true
shift
fi
if [ "$sete" = true ]; then
set -e
fi
pattern="$1"
if [ "$pattern" = "" ]; then
pattern=.
fi
./make.bash || exit 1
GOROOT="$(cd .. && pwd)"
gettargets() {
../bin/go tool dist list | sed -e 's|/|-|'
echo linux-386-387
echo linux-arm-arm5
}
selectedtargets() {
gettargets | egrep -v 'android-arm|darwin-arm' | egrep "$pattern"
}
# put linux first in the target list to get all the architectures up front.
linux_targets() {
selectedtargets | grep 'linux' | sort
}
non_linux_targets() {
selectedtargets | grep -v 'linux' | sort
}
# Note words in $targets are separated by both newlines and spaces.
targets="$(linux_targets) $(non_linux_targets)"
failed=false
for target in $targets
do
echo ""
echo "### Building $target"
export GOOS=$(echo $target | sed 's/-.*//')
export GOARCH=$(echo $target | sed 's/.*-//')
unset GO386 GOARM
if [ "$GOARCH" = "arm5" ]; then
export GOARCH=arm
export GOARM=5
fi
if [ "$GOARCH" = "387" ]; then
export GOARCH=386
export GO386=387
fi
# Build and vet everything.
# cmd/go/internal/work/exec.go enables the same vet flags during go test of std cmd
# and should be kept in sync with any vet flag changes here.
if ! "$GOROOT/bin/go" build std cmd || ! "$GOROOT/bin/go" vet -unsafeptr=false std cmd; then
failed=true
if $sete; then
exit 1
fi
fi
done
if [ "$failed" = "true" ]; then
echo "" 1>&2
echo "Build(s) failed." 1>&2
exit 1
fi