зеркало из https://github.com/golang/build.git
cmd/release: don't remove pkg when building race detector
Fixes golang/go#13664. Change-Id: I2d4d3ac833f99e052ee35bdc17a061edac085c83 Reviewed-on: https://go-review.googlesource.com/18017 Reviewed-by: Minux Ma <minux@golang.org>
This commit is contained in:
Родитель
e296e7ebd7
Коммит
401a9dbc45
|
@ -368,30 +368,9 @@ func (b *Build) make() error {
|
|||
if b.Race {
|
||||
b.logf("Building race detector.")
|
||||
|
||||
// Because on release branches, go install -a std is a NOP,
|
||||
// we have to resort to delete pkg/$GOOS_$GOARCH, install -race,
|
||||
// and then reinstall std so that we're not left with a slower,
|
||||
// race-enabled cmd/go, etc.
|
||||
if err := client.RemoveAll(path.Join(goDir, "pkg", b.OS+"_"+b.Arch)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := runGo("tool", "dist", "install", "runtime"); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := runGo("install", "-race", "std"); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := runGo("install", "std"); err != nil {
|
||||
return err
|
||||
}
|
||||
// Re-building go command leaves old versions of go.exe as go.exe~ on windows.
|
||||
// See (*builder).copyFile in $GOROOT/src/cmd/go/build.go for details.
|
||||
// Remove it manually.
|
||||
if b.OS == "windows" {
|
||||
if err := client.RemoveAll(goCmd + "~"); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
b.logf("Building %v.", strings.Join(toolPaths, ", "))
|
||||
|
|
Загрузка…
Ссылка в новой задаче