]> Cypherpunks repositories - gostls13.git/commitdiff
misc/makerelease: workaround the go install -a restriction on release branches
authorShenghou Ma <minux@golang.org>
Sat, 17 Jan 2015 02:07:23 +0000 (21:07 -0500)
committerMinux Ma <minux@golang.org>
Sun, 18 Jan 2015 23:20:25 +0000 (23:20 +0000)
Fixes #9619.

Change-Id: I71931b0d546163e5451d7d72e552b08540e3c2a7
Reviewed-on: https://go-review.googlesource.com/2995
Reviewed-by: Andrew Gerrand <adg@golang.org>
misc/makerelease/makerelease.go

index 0af0ebf2c95471852c35c639222b740d10c3ecbf..4b6e866b4416b7623c53347cc8a1c9d2cc8e1a69 100644 (file)
@@ -277,13 +277,27 @@ func (b *Build) Do() error {
                        if b.OS == "windows" {
                                goCmd += ".exe"
                        }
+                       // 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.
+                       goPkg := filepath.Join(b.root, "pkg", b.OS+"_"+b.Arch)
+                       err = os.RemoveAll(goPkg)
+                       if err != nil {
+                               return err
+                       }
+                       _, err = b.run(src, goCmd, "tool", "dist", "install", "runtime")
+                       if err != nil {
+                               return err
+                       }
                        _, err = b.run(src, goCmd, "install", "-race", "std")
                        if err != nil {
                                return err
                        }
-                       // Re-install std without -race, so that we're not left
-                       // with a slower, race-enabled cmd/go, etc.
-                       _, err = b.run(src, goCmd, "install", "-a", "std")
+                       _, err = b.run(src, goCmd, "install", "std")
+                       if 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.