diff options
author | Austin Clements <austin@google.com> | 2023-05-19 16:58:37 -0400 |
---|---|---|
committer | Bryan Mills <bcmills@google.com> | 2023-05-19 21:43:49 +0000 |
commit | 49ad23a6d23d6cc1666c22e4bc215f25f717b569 (patch) | |
tree | fafea3a878ad1b46b0651924abd845592e71fc38 /src/cmd/dist/test.go | |
parent | 29d5272da8ca0ba8291ba8c83ed8bb5c802a1d9e (diff) | |
download | go-49ad23a6d23d6cc1666c22e4bc215f25f717b569.tar.gz go-49ad23a6d23d6cc1666c22e4bc215f25f717b569.zip |
cmd/dist: delete moved_goroot test
This test is largely obviated by the goroot_executable and
list_goroot_symlink cmd/go script tests. It's the last user of several
special-case features in cmd/dist and runs only under a fairly
constrained set of conditions (including only running on builders, not
locally). Delete it.
Change-Id: Icc744e3f9f04813bfd0cad2ef3e88e42617ecf5b
Reviewed-on: https://go-review.googlesource.com/c/go/+/496519
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
Diffstat (limited to 'src/cmd/dist/test.go')
-rw-r--r-- | src/cmd/dist/test.go | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 046d279c98..7d6016cdb8 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -723,50 +723,6 @@ func (t *tester) registerTests() { } } - // On the builders only, test that a moved GOROOT still works. - // Fails on iOS because CC_FOR_TARGET refers to clangwrap.sh - // in the unmoved GOROOT. - // Fails on Android, js/wasm and wasip1/wasm with an exec format error. - // Fails on plan9 with "cannot find GOROOT" (issue #21016). - if os.Getenv("GO_BUILDER_NAME") != "" && goos != "android" && !t.iOS() && goos != "plan9" && goos != "js" && goos != "wasip1" { - t.addTest("moved_goroot", "moved GOROOT", func(dt *distTest) error { - t.runPending(dt) - timelog("start", dt.name) - defer timelog("end", dt.name) - moved := goroot + "-moved" - if err := os.Rename(goroot, moved); err != nil { - if goos == "windows" { - // Fails on Windows (with "Access is denied") if a process - // or binary is in this directory. For instance, using all.bat - // when run from c:\workdir\go\src fails here - // if GO_BUILDER_NAME is set. Our builders invoke tests - // a different way which happens to work when sharding - // tests, but we should be tolerant of the non-sharded - // all.bat case. - log.Printf("skipping test on Windows") - return nil - } - return err - } - - // Run `go test fmt` in the moved GOROOT, without explicitly setting - // GOROOT in the environment. The 'go' command should find itself. - cmd, flush := (&goTest{ - variant: "moved_goroot", - goroot: moved, - pkg: "fmt", - }).command(t) - unsetEnv(cmd, "GOROOT") - err := cmd.Run() - flush() - - if rerr := os.Rename(moved, goroot); rerr != nil { - fatalf("failed to restore GOROOT: %v", rerr) - } - return err - }) - } - // Test that internal linking of standard packages does not // require libgcc. This ensures that we can install a Go // release on a system that does not have a C compiler |