2015-04-29 13:01:55 -06:00
|
|
|
#!/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.
|
|
|
|
|
src/buildall.bash: remove mobile filter
Mobile targets are not supported by misc-compile trybots, as tracked in
golang.org/issue/25963, and need to be filtered out. The buildall.bash
script was created in CL 9438, back when it was a single all-compile
builder, and it was easier to filter out mobile targets in the script
than to come up with a pattern that matches all non-mobile targets.
As of CL 254740, all mobile targets (Android and iOS) have unique GOOS
values. That makes it it easy to filter them out in x/build/dashboard.
This was done in CL 258057. As a result, it's now viable to simplify
this script and perform all misc-compile target selection in x/build,
rather than having it spread it across two places.
Also, as of CL 10750, the all-compile builder has turned into multiple
misc-compile builders, so update the script description accordingly.
Updates #41610.
Change-Id: I1e33260ac18cf0a70bb68cd8e3db5587100c7e87
Reviewed-on: https://go-review.googlesource.com/c/go/+/257962
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2020-09-25 15:10:24 -06:00
|
|
|
# Usage: buildall.bash [-e] [pattern]
|
2015-04-29 13:01:55 -06:00
|
|
|
#
|
|
|
|
# buildall.bash builds the standard library for all Go-supported
|
src/buildall.bash: remove mobile filter
Mobile targets are not supported by misc-compile trybots, as tracked in
golang.org/issue/25963, and need to be filtered out. The buildall.bash
script was created in CL 9438, back when it was a single all-compile
builder, and it was easier to filter out mobile targets in the script
than to come up with a pattern that matches all non-mobile targets.
As of CL 254740, all mobile targets (Android and iOS) have unique GOOS
values. That makes it it easy to filter them out in x/build/dashboard.
This was done in CL 258057. As a result, it's now viable to simplify
this script and perform all misc-compile target selection in x/build,
rather than having it spread it across two places.
Also, as of CL 10750, the all-compile builder has turned into multiple
misc-compile builders, so update the script description accordingly.
Updates #41610.
Change-Id: I1e33260ac18cf0a70bb68cd8e3db5587100c7e87
Reviewed-on: https://go-review.googlesource.com/c/go/+/257962
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2020-09-25 15:10:24 -06:00
|
|
|
# architectures. It is used by the "misc-compile" trybot builders,
|
2015-04-29 16:08:49 -06:00
|
|
|
# as a smoke test to quickly flag portability issues.
|
2015-04-29 13:01:55 -06:00
|
|
|
#
|
|
|
|
# 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
|
2017-03-09 13:50:24 -07:00
|
|
|
sete=true
|
|
|
|
shift
|
2015-04-29 13:01:55 -06:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$sete" = true ]; then
|
2017-03-09 13:50:24 -07:00
|
|
|
set -e
|
2015-04-29 13:01:55 -06:00
|
|
|
fi
|
|
|
|
|
|
|
|
pattern="$1"
|
|
|
|
if [ "$pattern" = "" ]; then
|
2017-03-09 13:50:24 -07:00
|
|
|
pattern=.
|
2015-04-29 13:01:55 -06:00
|
|
|
fi
|
|
|
|
|
2015-05-16 18:05:58 -06:00
|
|
|
./make.bash || exit 1
|
2015-04-29 13:01:55 -06:00
|
|
|
GOROOT="$(cd .. && pwd)"
|
|
|
|
|
2016-11-23 09:45:15 -07:00
|
|
|
gettargets() {
|
2017-03-09 13:50:24 -07:00
|
|
|
../bin/go tool dist list | sed -e 's|/|-|'
|
|
|
|
echo linux-arm-arm5
|
2016-11-23 09:45:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
selectedtargets() {
|
src/buildall.bash: remove mobile filter
Mobile targets are not supported by misc-compile trybots, as tracked in
golang.org/issue/25963, and need to be filtered out. The buildall.bash
script was created in CL 9438, back when it was a single all-compile
builder, and it was easier to filter out mobile targets in the script
than to come up with a pattern that matches all non-mobile targets.
As of CL 254740, all mobile targets (Android and iOS) have unique GOOS
values. That makes it it easy to filter them out in x/build/dashboard.
This was done in CL 258057. As a result, it's now viable to simplify
this script and perform all misc-compile target selection in x/build,
rather than having it spread it across two places.
Also, as of CL 10750, the all-compile builder has turned into multiple
misc-compile builders, so update the script description accordingly.
Updates #41610.
Change-Id: I1e33260ac18cf0a70bb68cd8e3db5587100c7e87
Reviewed-on: https://go-review.googlesource.com/c/go/+/257962
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2020-09-25 15:10:24 -06:00
|
|
|
gettargets | egrep "$pattern"
|
2016-11-23 09:45:15 -07:00
|
|
|
}
|
|
|
|
|
2019-10-08 13:19:13 -06:00
|
|
|
# put linux first in the target list to get all the architectures up front.
|
|
|
|
linux_targets() {
|
|
|
|
selectedtargets | grep 'linux' | sort
|
2016-11-23 09:45:15 -07:00
|
|
|
}
|
|
|
|
|
2019-10-08 13:19:13 -06:00
|
|
|
non_linux_targets() {
|
|
|
|
selectedtargets | grep -v 'linux' | sort
|
2016-11-23 09:45:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
# Note words in $targets are separated by both newlines and spaces.
|
2019-10-08 13:19:13 -06:00
|
|
|
targets="$(linux_targets) $(non_linux_targets)"
|
2016-02-24 22:52:16 -07:00
|
|
|
|
2015-04-29 13:01:55 -06:00
|
|
|
failed=false
|
|
|
|
for target in $targets
|
|
|
|
do
|
2017-03-09 13:50:24 -07:00
|
|
|
echo ""
|
|
|
|
echo "### Building $target"
|
|
|
|
export GOOS=$(echo $target | sed 's/-.*//')
|
|
|
|
export GOARCH=$(echo $target | sed 's/.*-//')
|
2020-09-28 12:17:37 -06:00
|
|
|
unset GOARM
|
2017-03-09 13:50:24 -07:00
|
|
|
if [ "$GOARCH" = "arm5" ]; then
|
|
|
|
export GOARCH=arm
|
|
|
|
export GOARM=5
|
|
|
|
fi
|
2019-05-09 16:55:02 -06:00
|
|
|
|
|
|
|
# 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
|
2017-03-09 13:50:24 -07:00
|
|
|
failed=true
|
|
|
|
if $sete; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2015-04-29 13:01:55 -06:00
|
|
|
done
|
|
|
|
|
|
|
|
if [ "$failed" = "true" ]; then
|
2017-03-09 13:50:24 -07:00
|
|
|
echo "" 1>&2
|
|
|
|
echo "Build(s) failed." 1>&2
|
|
|
|
exit 1
|
2015-04-29 13:01:55 -06:00
|
|
|
fi
|