]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: delete moved_goroot test
authorAustin Clements <austin@google.com>
Fri, 19 May 2023 20:58:37 +0000 (16:58 -0400)
committerBryan Mills <bcmills@google.com>
Fri, 19 May 2023 21:43:49 +0000 (21:43 +0000)
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>

src/cmd/dist/test.go

index 046d279c986eb764a53e59ba047a40481b1dd267..7d6016cdb85b3de6af120558b0fcb3717cf65958 100644 (file)
@@ -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