dashboard: promote misc-compile-darwinarm64 builder to a TryBot

Testing shows that misc-compile-darwinarm64 is working as expected
on recent commits. Promote it to a normal misc-compile TryBot now,
with the exception that it needs to run on Go 1.16 and newer only.

Fixes golang/go#42341.

Change-Id: Ib4de19a2ff904fb9de056db5076ac63690eb934c
Reviewed-on: https://go-review.googlesource.com/c/build/+/267123
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/dashboard/builders.go b/dashboard/builders.go
index 5f8a84d..aae71b3 100644
--- a/dashboard/builders.go
+++ b/dashboard/builders.go
@@ -1538,12 +1538,19 @@
 		})
 	}
 
-	// addMiscCompile adds a misc-compile builder that runs
+	// addMiscCompileGo1 adds a misc-compile TryBot that runs
 	// buildall.bash on a subset of platforms matching the egrep
 	// pattern rx. The pattern is matched against the "go tool
 	// dist list" name, but with hyphens instead of forward
 	// slashes ("linux-amd64", etc).
-	addMiscCompile := func(suffix, rx string) {
+	// If min is non-zero, it specifies the minimum Go 1.x version.
+	addMiscCompileGo1 := func(min int, suffix, rx string) {
+		var v types.MajorMinor
+		var alsoNote string
+		if min != 0 {
+			v = types.MajorMinor{1, min}
+			alsoNote = fmt.Sprintf(" Applies to Go 1.%d and newer.", min)
+		}
 		addBuilder(BuildConfig{
 			Name:     "misc-compile" + suffix,
 			HostType: "host-linux-jessie",
@@ -1551,45 +1558,23 @@
 			env: []string{
 				"GO_DISABLE_OUTBOUND_NETWORK=1",
 			},
-			tryOnly:     true,
-			CompileOnly: true,
-			Notes:       "Runs buildall.bash to cross-compile & vet std+cmd packages for " + rx + ", but doesn't run any tests.",
+			tryOnly:          true,
+			MinimumGoVersion: v,
+			CompileOnly:      true,
+			Notes:            "Runs buildall.bash to cross-compile & vet std+cmd packages for " + rx + ", but doesn't run any tests." + alsoNote,
 			allScriptArgs: []string{
 				// Filtering pattern to buildall.bash:
 				rx,
 			},
 		})
 	}
-	// tryNewMiscCompile is an intermediate step towards adding a real addMiscCompile TryBot.
-	// It adds a post-submit-only builder with KnownIssue, GoDeps set to the provided values,
-	// and runs on a limited set of branches to get test results without potential disruption
-	// for contributors. It can be modified as needed when onboarding a misc-compile builder.
-	tryNewMiscCompile := func(suffix, rx string, knownIssue int, goDeps []string) {
-		addBuilder(BuildConfig{
-			Name:        "misc-compile" + suffix,
-			HostType:    "host-linux-jessie",
-			buildsRepo:  func(repo, branch, goBranch string) bool { return repo == "go" && branch == "master" },
-			KnownIssue:  knownIssue,
-			GoDeps:      goDeps,
-			env:         []string{"GO_DISABLE_OUTBOUND_NETWORK=1"},
-			CompileOnly: true,
-			Notes:       fmt.Sprintf("Tries buildall.bash to cross-compile & vet std+cmd packages for "+rx+", but doesn't run any tests. See golang.org/issue/%d.", knownIssue),
-			allScriptArgs: []string{
-				// Filtering pattern to buildall.bash:
-				rx,
-			},
-		})
-	}
-
-	// TODO(golang.org/issue/42341): Try out misc-compile-darwinarm64.
-	tryNewMiscCompile("-darwinarm64", "^darwin-arm64$", 42341,
-		[]string{
-			"b85c2dd56c4ecc7bf445bd1615467ecd38598eee", // CL 265121, "cmd/link: enable internal linking by default on darwin/arm64".
-		},
-	) // 1: arm64 (for Go 1.16 and newer)
+	// addMiscCompile adds a misc-compile TryBot
+	// for all supported Go versions.
+	addMiscCompile := func(suffix, rx string) { addMiscCompileGo1(0, suffix, rx) }
 
 	addMiscCompile("-linuxarm", "^linux-arm")                // 2: arm, arm64
 	addMiscCompile("-darwin", "^darwin-(386|amd64)$")        // 1: amd64 (in Go 1.14: 386, amd64)
+	addMiscCompileGo1(16, "-darwinarm64", "^darwin-arm64$")  // 1: arm64 (for Go 1.16 and newer)
 	addMiscCompile("-mips", "^linux-mips")                   // 4: mips, mipsle, mips64, mips64le
 	addMiscCompile("-ppc", "^(linux-ppc64|aix-)")            // 3: linux-ppc64{,le}, aix-ppc64
 	addMiscCompile("-solaris", "^(solaris|illumos)")         // 2: both amd64
@@ -2551,6 +2536,30 @@
 	Builders[c.Name] = &c
 }
 
+// tryNewMiscCompile is an intermediate step towards adding a real addMiscCompile TryBot.
+// It adds a post-submit-only builder with KnownIssue, GoDeps set to the provided values,
+// and runs on a limited set of branches to get test results without potential disruption
+// for contributors. It can be modified as needed when onboarding a misc-compile builder.
+func tryNewMiscCompile(suffix, rx string, knownIssue int, goDeps []string) {
+	if knownIssue == 0 {
+		panic("tryNewMiscCompile: knownIssue parameter must be non-zero")
+	}
+	addBuilder(BuildConfig{
+		Name:        "misc-compile" + suffix,
+		HostType:    "host-linux-jessie",
+		buildsRepo:  func(repo, branch, goBranch string) bool { return repo == "go" && branch == "master" },
+		KnownIssue:  knownIssue,
+		GoDeps:      goDeps,
+		env:         []string{"GO_DISABLE_OUTBOUND_NETWORK=1"},
+		CompileOnly: true,
+		Notes:       fmt.Sprintf("Tries buildall.bash to cross-compile & vet std+cmd packages for "+rx+", but doesn't run any tests. See golang.org/issue/%d.", knownIssue),
+		allScriptArgs: []string{
+			// Filtering pattern to buildall.bash:
+			rx,
+		},
+	})
+}
+
 // fasterTrybots is a distTestAdjust policy function.
 // It skips (returns false) the test/ directory and reboot tests for trybots.
 func fasterTrybots(run bool, distTest string, isNormalTry bool) bool {
diff --git a/dashboard/builders_test.go b/dashboard/builders_test.go
index 97742f6..2648b90 100644
--- a/dashboard/builders_test.go
+++ b/dashboard/builders_test.go
@@ -99,6 +99,7 @@
 				"linux-amd64-race",
 				"misc-compile-other",
 				"misc-compile-darwin",
+				"misc-compile-darwinarm64",
 				"misc-compile-linuxarm",
 				"misc-compile-solaris",
 				"misc-compile-freebsd",
@@ -124,6 +125,7 @@
 				"linux-amd64-race",
 				"misc-compile-other",
 				"misc-compile-darwin",
+				"misc-compile-darwinarm64",
 				"misc-compile-linuxarm",
 				"misc-compile-solaris",
 				"misc-compile-freebsd",
@@ -139,6 +141,37 @@
 		},
 		{
 			repo:   "go",
+			branch: "release-branch.go1.16",
+			want: []string{
+				"android-amd64-emu",
+				"freebsd-amd64-12_0",
+				"js-wasm",
+				"linux-386",
+				"linux-amd64",
+				"linux-amd64-race",
+				"misc-compile-darwin",
+				"misc-compile-darwinarm64", // Starts with Go 1.16.
+				"misc-compile-freebsd",
+				"misc-compile-linuxarm",
+				"misc-compile-mips",
+				"misc-compile-netbsd",
+				"misc-compile-openbsd",
+				"misc-compile-other",
+				"misc-compile-plan9",
+				"misc-compile-ppc",
+				"misc-compile-solaris",
+				"openbsd-amd64-64",
+				"windows-386-2008",
+				"windows-amd64-2016",
+
+				// Include longtest builders on Go repo release branches. See issue 37827.
+				"linux-386-longtest",
+				"linux-amd64-longtest",
+				"windows-amd64-longtest",
+			},
+		},
+		{
+			repo:   "go",
 			branch: "release-branch.go1.14",
 			want: []string{
 				"android-amd64-emu",