cmd/builder: automatically choose nacltest.bash for nacl- builds

This is a recapitulation of CL 114780043.

This change extends the buildCmd logic to automatically choose the
nacltest.bash build script if the builder key represents a nacl job.

This is a change I have been carrying for over year now which I have
to remember to reapply every time I rebuild the nacl-arm builder.

Change-Id: I3e86a3e62671cda6feb318bb4b312f5462436f27
Reviewed-on: https://go-review.googlesource.com/4261
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
Dave Cheney 2015-02-09 20:42:41 +00:00
Родитель cc587d4521
Коммит 50ae7f97b9
2 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -36,6 +36,10 @@ Optional flags:
-rev=N: Build revision N and exit
-cmd="./all.bash": Build command (specify absolute or relative to go/src)
This flag is overridden in the following conditions:
- If the build key ends in -race, then race.bash or race.bat will be chosen.
- If the build key begins with nacl, then nacltest.bash will be chosen.
-v: Verbose logging

Просмотреть файл

@ -74,6 +74,7 @@ var (
releaseRe = regexp.MustCompile(`^release\.r[0-9\-.]+`)
allCmd = "all" + suffix
makeCmd = "make" + suffix
naclCmd = "nacltest.bash" // nacl support is linux only
raceCmd = "race" + suffix
cleanCmd = "clean" + suffix
suffix = defaultSuffix()
@ -361,10 +362,15 @@ func (b *Builder) builderEnv(name string) (builderEnv, error) {
// buildCmd returns the build command to invoke.
// Builders which contain the string '-race' in their
// name will override *buildCmd and return raceCmd.
// Builders which start with "nacl-" will override
// *buildCmd and return naclCmd.
func (b *Builder) buildCmd() string {
if strings.Contains(b.name, "-race") {
return raceCmd
}
if strings.HasPrefix(b.name, "nacl-") {
return naclCmd
}
return *buildCmd
}