summaryrefslogtreecommitdiff
path: root/misc/dashboard/builder/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'misc/dashboard/builder/main.go')
-rw-r--r--misc/dashboard/builder/main.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/misc/dashboard/builder/main.go b/misc/dashboard/builder/main.go
index 735717e28..d11cbb133 100644
--- a/misc/dashboard/builder/main.go
+++ b/misc/dashboard/builder/main.go
@@ -34,6 +34,7 @@ var extraEnv = []string{
"GOHOSTARCH",
"PATH",
"DISABLE_NET_TESTS",
+ "MAKEFLAGS",
"GOARM",
}
@@ -59,6 +60,7 @@ var (
buildRevision = flag.String("rev", "", "Build specified revision and exit")
buildCmd = flag.String("cmd", "./all.bash", "Build command (specify absolute or relative to go/src/)")
external = flag.Bool("external", false, "Build external packages")
+ parallel = flag.Bool("parallel", false, "Build multiple targets in parallel")
verbose = flag.Bool("v", false, "verbose")
)
@@ -132,9 +134,19 @@ func main() {
continue
}
built := false
- for _, b := range builders {
- if b.build() {
- built = true
+ if *parallel {
+ done := make(chan bool)
+ for _, b := range builders {
+ go func(b *Builder) {
+ done <- b.build()
+ }(b)
+ }
+ for _ = range builders {
+ built = <-done || built
+ }
+ } else {
+ for _, b := range builders {
+ built = b.build() || built
}
}
// only run benchmarks if we didn't build anything
@@ -185,7 +197,7 @@ func NewBuilder(builder string) (*Builder, os.Error) {
// get goos/goarch from builder string
s := strings.Split(builder, "-", 3)
- if len(s) == 2 {
+ if len(s) >= 2 {
b.goos, b.goarch = s[0], s[1]
} else {
return nil, fmt.Errorf("unsupported builder form: %s", builder)