Commit 57af97f2 authored by Andrew Gerrand's avatar Andrew Gerrand

misc/dist: include race detector packages in binary distributions

Fixes #4596.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/8327045
parent c4e82bb9
...@@ -29,13 +29,14 @@ import ( ...@@ -29,13 +29,14 @@ import (
) )
var ( var (
tag = flag.String("tag", "release", "mercurial tag to check out") tag = flag.String("tag", "release", "mercurial tag to check out")
repo = flag.String("repo", "https://code.google.com/p/go", "repo URL") repo = flag.String("repo", "https://code.google.com/p/go", "repo URL")
tourPath = flag.String("tour", "code.google.com/p/go-tour", "Go tour repo import path") tourPath = flag.String("tour", "code.google.com/p/go-tour", "Go tour repo import path")
verbose = flag.Bool("v", false, "verbose output") verbose = flag.Bool("v", false, "verbose output")
upload = flag.Bool("upload", true, "upload resulting files to Google Code") upload = flag.Bool("upload", true, "upload resulting files to Google Code")
wxsFile = flag.String("wxs", "", "path to custom installer.wxs") wxsFile = flag.String("wxs", "", "path to custom installer.wxs")
addLabel = flag.String("label", "", "additional label to apply to file when uploading") addLabel = flag.String("label", "", "additional label to apply to file when uploading")
includeRace = flag.Bool("race", true, "build race detector packages")
username, password string // for Google Code upload username, password string // for Google Code upload
) )
...@@ -187,6 +188,16 @@ func (b *Build) Do() error { ...@@ -187,6 +188,16 @@ func (b *Build) Do() error {
if err != nil { if err != nil {
return err return err
} }
if !b.Source && *includeRace {
goCmd := filepath.Join(b.root, "bin", "go")
if b.OS == "windows" {
goCmd += ".exe"
}
_, err = b.run(src, goCmd, "install", "-race", "std")
if err != nil {
return err
}
}
if err := b.tour(); err != nil { if err := b.tour(); err != nil {
return err return err
...@@ -388,7 +399,7 @@ func (b *Build) tour() error { ...@@ -388,7 +399,7 @@ func (b *Build) tour() error {
// Copy gotour binary to tool directory as "tour"; invoked as "go tool tour". // Copy gotour binary to tool directory as "tour"; invoked as "go tool tour".
gotour := "gotour" gotour := "gotour"
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
gotour = "gotour.exe" gotour += ".exe"
} }
return cp( return cp(
filepath.Join(b.root, "pkg", "tool", b.OS+"_"+b.Arch, "tour"), filepath.Join(b.root, "pkg", "tool", b.OS+"_"+b.Arch, "tour"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment