dashboard: don't build x/build on so many builders

It was kinda overkill.

Change-Id: Ied7fc42aa59a1ed18cc1da20e51c8ed386d84629
Reviewed-on: https://go-review.googlesource.com/c/build/+/210378
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
diff --git a/dashboard/builders.go b/dashboard/builders.go
index f3bfd76..4e87227 100644
--- a/dashboard/builders.go
+++ b/dashboard/builders.go
@@ -1192,8 +1192,8 @@
 	switch repo {
 	case "go":
 		return true
-	case "mobile", "exp":
-		// mobile and exp are opt-in.
+	case "mobile", "exp", "build":
+		// opt-in builders.
 		return false
 	}
 	return true
@@ -1206,6 +1206,13 @@
 	return defaultBuildsRepoPolicy(repo, branch, goBranch)
 }
 
+func defaultPlusExpBuild(repo, branch, goBranch string) bool {
+	if repo == "exp" || repo == "build" {
+		return true
+	}
+	return defaultBuildsRepoPolicy(repo, branch, goBranch)
+}
+
 // AllScriptArgs returns the set of arguments that should be passed to the
 // all.bash-equivalent script. Usually empty.
 func (c *BuildConfig) AllScriptArgs() []string {
@@ -1505,7 +1512,7 @@
 		Name:       "linux-amd64",
 		HostType:   "host-linux-stretch",
 		tryBot:     defaultTrySet(),
-		buildsRepo: defaultPlusExp,
+		buildsRepo: defaultPlusExpBuild,
 		env: []string{
 			"GO_DISABLE_OUTBOUND_NETWORK=1",
 		},
@@ -1633,7 +1640,7 @@
 		Name:              "linux-amd64-race",
 		HostType:          "host-linux-jessie",
 		tryBot:            defaultTrySet(),
-		buildsRepo:        defaultPlusExp,
+		buildsRepo:        defaultPlusExpBuild,
 		shouldRunDistTest: fasterTrybots,
 		numTestHelpers:    1,
 		numTryTestHelpers: 5,
@@ -1973,7 +1980,7 @@
 	addBuilder(BuildConfig{
 		Name:              "windows-386-2008",
 		HostType:          "host-windows-amd64-2008",
-		buildsRepo:        defaultPlusExp,
+		buildsRepo:        defaultPlusExpBuild,
 		shouldRunDistTest: fasterTrybots,
 		env:               []string{"GOARCH=386", "GOHOSTARCH=386"},
 		tryBot:            defaultTrySet(),
@@ -1997,7 +2004,7 @@
 	addBuilder(BuildConfig{
 		Name:              "windows-amd64-2016",
 		HostType:          "host-windows-amd64-2016",
-		buildsRepo:        defaultPlusExp,
+		buildsRepo:        defaultPlusExpBuild,
 		shouldRunDistTest: fasterTrybots,
 		env: []string{
 			"GOARCH=amd64",
@@ -2016,7 +2023,7 @@
 		HostType: "host-windows-amd64-2016-big",
 		Notes:    "Windows Server 2016 with go test -short=false",
 		buildsRepo: func(repo, branch, goBranch string) bool {
-			if !defaultPlusExp(repo, branch, goBranch) {
+			if !defaultPlusExpBuild(repo, branch, goBranch) {
 				return false
 			}
 			return repo == "go" || (branch == "master" && goBranch == "master")
@@ -2098,7 +2105,7 @@
 		Name:              "darwin-amd64-10_15",
 		HostType:          "host-darwin-10_15",
 		shouldRunDistTest: macTestPolicy,
-		buildsRepo:        defaultPlusExp,
+		buildsRepo:        defaultPlusExpBuild,
 	})
 	addBuilder(BuildConfig{
 		Name:              "darwin-amd64-nocgo",
diff --git a/dashboard/builders_test.go b/dashboard/builders_test.go
index 6154edb..7ce63ec 100644
--- a/dashboard/builders_test.go
+++ b/dashboard/builders_test.go
@@ -511,6 +511,20 @@
 		{b("linux-amd64@go1.11", "exp"), none},
 		{b("linux-amd64@go1.12", "exp"), none},
 
+		// the build repo is only really useful for linux-amd64 (where we run it),
+		// and darwin-amd64 and perhaps windows-amd64 (for stuff like gomote).
+		// No need for any other operating systems to use it.
+		{b("linux-amd64", "build"), both},
+		{b("linux-amd64-longtest", "build"), onlyPost},
+		{b("windows-amd64-2016", "build"), both},
+		{b("darwin-amd64-10_12", "build"), none},
+		{b("darwin-amd64-10_14", "build"), none},
+		{b("darwin-amd64-10_15", "build"), onlyPost},
+		{b("openbsd-amd64-64", "build"), none},
+		{b("linux-amd64-fedora", "build"), none},
+		{b("linux-amd64-clang", "build"), none},
+		{b("linux-amd64-sid", "build"), none},
+
 		// Only use latest macOS for subrepos, and only amd64:
 		{b("darwin-amd64-10_12", "net"), onlyPost},
 		{b("darwin-amd64-10_12@go1.11", "net"), onlyPost},