]> Cypherpunks repositories - gostls13.git/commit
cmd/dist: do not unset GOROOT_FINAL prior to running tests
authorBryan C. Mills <bcmills@google.com>
Fri, 5 Jun 2020 20:08:08 +0000 (16:08 -0400)
committerBryan C. Mills <bcmills@google.com>
Tue, 9 Jun 2020 02:49:06 +0000 (02:49 +0000)
commitcacac8bdc5c93e7bc71df71981fdf32dded017bf
treea446c52808abf100906c992122656a45b8e51c69
parente64675a79fef5924f268425de021372df874010e
cmd/dist: do not unset GOROOT_FINAL prior to running tests

Also do not unset it by default in the tests for cmd/go.

GOROOT_FINAL affects the GOROOT value embedded in binaries,
such as 'cmd/cgo'. If its value changes and a build command
is performed that depends on one of those binaries, the binary
would be spuriously rebuilt.

Instead, only unset it in the specific tests that make assumptions
about the GOROOT paths embedded in specific compiled binaries.
That may cause those tests to do a little extra rebuilding when
GOROOT_FINAL is set, but that little bit of extra rebuilding
seems preferable to spuriously-stale binaries.

Fixes #39385

Change-Id: I7c87b1519bb5bcff64babf1505fd1033ffa4f4fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/236819
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
src/cmd/addr2line/addr2line_test.go
src/cmd/dist/test.go
src/cmd/go/go_test.go
src/cmd/go/script_test.go
src/cmd/go/testdata/script/README
src/cmd/go/testdata/script/build_trimpath.txt
src/cmd/go/testdata/script/goroot_executable.txt
src/cmd/link/dwarf_test.go
src/cmd/objdump/objdump_test.go