]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: limit default darwin/arm parallelism
authorDavid Crawshaw <crawshaw@golang.org>
Tue, 24 Feb 2015 16:10:13 +0000 (11:10 -0500)
committerDavid Crawshaw <crawshaw@golang.org>
Tue, 24 Feb 2015 17:28:53 +0000 (17:28 +0000)
iOS devices can only run tests serially.

Change-Id: I3f4e7abddf812a186895d9d5138999c8bded698f
Reviewed-on: https://go-review.googlesource.com/5751
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
src/cmd/go/build.go

index e1aa9fcb3158f0d12ac9a4b6cda327339d9adf46..382c4cd2762edf7c7c8183cd8aab2f4ee43273bf 100644 (file)
@@ -62,7 +62,8 @@ and test commands:
                print the commands but do not run them.
        -p n
                the number of builds that can be run in parallel.
-               The default is the number of CPUs available.
+               The default is the number of CPUs available, except
+               on darwin/arm which defaults to 1.
        -race
                enable data race detection.
                Supported only on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64.
@@ -117,6 +118,14 @@ func init() {
 
        addBuildFlags(cmdBuild)
        addBuildFlags(cmdInstall)
+
+       if buildContext.GOOS == "darwin" && buildContext.GOARCH == "arm" {
+               // darwin/arm cannot run multiple tests simultaneously.
+               // Parallelism is limited in go_darwin_arm_exec, but
+               // also needs to be limited here so go test std does not
+               // timeout tests that waiting to run.
+               buildP = 1
+       }
 }
 
 // Flags set by multiple commands.