diff options
| author | Bryan C. Mills <bcmills@google.com> | 2020-06-05 16:08:08 -0400 |
|---|---|---|
| committer | Bryan C. Mills <bcmills@google.com> | 2020-06-09 02:49:06 +0000 |
| commit | cacac8bdc5c93e7bc71df71981fdf32dded017bf (patch) | |
| tree | a446c52808abf100906c992122656a45b8e51c69 /src/cmd/dist | |
| parent | e64675a79fef5924f268425de021372df874010e (diff) | |
| download | go-cacac8bdc5c93e7bc71df71981fdf32dded017bf.tar.xz | |
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>
Diffstat (limited to 'src/cmd/dist')
| -rw-r--r-- | src/cmd/dist/test.go | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 08ef056164..e1cd4965c3 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -178,15 +178,6 @@ func (t *tester) run() { return } - // We must unset GOROOT_FINAL before tests, because runtime/debug requires - // correct access to source code, so if we have GOROOT_FINAL in effect, - // at least runtime/debug test will fail. - // If GOROOT_FINAL was set before, then now all the commands will appear stale. - // Nothing we can do about that other than not checking them below. - // (We call checkNotStale but only with "std" not "cmd".) - os.Setenv("GOROOT_FINAL_OLD", os.Getenv("GOROOT_FINAL")) // for cmd/link test - os.Unsetenv("GOROOT_FINAL") - for _, name := range t.runNames { if !t.isRegisteredTestName(name) { fatalf("unknown test %q", name) |
