From: Dave Cheney Date: Tue, 9 Apr 2013 02:48:04 +0000 (+1000) Subject: misc/dashboard/builder: add -race builder support X-Git-Tag: go1.1rc2~133 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=26312afd7b7f92201afa5f10e1c54803f27dbcf5;p=gostls13.git misc/dashboard/builder: add -race builder support If the build key contains -race, the builder will invoke to the race.{bat,bash} build command. This allows {darwin,linux,windows}-amd64 builders to do race and non race builds in sequence. R=adg, dvyukov, fullung CC=golang-dev https://golang.org/cl/8266046 --- diff --git a/misc/dashboard/builder/main.go b/misc/dashboard/builder/main.go index b2b8f43a6f..dfaba66c5c 100644 --- a/misc/dashboard/builder/main.go +++ b/misc/dashboard/builder/main.go @@ -64,6 +64,7 @@ var ( binaryTagRe = regexp.MustCompile(`^(release\.r|weekly\.)[0-9\-.]+`) releaseRe = regexp.MustCompile(`^release\.r[0-9\-.]+`) allCmd = "all" + suffix + raceCmd = "race" + suffix cleanCmd = "clean" + suffix suffix = defaultSuffix() ) @@ -211,6 +212,16 @@ func NewBuilder(goroot *Repo, name string) (*Builder, error) { return b, nil } +// buildCmd returns the build command to invoke. +// Builders which contain the string '-race' in their +// name will override *buildCmd and return raceCmd. +func (b *Builder) buildCmd() string { + if strings.Contains(b.name, "-race") { + return raceCmd + } + return *buildCmd +} + // build checks for a new commit for this builder // and builds it if one is found. // It returns true if a build was attempted. @@ -262,7 +273,7 @@ func (b *Builder) buildHash(hash string) error { defer f.Close() w := io.MultiWriter(f, &buildlog) - cmd := *buildCmd + cmd := b.buildCmd() if !filepath.IsAbs(cmd) { cmd = filepath.Join(srcDir, cmd) }