aboutsummaryrefslogtreecommitdiff
path: root/src/buildall.bash
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2019-05-09 18:55:02 -0400
committerRuss Cox <rsc@golang.org>2019-05-16 03:24:56 +0000
commit4f76871bd75530682964bd81d050e280c5309438 (patch)
tree4c4db07a7bbe1b21b4b7d5fa7cb3c39528266583 /src/buildall.bash
parent639ac76d453073da49a6a1d89b957cfa1bfef1af (diff)
downloadgo-4f76871bd75530682964bd81d050e280c5309438.tar.gz
go-4f76871bd75530682964bd81d050e280c5309438.zip
cmd/go: run full 'go vet' during 'go test' for packages in GOROOT
Now that the main tree complies with 'go vet', enable all vet checks during 'go test' in the main tree. This helps surface helpful errors while developing, instead of having to wait for the misc-vet-vetall builder. During 'go test', the additional vet checks are essentially free: the vet invocations themselves take only 8 seconds total for the entire tree. Also update buildall.bash (used by the misc-compile builders) to run 'go vet std cmd' for each GOOS/GOARCH pair. This is not as free, since in general it can require recompiling packages with their tests included before invoking vet. (That compilation was going on anyway in the 'go test' case.) On my Mac laptop, ./buildall.bash freebsd used to take 68+16+17+18 = 119 seconds for make.bash and then the builds of the three freebsd architectures. Now it takes 68+16+23+17+23+18+24 = 189 seconds, 60% longer. Some of this is spent doing unnecessary cgo work. Still, this lets us shard the vet checks and match all.bash. Fixes #20119. For #31916. Change-Id: I6b0c40bac47708a688463c7fca12c0fc23ab2751 Reviewed-on: https://go-review.googlesource.com/c/go/+/176439 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/buildall.bash')
-rwxr-xr-xsrc/buildall.bash6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/buildall.bash b/src/buildall.bash
index 5820b4d589..5762a332de 100755
--- a/src/buildall.bash
+++ b/src/buildall.bash
@@ -73,7 +73,11 @@ do
export GOARCH=386
export GO386=387
fi
- if ! "$GOROOT/bin/go" build -a std cmd; then
+
+ # 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