diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index bc1f7339a2..fe9dcc216e 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -133,7 +133,11 @@ func (t *tester) run() { // to break if we don't automatically refresh things here. // Rebuilding is a shortened bootstrap. // See cmdbootstrap for a description of the overall process. - if !t.listMode { + // + // But don't do this if we're running in the Go build system, + // where cmd/dist is invoked many times. This just slows that + // down (Issue 24300). + if !t.listMode && os.Getenv("GO_BUILDER_NAME") == "" { goInstall("go", append([]string{"-i"}, toolchain...)...) goInstall("go", append([]string{"-i"}, toolchain...)...) goInstall("go", "std", "cmd")