From 401a9dbc453abf84e3f8e6dbdf8fc6028d5d84f6 Mon Sep 17 00:00:00 2001 From: Chris Broadfoot Date: Thu, 17 Dec 2015 15:17:05 -0800 Subject: [PATCH] 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 --- cmd/release/release.go | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/cmd/release/release.go b/cmd/release/release.go index 8df3baf9..fe7e6c7a 100644 --- a/cmd/release/release.go +++ b/cmd/release/release.go @@ -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, ", "))