setNoOpt()
goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now
goBootstrap := pathf("%s/go_bootstrap", tooldir)
- cmdGo := pathf("%s/go", gorootBin)
if debug {
run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
copyfile(pathf("%s/compile1", tooldir), pathf("%s/compile", tooldir), writeExec)
goInstall(toolenv, goBootstrap, "cmd")
checkNotStale(nil, goBootstrap, "std")
checkNotStale(toolenv, goBootstrap, "cmd")
- checkNotStale(nil, cmdGo, "std")
- checkNotStale(toolenv, cmdGo, "cmd")
+ checkNotStale(nil, gorootBinGo, "std")
+ checkNotStale(toolenv, gorootBinGo, "cmd")
timelog("build", "target toolchain")
if vflag > 0 {
checkNotStale(toolenv, goBootstrap, append(toolchain, "runtime/internal/sys")...)
checkNotStale(nil, goBootstrap, "std")
checkNotStale(toolenv, goBootstrap, "cmd")
- checkNotStale(nil, cmdGo, "std")
- checkNotStale(toolenv, cmdGo, "cmd")
+ checkNotStale(nil, gorootBinGo, "std")
+ checkNotStale(toolenv, gorootBinGo, "cmd")
if debug {
run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
checkNotStale(toolenv, goBootstrap, append(toolchain, "runtime/internal/sys")...)
os.Setenv("GOOS", gohostos)
os.Setenv("GOARCH", gohostarch)
os.Setenv("CC", compilerEnvLookup("CC", defaultcc, gohostos, gohostarch))
- goCmd(nil, cmdGo, "build", "-o", pathf("%s/go_%s_%s_exec%s", gorootBin, goos, goarch, exe), wrapperPath)
+ goCmd(nil, gorootBinGo, "build", "-o", pathf("%s/go_%s_%s_exec%s", gorootBin, goos, goarch, exe), wrapperPath)
// Restore environment.
// TODO(elias.naur): support environment variables in goCmd?
os.Setenv("GOOS", goos)
if t.rebuild {
t.out("Building packages and commands.")
// Force rebuild the whole toolchain.
- goInstall(toolenv, "go", append([]string{"-a"}, toolchain...)...)
+ goInstall(toolenv, gorootBinGo, append([]string{"-a"}, toolchain...)...)
}
if !t.listMode {
// to break if we don't automatically refresh things here.
// Rebuilding is a shortened bootstrap.
// See cmdbootstrap for a description of the overall process.
- goInstall(toolenv, "go", toolchain...)
- goInstall(toolenv, "go", toolchain...)
- goInstall(toolenv, "go", "cmd")
- goInstall(nil, "go", "std")
+ goInstall(toolenv, gorootBinGo, toolchain...)
+ goInstall(toolenv, gorootBinGo, toolchain...)
+ goInstall(toolenv, gorootBinGo, "cmd")
+ goInstall(nil, gorootBinGo, "std")
} else {
// The Go builder infrastructure should always begin running tests from a
// clean, non-stale state, so there is no need to rebuild the world.
// The cache used by dist when building is different from that used when
// running dist test, so rebuild (but don't install) std and cmd to make
// sure packages without install targets are cached so they are not stale.
- goCmd(toolenv, "go", "build", "cmd") // make sure dependencies of targets are cached
- goCmd(nil, "go", "build", "std")
- checkNotStale(nil, "go", "std")
+ goCmd(toolenv, gorootBinGo, "build", "cmd") // make sure dependencies of targets are cached
+ goCmd(nil, gorootBinGo, "build", "std")
+ checkNotStale(nil, gorootBinGo, "std")
if builder != "aix-ppc64" {
// The aix-ppc64 builder for some reason does not have deterministic cgo
// builds, so "cmd" is stale. Fortunately, most of the tests don't care.
// TODO(#56896): remove this special case once the builder supports
// determistic cgo builds.
- checkNotStale(toolenv, "go", "cmd")
+ checkNotStale(toolenv, gorootBinGo, "cmd")
}
}
}
//
// TODO(prattmic): If we split dist bootstrap and dist test then this
// could be simplified to directly use internal/sysinfo here.
- return t.dirCmd(filepath.Join(goroot, "src/cmd/internal/metadata"), "go", []string{"run", "main.go"}).Run()
+ return t.dirCmd(filepath.Join(goroot, "src/cmd/internal/metadata"), gorootBinGo, []string{"run", "main.go"}).Run()
}
// goTest represents all options to a "go test" command. The final command will
}
bin = list[0]
- if bin == "go" {
- bin = gorootBinGo
- }
return bin, list[1:]
}
// running in parallel with earlier tests, or if it has some other reason
// for needing the earlier tests to be done.
func (t *tester) runPending(nextTest *distTest) {
- checkNotStale(nil, "go", "std")
+ checkNotStale(nil, gorootBinGo, "std")
worklist := t.worklist
t.worklist = nil
for _, w := range worklist {
log.Printf("Failed: %v", w.err)
t.failed = true
}
- checkNotStale(nil, "go", "std")
+ checkNotStale(nil, gorootBinGo, "std")
}
if t.failed && !t.keepGoing {
fatalf("FAILED")
os.Remove(runtest.exe)
})
- cmd := t.dirCmd("test", "go", "build", "-o", runtest.exe, "run.go")
+ cmd := t.dirCmd("test", gorootBinGo, "build", "-o", runtest.exe, "run.go")
setEnv(cmd, "GOOS", gohostos)
setEnv(cmd, "GOARCH", gohostarch)
runtest.err = cmd.Run()