internal/version: remove GOROOT_BOOTSTRAP windows workaround
This workaround was initially added in 2018 (CL 152857). Issue golang/go#28641 has since been resolved in 2020 (CL 96455). Fixes golang/go#60350. Change-Id: I0cd99b2eb0ce40658a4c11cdb8b4ba0ceef1e2a7 Reviewed-on: https://go-review.googlesource.com/c/dl/+/497335 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
Родитель
5216546bad
Коммит
984e19f58c
|
@ -13,7 +13,6 @@ import (
|
|||
"regexp"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// RunTip runs the "go" tool from the development tree.
|
||||
|
@ -149,17 +148,7 @@ func installTip(root, target string) error {
|
|||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
cmd.Dir = filepath.Join(root, "src")
|
||||
if runtime.GOOS == "windows" {
|
||||
// Workaround make.bat not autodetecting GOROOT_BOOTSTRAP. Issue 28641.
|
||||
goroot, err := exec.Command("go", "env", "GOROOT").Output()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to detect an existing go installation for bootstrap: %v", err)
|
||||
}
|
||||
cmd.Env = append(os.Environ(), "GOROOT_BOOTSTRAP="+strings.TrimSpace(string(goroot)))
|
||||
} else {
|
||||
cmd.Env = os.Environ()
|
||||
}
|
||||
cmd.Env = dedupEnv(caseInsensitiveEnv, append(cmd.Env, "PWD="+cmd.Dir))
|
||||
cmd.Env = dedupEnv(caseInsensitiveEnv, append(os.Environ(), "PWD="+cmd.Dir))
|
||||
|
||||
if err := cmd.Run(); err != nil {
|
||||
return fmt.Errorf("failed to build go: %v", err)
|
||||
|
|
Загрузка…
Ссылка в новой задаче