blob: d3ba87cdd1f44662eee1d0a6d73cd55e6eb79674 [file] [log] [blame]
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -08001// Copyright 2015 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Package dashboard contains shared configuration and logic used by various
6// pieces of the Go continuous build system.
7package dashboard
8
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -07009import (
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +000010 "fmt"
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +000011 "os"
Brad Fitzpatrickc328d042017-04-12 00:35:37 +000012 "sort"
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -070013 "strconv"
14 "strings"
Brad Fitzpatrick34b995b2019-02-14 02:18:06 +000015 "time"
Evan Browna7311512016-02-14 15:59:59 -080016
17 "golang.org/x/build/buildenv"
Brad Fitzpatrick756764c2019-03-07 17:44:41 +000018 "golang.org/x/build/maintner/maintnerd/maintapi/version"
Dmitri Shuralyovad59fb12019-01-11 16:44:01 -050019 "golang.org/x/build/types"
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -070020)
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -080021
Brad Fitzpatrickaab85042019-10-16 06:02:29 +000022// slowBotAliases maps short names from TRY= comments to which builder to run.
23//
24// TODO: we'll likely expand this, or move it, or change the matching
25// syntax entirely. This is a first draft.
26var slowBotAliases = map[string]string{
27 // Known missing builders:
Alexander Rakoczy76eb6412021-06-29 11:40:03 -040028 "ios-amd64": "", // There is no builder for the iOS Simulator. See issues 42100 and 42177.
Brad Fitzpatrickaab85042019-10-16 06:02:29 +000029
Lynn Boger0364c522021-03-15 09:39:52 -050030 "386": "linux-386",
31 "aix": "aix-ppc64",
32 "amd64": "linux-amd64",
33 "android": "android-amd64-emu",
34 "android-386": "android-386-emu",
35 "android-amd64": "android-amd64-emu",
36 "android-arm": "android-arm-corellium",
37 "android-arm64": "android-arm64-corellium",
Carlos Amedeec1822c72021-03-19 13:54:17 -040038 "arm": "linux-arm-aws",
Carlos Amedee34b0d642021-03-19 14:53:06 -040039 "arm64": "linux-arm64-aws",
Lynn Boger0364c522021-03-15 09:39:52 -050040 "darwin": "darwin-amd64-10_14",
41 "darwin-amd64": "darwin-amd64-10_14",
42 "darwin-arm64": "darwin-arm64-11_0-toothrot",
43 "ios-arm64": "ios-arm64-corellium",
44 "dragonfly": "dragonfly-amd64",
Carlos Amedee2ecf4242021-04-23 11:33:51 -040045 "freebsd": "freebsd-amd64-12_2",
46 "freebsd-386": "freebsd-386-12_2",
47 "freebsd-amd64": "freebsd-amd64-12_2",
Lynn Boger0364c522021-03-15 09:39:52 -050048 "freebsd-arm": "freebsd-arm-paulzhol",
49 "freebsd-arm64": "freebsd-arm64-dmgk",
50 "illumos": "illumos-amd64",
51 "ios": "ios-arm64-corellium",
52 "js": "js-wasm",
53 "linux": "linux-amd64",
Carlos Amedeec1822c72021-03-19 13:54:17 -040054 "linux-arm": "linux-arm-aws",
Carlos Amedee34b0d642021-03-19 14:53:06 -040055 "linux-arm64": "linux-arm64-aws",
Xiaodong Liu5eaa6e02021-09-02 15:51:28 +080056 "linux-loong64": "linux-loong64-3a5000",
Lynn Boger0364c522021-03-15 09:39:52 -050057 "linux-mips": "linux-mips-rtrk",
58 "linux-mips64": "linux-mips64-rtrk",
59 "linux-mips64le": "linux-mips64le-mengzhuo",
60 "linux-mipsle": "linux-mipsle-rtrk",
61 "linux-ppc64": "linux-ppc64-buildlet",
62 "linux-ppc64le": "linux-ppc64le-buildlet",
63 "linux-ppc64le-power9": "linux-ppc64le-power9osu",
64 "linux-riscv64": "linux-riscv64-jsing",
65 "linux-s390x": "linux-s390x-ibm",
66 "longtest": "linux-amd64-longtest",
67 "mac": "darwin-amd64-10_14",
68 "macos": "darwin-amd64-10_14",
69 "mips": "linux-mips-rtrk",
70 "mips64": "linux-mips64-rtrk",
71 "mips64le": "linux-mips64le-mengzhuo",
72 "mipsle": "linux-mipsle-rtrk",
73 "netbsd": "netbsd-amd64-9_0",
74 "netbsd-386": "netbsd-386-9_0",
75 "netbsd-amd64": "netbsd-amd64-9_0",
76 "netbsd-arm": "netbsd-arm-bsiegert",
77 "netbsd-arm64": "netbsd-arm64-bsiegert",
78 "nocgo": "linux-amd64-nocgo",
79 "openbsd": "openbsd-amd64-68",
80 "openbsd-386": "openbsd-386-68",
81 "openbsd-amd64": "openbsd-amd64-68",
82 "openbsd-arm": "openbsd-arm-jsing",
83 "openbsd-arm64": "openbsd-arm64-jsing",
84 "openbsd-mips64": "openbsd-mips64-jsing",
85 "plan9": "plan9-arm",
86 "plan9-386": "plan9-386-0intro",
David du Colombier9d711212021-04-05 20:42:05 +020087 "plan9-amd64": "plan9-amd64-0intro",
Lynn Boger0364c522021-03-15 09:39:52 -050088 "ppc64": "linux-ppc64-buildlet",
89 "ppc64le": "linux-ppc64le-buildlet",
90 "ppc64lep9": "linux-ppc64le-power9osu",
91 "riscv64": "linux-riscv64-jsing",
92 "s390x": "linux-s390x-ibm",
93 "solaris": "solaris-amd64-oraclerel",
94 "solaris-amd64": "solaris-amd64-oraclerel",
95 "wasm": "js-wasm",
96 "windows": "windows-amd64-2016",
97 "windows-386": "windows-386-2008",
98 "windows-amd64": "windows-amd64-2016",
99 "windows-arm": "windows-arm-zx2c4",
Alexander Rakoczy76eb6412021-06-29 11:40:03 -0400100 "windows-arm64": "windows-arm64-10",
Brad Fitzpatrickaab85042019-10-16 06:02:29 +0000101}
102
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800103// Builders are the different build configurations.
104// The keys are like "darwin-amd64" or "linux-386-387".
105// This map should not be modified by other packages.
Brad Fitzpatrickc328d042017-04-12 00:35:37 +0000106// Initialization happens below, via calls to addBuilder.
Brad Fitzpatrick5eb896e2018-10-26 17:52:25 +0000107var Builders = map[string]*BuildConfig{}
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800108
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000109// Hosts contains the names and configs of all the types of
110// buildlets. They can be VMs, containers, or dedicated machines.
111var Hosts = map[string]*HostConfig{
Carlos Amedee43864932021-08-16 15:35:39 -0400112 "host-linux-bullseye": &HostConfig{
113 Notes: "Debian Bullseye",
114 ContainerImage: "linux-x86-bullseye:latest",
115 buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
116 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
117 SSHUsername: "root",
118 },
Carlos Amedee81f4b092020-11-02 15:11:10 -0500119 "host-linux-buster": &HostConfig{
120 Notes: "Debian Buster",
121 ContainerImage: "linux-x86-buster:latest",
122 buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
123 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
124 SSHUsername: "root",
125 },
Brad Fitzpatrickade28622018-05-14 17:22:45 +0000126 "host-linux-jessie": &HostConfig{
Brad Fitzpatrick6ae87502018-05-04 02:42:17 +0000127 Notes: "Debian Jessie, our standard Linux container image.",
Brad Fitzpatrickade28622018-05-14 17:22:45 +0000128 ContainerImage: "linux-x86-jessie:latest",
129 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
130 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
131 SSHUsername: "root",
132 },
133 "host-linux-stretch": &HostConfig{
134 Notes: "Debian Stretch",
135 ContainerImage: "linux-x86-stretch:latest",
Brad Fitzpatrick61ce0be2019-03-14 16:06:57 +0000136 machineType: "n1-standard-4", // 4 vCPUs, 15 GB mem
137 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
138 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
139 SSHUsername: "root",
140 },
141 "host-linux-stretch-morecpu": &HostConfig{
Dmitri Shuralyov99393002019-11-22 18:01:25 -0500142 Notes: "Debian Stretch, but on n1-highcpu-16",
Brad Fitzpatrick61ce0be2019-03-14 16:06:57 +0000143 ContainerImage: "linux-x86-stretch:latest",
Dmitri Shuralyov32356192019-08-30 14:27:13 -0400144 machineType: "n1-highcpu-16", // 16 vCPUs, 14.4 GB mem
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000145 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
146 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +0000147 SSHUsername: "root",
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000148 },
Brad Fitzpatrick0261b662019-02-15 22:05:42 +0000149 "host-linux-stretch-vmx": &HostConfig{
150 Notes: "Debian Stretch w/ Nested Virtualization (VMX CPU bit) enabled, for testing",
151 ContainerImage: "linux-x86-stretch:latest",
152 NestedVirt: true,
153 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
154 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
155 SSHUsername: "root",
156 },
Brad Fitzpatrick46ecb432016-09-23 20:44:43 +0000157 "host-linux-armhf-cross": &HostConfig{
Brad Fitzpatrick4ef0deb2019-10-19 04:02:04 +0000158 Notes: "Debian with armhf cross-compiler, built from env/crosscompile/linux-armhf",
159 ContainerImage: "linux-armhf-cross:latest",
Brad Fitzpatrick46ecb432016-09-23 20:44:43 +0000160 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
161 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
162 },
Jeff Wendling02f25ac2017-03-23 09:46:39 -0600163 "host-linux-armel-cross": &HostConfig{
Brad Fitzpatrick4ef0deb2019-10-19 04:02:04 +0000164 Notes: "Debian with armel cross-compiler, from env/crosscompile/linux-armel",
165 ContainerImage: "linux-armel-cross:latest",
Jeff Wendling02f25ac2017-03-23 09:46:39 -0600166 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
167 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
168 },
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +0000169 "host-linux-amd64-localdev": &HostConfig{
170 IsReverse: true,
171 ExpectNum: 0,
172 Notes: "for localhost development of buildlets/gomote/coordinator only",
173 SSHUsername: os.Getenv("USER"),
174 },
Brad Fitzpatrick4b011fe2018-05-11 05:54:32 +0000175 "host-js-wasm": &HostConfig{
176 Notes: "Container with node.js for testing js/wasm.",
177 ContainerImage: "js-wasm:latest",
178 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
179 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
Brad Fitzpatrickc7f36d02019-11-15 20:31:23 +0000180 SSHUsername: "root",
Brad Fitzpatrick4b011fe2018-05-11 05:54:32 +0000181 },
Brad Fitzpatrick76cf9682019-12-04 21:27:28 +0000182 "host-s390x-cross": &HostConfig{
Brad Fitzpatrick6ae87502018-05-04 02:42:17 +0000183 Notes: "Container with s390x cross-compiler.",
Brad Fitzpatrick4ef0deb2019-10-19 04:02:04 +0000184 ContainerImage: "linux-s390x-cross:latest",
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000185 buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
186 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
187 },
Jess Frazelle5c1740d2016-12-02 11:14:12 -0800188 "host-linux-x86-alpine": &HostConfig{
Brad Fitzpatrick6ae87502018-05-04 02:42:17 +0000189 Notes: "Alpine container",
Brad Fitzpatrick14d99732018-05-05 16:36:05 +0000190 ContainerImage: "linux-x86-alpine:latest",
Brad Fitzpatrickc7f36d02019-11-15 20:31:23 +0000191 buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.linux-amd64-static",
Jess Frazelle5c1740d2016-12-02 11:14:12 -0800192 env: []string{"GOROOT_BOOTSTRAP=/usr/lib/go"},
Brad Fitzpatrickc7f36d02019-11-15 20:31:23 +0000193 SSHUsername: "root",
Jess Frazelle5c1740d2016-12-02 11:14:12 -0800194 },
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000195 "host-linux-clang": &HostConfig{
Brad Fitzpatrick6ae87502018-05-04 02:42:17 +0000196 Notes: "Container with clang.",
Brad Fitzpatrick14d99732018-05-05 16:36:05 +0000197 ContainerImage: "linux-x86-clang:latest",
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000198 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
199 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
Brad Fitzpatrickc7f36d02019-11-15 20:31:23 +0000200 SSHUsername: "root",
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000201 },
202 "host-linux-sid": &HostConfig{
Brad Fitzpatrick171a17d2017-04-12 01:54:09 +0000203 Notes: "Debian sid, updated occasionally.",
Brad Fitzpatrick14d99732018-05-05 16:36:05 +0000204 ContainerImage: "linux-x86-sid:latest",
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000205 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
206 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
Brad Fitzpatrickc7f36d02019-11-15 20:31:23 +0000207 SSHUsername: "root",
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000208 },
Brad Fitzpatrick07bb1292019-05-08 16:25:38 +0000209 "host-linux-fedora": &HostConfig{
210 Notes: "Fedora 30",
211 ContainerImage: "linux-x86-fedora:latest",
212 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
213 env: []string{"GOROOT_BOOTSTRAP=/goboot"},
Brad Fitzpatrickc7f36d02019-11-15 20:31:23 +0000214 SSHUsername: "root",
Brad Fitzpatrick07bb1292019-05-08 16:25:38 +0000215 },
Joel Sing8ea6a2c2020-09-28 04:25:41 +1000216 "host-linux-riscv64-joelsing": &HostConfig{
217 Notes: "SiFive HiFive Unleashed RISC-V board. 8 GB RAM, 4 cores.",
218 IsReverse: true,
219 ExpectNum: 1,
220 OwnerGithub: "4a6f656c",
221 env: []string{"GOROOT_BOOTSTRAP=/usr/local/goboot"},
222 },
Meng Zhuo7fa5d572021-08-27 12:26:14 +0800223 "host-linux-riscv64-unmatched": &HostConfig{
224 Notes: "SiFive HiFive Unmatched RISC-V board. 16 GB RAM, 4 cores.",
225 IsReverse: true,
226 ExpectNum: 1,
227 OwnerGithub: "mengzhuo",
228 env: []string{"GOROOT_BOOTSTRAP=/usr/local/goboot"},
229 },
Brad Fitzpatrick773364d2019-11-12 06:19:21 +0000230 "host-linux-riscv64-unleashed": &HostConfig{
231 Notes: "SiFive HiFive Unleashed RISC-V board. 8 GB RAM, 4 cores.",
232 IsReverse: true,
233 ExpectNum: 1, // for now. Joel's board might join the party later.
234 OwnerGithub: "bradfitz", // at home
235 env: []string{"GOROOT_BOOTSTRAP=/usr/local/goboot"},
236 },
Dmitri Shuralyova5d30732018-10-04 18:14:50 -0400237 "host-openbsd-amd64-64": &HostConfig{
Brad Fitzpatrickd3ddf672019-01-30 05:01:54 +0000238 VMImage: "openbsd-amd64-64-190129a",
Brad Fitzpatricke9fe3dc2019-01-30 17:13:07 +0000239 MinCPUPlatform: "Intel Skylake", // for better TSC? Maybe? see Issue 29223. builds faster at least.
Dmitri Shuralyova5d30732018-10-04 18:14:50 -0400240 machineType: "n1-highcpu-4",
Brad Fitzpatrick336cc412019-11-15 17:46:02 +0000241 buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.openbsd-amd64",
Bryan C. Mills888c71d2019-03-06 14:45:35 -0500242 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/gobootstrap-openbsd-amd64-go1_12.tar.gz",
Dmitri Shuralyov31ed75f2018-10-26 13:05:59 -0400243 Notes: "OpenBSD 6.4 with hw.smt=1; GCE VM is built from script in build/env/openbsd-amd64",
Dmitri Shuralyova5d30732018-10-04 18:14:50 -0400244 SSHUsername: "gopher",
245 },
246 "host-openbsd-386-64": &HostConfig{
Dmitri Shuralyov24469dd2018-10-19 15:50:28 -0400247 VMImage: "openbsd-386-64",
Dmitri Shuralyova5d30732018-10-04 18:14:50 -0400248 machineType: "n1-highcpu-4",
Brad Fitzpatrick336cc412019-11-15 17:46:02 +0000249 buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.openbsd-386",
Bryan C. Mills888c71d2019-03-06 14:45:35 -0500250 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/gobootstrap-openbsd-386-go1_12.tar.gz",
Dmitri Shuralyov24469dd2018-10-19 15:50:28 -0400251 Notes: "OpenBSD 6.4; GCE VM is built from script in build/env/openbsd-386",
Dmitri Shuralyova5d30732018-10-04 18:14:50 -0400252 SSHUsername: "gopher",
253 },
Dmitri Shuralyov3a574da2020-11-12 12:27:32 -0500254 "host-openbsd-amd64-68": &HostConfig{
Dmitri Shuralyovc7c67872020-12-17 23:53:39 -0500255 VMImage: "openbsd-amd64-68-v3", // v3 adds 009_exit syspatch; see golang.org/cl/278732.
Dmitri Shuralyov3a574da2020-11-12 12:27:32 -0500256 machineType: "n1-highcpu-4",
257 buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.openbsd-amd64",
258 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/gobootstrap-openbsd-amd64-go1_12.tar.gz",
Dmitri Shuralyovfc1f3f82020-12-10 16:17:58 -0500259 Notes: "OpenBSD 6.8 (with 009_exit syspatch); GCE VM is built from script in build/env/openbsd-amd64",
Dmitri Shuralyov3a574da2020-11-12 12:27:32 -0500260 SSHUsername: "gopher",
261 },
262 "host-openbsd-386-68": &HostConfig{
Dmitri Shuralyovc7c67872020-12-17 23:53:39 -0500263 VMImage: "openbsd-386-68-v3", // v3 adds 009_exit syspatch; see golang.org/cl/278732.
Dmitri Shuralyov3a574da2020-11-12 12:27:32 -0500264 machineType: "n1-highcpu-4",
265 buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.openbsd-386",
266 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/gobootstrap-openbsd-386-go1_12.tar.gz",
Dmitri Shuralyovfc1f3f82020-12-10 16:17:58 -0500267 Notes: "OpenBSD 6.8 (with 009_exit syspatch); GCE VM is built from script in build/env/openbsd-386",
Dmitri Shuralyov3a574da2020-11-12 12:27:32 -0500268 SSHUsername: "gopher",
269 },
Joel Sing23861f92019-08-31 03:09:05 +1000270 "host-openbsd-arm-joelsing": &HostConfig{
271 IsReverse: true,
272 ExpectNum: 1,
273 env: []string{"GOROOT_BOOTSTRAP=/usr/local/go"},
274 OwnerGithub: "4a6f656c",
275 },
Joel Singb91348e2020-08-21 04:42:01 +1000276 "host-openbsd-arm64-joelsing": &HostConfig{
277 IsReverse: true,
278 ExpectNum: 1,
279 env: []string{"GOROOT_BOOTSTRAP=/usr/local/go"},
280 OwnerGithub: "4a6f656c",
281 },
Joel Sing18a54c62020-08-24 02:02:40 +1000282 "host-openbsd-mips64-joelsing": &HostConfig{
283 IsReverse: true,
284 ExpectNum: 1,
285 env: []string{"GOROOT_BOOTSTRAP=/usr/local/go"},
286 OwnerGithub: "4a6f656c",
287 },
Brad Fitzpatrick05d9e9b2018-09-27 23:43:25 +0000288 "host-freebsd-11_2": &HostConfig{
289 VMImage: "freebsd-amd64-112",
290 Notes: "FreeBSD 11.2; GCE VM is built from script in build/env/freebsd-amd64",
291 machineType: "n1-highcpu-4",
292 buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.freebsd-amd64",
293 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-freebsd-amd64.tar.gz",
294 SSHUsername: "gopher",
295 },
Carlos Amedee8050efc2021-04-20 13:43:05 -0400296 "host-freebsd-11_4": &HostConfig{
297 VMImage: "freebsd-amd64-114",
298 Notes: "FreeBSD 11.4; GCE VM is built from script in build/env/freebsd-amd64",
299 machineType: "n1-highcpu-4",
300 buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.freebsd-amd64",
301 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-freebsd-amd64.tar.gz",
302 SSHUsername: "gopher",
303 },
Carlos Amedee8050efc2021-04-20 13:43:05 -0400304 "host-freebsd-12_2": &HostConfig{
305 VMImage: "freebsd-amd64-122",
306 Notes: "FreeBSD 12.2; GCE VM is built from script in build/env/freebsd-amd64",
307 machineType: "n1-highcpu-4",
308 buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.freebsd-amd64",
309 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-freebsd-amd64.tar.gz",
310 SSHUsername: "gopher",
311 },
Carlos Amedee2ecf4242021-04-23 11:33:51 -0400312 "host-freebsd-12_2-big": &HostConfig{
313 VMImage: "freebsd-amd64-122",
314 Notes: "Same as host-freebsd-12_2, but on n1-highcpu-16",
Dmitri Shuralyov43ea6942021-02-19 12:17:28 -0500315 machineType: "n1-highcpu-16", // 16 vCPUs, 14.4 GB mem
316 buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.freebsd-amd64",
317 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-freebsd-amd64.tar.gz",
318 SSHUsername: "gopher",
319 },
Dmitri Shuralyov219acbf2020-04-02 08:55:30 -0400320 "host-netbsd-amd64-9_0": &HostConfig{
321 VMImage: "netbsd-amd64-9-0-2019q4",
322 Notes: "NetBSD 9.0; GCE VM is built from script in build/env/netbsd-amd64",
323 machineType: "n1-highcpu-4",
324 buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.netbsd-amd64",
325 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/gobootstrap-netbsd-amd64-2da6b33.tar.gz",
326 SSHUsername: "root",
327 },
328 "host-netbsd-386-9_0": &HostConfig{
329 VMImage: "netbsd-i386-9-0-2019q4",
330 Notes: "NetBSD 9.0; GCE VM is built from script in build/env/netbsd-386",
331 machineType: "n1-highcpu-4",
332 buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.netbsd-386",
333 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/gobootstrap-netbsd-386-0b3b511.tar.gz",
334 SSHUsername: "root",
335 },
Benny Siegertebee6e92019-03-19 14:28:04 +0100336 "host-netbsd-arm-bsiegert": &HostConfig{
337 IsReverse: true,
338 ExpectNum: 1,
339 env: []string{"GOROOT_BOOTSTRAP=/usr/pkg/go112"},
340 OwnerGithub: "bsiegert",
341 },
Benny Siegert7c9f64d2020-08-18 20:42:30 +0200342 "host-netbsd-arm64-bsiegert": &HostConfig{
343 IsReverse: true,
344 ExpectNum: 1,
345 env: []string{"GOROOT_BOOTSTRAP=/usr/pkg/go114"},
346 OwnerGithub: "bsiegert",
347 },
Brad Fitzpatrick0babffa2019-11-05 18:55:17 +0000348 "host-dragonfly-amd64-master": &HostConfig{
349 IsReverse: true,
350 ExpectNum: 1,
351 Notes: "DragonFly BSD master, run by DragonFly team",
352 env: []string{"GOROOT_BOOTSTRAP=/usr/local/go"},
Antonio Huete Jimenezc34742b2020-05-05 19:18:12 +0000353 SSHUsername: "root",
Brad Fitzpatrick0babffa2019-11-05 18:55:17 +0000354 OwnerGithub: "tuxillo",
Brad Fitzpatricke47c4472017-08-05 22:56:18 +0000355 },
356 "host-freebsd-arm-paulzhol": &HostConfig{
Brad Fitzpatrick6d1cfea2019-11-06 20:34:49 +0000357 IsReverse: true,
358 ExpectNum: 1,
359 Notes: "Cubiboard2 1Gb RAM dual-core Cortex-A7 (Allwinner A20), FreeBSD 11.1-RELEASE",
360 env: []string{"GOROOT_BOOTSTRAP=/usr/home/paulzhol/go1.4"},
361 OwnerGithub: "paulzhol",
Brad Fitzpatricke47c4472017-08-05 22:56:18 +0000362 },
Dmitri Goutnik39f3d492019-10-03 07:56:19 -0500363 "host-freebsd-arm64-dmgk": &HostConfig{
364 IsReverse: true,
365 ExpectNum: 1,
366 Notes: "AWS EC2 a1.large 2 vCPU 4GiB RAM, FreeBSD 12.1-STABLE",
367 env: []string{"GOROOT_BOOTSTRAP=/usr/home/builder/gobootstrap"},
368 OwnerGithub: "dmgk",
369 },
Brad Fitzpatrick2446fb32017-08-06 15:57:06 +0000370 "host-plan9-arm-0intro": &HostConfig{
371 IsReverse: true,
372 ExpectNum: 1,
373 Notes: "Raspberry Pi 3 Model B, Plan 9 from Bell Labs",
374 OwnerGithub: "0intro",
375 },
376 "host-plan9-amd64-0intro": &HostConfig{
377 IsReverse: true,
378 ExpectNum: 1,
David du Colombier9d711212021-04-05 20:42:05 +0200379 Notes: "QEMU VM, Plan 9 from Bell Labs, 9k kernel",
Brad Fitzpatrick2446fb32017-08-06 15:57:06 +0000380 OwnerGithub: "0intro",
381 },
David du Colombier7373b402019-05-09 18:52:40 +0200382 "host-plan9-386-0intro": &HostConfig{
383 IsReverse: true,
384 ExpectNum: 1,
David du Colombier9d711212021-04-05 20:42:05 +0200385 Notes: "QEMU VM, Plan 9 from Bell Labs",
David du Colombier7373b402019-05-09 18:52:40 +0200386 OwnerGithub: "0intro",
387 },
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000388 "host-plan9-386-gce": &HostConfig{
Brad Fitzpatricka865ae32019-01-18 22:19:58 +0000389 VMImage: "plan9-386-v7",
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000390 Notes: "Plan 9 from 0intro; GCE VM is built from script in build/env/plan9-386",
391 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.plan9-386",
392 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/gobootstrap-plan9-386.tar.gz",
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800393
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000394 // We *were* using n1-standard-1 because Plan 9 can only
395 // reliably use a single CPU. Using 2 or 4 and we see
396 // test failures. See:
397 // https://golang.org/issue/8393
398 // https://golang.org/issue/9491
399 // n1-standard-1 has 3.6 GB of memory which WAS (see below)
400 // overkill (userspace probably only sees 2GB anyway),
401 // but it's the cheapest option. And plenty to keep
402 // our ~250 MB of inputs+outputs in its ramfs.
403 //
404 // But the docs says "For the n1 series of machine
405 // types, a virtual CPU is implemented as a single
406 // hyperthread on a 2.6GHz Intel Sandy Bridge Xeon or
407 // Intel Ivy Bridge Xeon (or newer) processor. This
408 // means that the n1-standard-2 machine type will see
409 // a whole physical core."
410 //
411 // ... so we used n1-highcpu-2 (1.80 RAM, still
412 // plenty), just so we can get 1 whole core for the
413 // single-core Plan 9. It will see 2 virtual cores and
414 // only use 1, but we hope that 1 will be more powerful
415 // and we'll stop timing out on tests.
416 machineType: "n1-highcpu-4",
Brad Fitzpatrick326c7132019-01-18 16:14:12 +0000417 env: []string{"GO_TEST_TIMEOUT_SCALE=3"},
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000418 },
Brad Fitzpatrickacd9ecf2017-04-21 19:35:28 +0000419 "host-windows-amd64-2008": &HostConfig{
Jeff Johnson114c42e2018-07-02 10:49:55 -0700420 VMImage: "windows-amd64-server-2008r2-v7",
Dmitri Shuralyov99393002019-11-22 18:01:25 -0500421 machineType: "n1-highcpu-4", // 4 vCPUs, 3.6 GB mem
422 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.windows-amd64",
423 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-windows-amd64.tar.gz",
424 SSHUsername: "gopher",
425 },
Brad Fitzpatrickacd9ecf2017-04-21 19:35:28 +0000426 "host-windows-amd64-2012": &HostConfig{
Jeff Johnson114c42e2018-07-02 10:49:55 -0700427 VMImage: "windows-amd64-server-2012r2-v7",
Dmitri Shuralyov99393002019-11-22 18:01:25 -0500428 machineType: "n1-highcpu-4", // 4 vCPUs, 3.6 GB mem
Brad Fitzpatrickacd9ecf2017-04-21 19:35:28 +0000429 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.windows-amd64",
430 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-windows-amd64.tar.gz",
Jeff Johnsona328a792017-07-31 16:55:28 -0700431 SSHUsername: "gopher",
Brad Fitzpatrickacd9ecf2017-04-21 19:35:28 +0000432 },
433 "host-windows-amd64-2016": &HostConfig{
Jeff Johnson114c42e2018-07-02 10:49:55 -0700434 VMImage: "windows-amd64-server-2016-v7",
Dmitri Shuralyov99393002019-11-22 18:01:25 -0500435 machineType: "n1-highcpu-4", // 4 vCPUs, 3.6 GB mem
436 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.windows-amd64",
437 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-windows-amd64.tar.gz",
438 SSHUsername: "gopher",
439 },
440 "host-windows-amd64-2016-big": &HostConfig{
Dmitri Shuralyov05d22632020-01-06 23:55:13 -0500441 Notes: "Same as host-windows-amd64-2016, but on n1-highcpu-16",
Dmitri Shuralyov99393002019-11-22 18:01:25 -0500442 VMImage: "windows-amd64-server-2016-v7",
Dmitri Shuralyov05d22632020-01-06 23:55:13 -0500443 machineType: "n1-highcpu-16", // 16 vCPUs, 14.4 GB mem
Brad Fitzpatrickacd9ecf2017-04-21 19:35:28 +0000444 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.windows-amd64",
445 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-windows-amd64.tar.gz",
Jeff Johnsona328a792017-07-31 16:55:28 -0700446 SSHUsername: "gopher",
Brad Fitzpatrickacd9ecf2017-04-21 19:35:28 +0000447 },
Jason A. Donenfeld5d75ed72020-11-20 18:35:33 +0100448 "host-windows-arm64-zx2c4": &HostConfig{
449 IsReverse: true,
450 ExpectNum: 1,
451 OwnerGithub: "zx2c4",
452 env: []string{"GOROOT_BOOTSTRAP=C:\\Program Files (Arm)\\Go"},
453 },
Alexander Rakoczy666c18f2021-06-15 16:42:51 -0400454 "host-windows-arm64-mini": &HostConfig{
455 Notes: "macOS hosting Windows 10 in qemu with HVM acceleration.",
456 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.windows-arm64",
Alexander Rakoczy666c18f2021-06-15 16:42:51 -0400457 goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/gobootstrap-windows-arm64-f22ec5.tar.gz",
458 IsReverse: true,
Alexander Rakoczy3a6c4f32021-08-25 15:50:51 -0400459 ExpectNum: 7,
Alexander Rakoczy666c18f2021-06-15 16:42:51 -0400460 },
Brad Fitzpatrick409147c2017-01-18 22:45:12 +0000461 "host-darwin-10_12": &HostConfig{
462 IsReverse: true,
Carlos Amedeeb7678aa2021-04-06 11:28:57 -0400463 ExpectNum: 3,
Brad Fitzpatrick409147c2017-01-18 22:45:12 +0000464 Notes: "MacStadium OS X 10.12 VM under VMWare ESXi",
465 env: []string{
466 "GOROOT_BOOTSTRAP=/Users/gopher/go1.4",
467 },
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +0000468 SSHUsername: "gopher",
469 HermeticReverse: true, // we destroy the VM when done & let cmd/makemac recreate
Brad Fitzpatrick409147c2017-01-18 22:45:12 +0000470 },
Brad Fitzpatrick8bd8e0e2019-03-26 23:04:31 +0000471 "host-darwin-10_14": &HostConfig{
472 IsReverse: true,
Carlos Amedeeb7678aa2021-04-06 11:28:57 -0400473 ExpectNum: 3,
Brad Fitzpatrick8bd8e0e2019-03-26 23:04:31 +0000474 Notes: "MacStadium macOS Mojave (10.14) VM under VMWare ESXi",
475 env: []string{
476 "GOROOT_BOOTSTRAP=/Users/gopher/goboot", // Go 1.12.1
477 },
478 SSHUsername: "gopher",
479 HermeticReverse: true, // we destroy the VM when done & let cmd/makemac recreate
480 },
Carlos Amedeed6dec9c2019-11-19 14:55:01 +0000481 "host-darwin-10_15": &HostConfig{
482 IsReverse: true,
Carlos Amedeeb7678aa2021-04-06 11:28:57 -0400483 ExpectNum: 5,
Carlos Amedeed6dec9c2019-11-19 14:55:01 +0000484 Notes: "MacStadium macOS Catalina (10.15) VM under VMWare ESXi",
485 env: []string{
486 "GOROOT_BOOTSTRAP=/Users/gopher/goboot", // Go 1.12.1
487 },
488 SSHUsername: "gopher",
489 HermeticReverse: true, // we destroy the VM when done & let cmd/makemac recreate
490 },
Carlos Amedeed576fd32021-01-29 15:47:13 -0500491 "host-darwin-amd64-11_0": &HostConfig{
492 IsReverse: true,
Carlos Amedeeb7678aa2021-04-06 11:28:57 -0400493 ExpectNum: 5,
Carlos Amedeed576fd32021-01-29 15:47:13 -0500494 Notes: "MacStadium macOS Big Sur (11.0) VM under VMWare ESXi",
495 env: []string{
496 "GOROOT_BOOTSTRAP=/Users/gopher/goboot", // Go 1.13.4
497 },
498 SSHUsername: "gopher",
499 HermeticReverse: true, // we destroy the VM when done & let cmd/makemac recreate
500 },
Alexander Rakoczy9ad13ba2020-12-15 12:58:50 -0500501 "host-darwin-arm64-11_0-toothrot": &HostConfig{
502 IsReverse: true,
503 ExpectNum: 2,
504 Notes: "macOS Big Sur (11.0) ARM64 (M1). Mac mini",
505 env: []string{
506 "GOROOT_BOOTSTRAP=/Users/gopher/goboot",
507 },
508 SSHUsername: "gopher",
509 },
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000510 "host-linux-s390x": &HostConfig{
Brad Fitzpatrick6d1cfea2019-11-06 20:34:49 +0000511 Notes: "run by IBM",
Ruixin Bao97266ed2020-12-01 07:06:13 -0800512 OwnerGithub: "ruixin-bao",
Brad Fitzpatrick6d1cfea2019-11-06 20:34:49 +0000513 IsReverse: true,
514 env: []string{"GOROOT_BOOTSTRAP=/var/buildlet/go-linux-s390x-bootstrap"},
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000515 },
Brad Fitzpatrickf8a31062016-10-06 20:30:58 +0000516 "host-linux-ppc64-osu": &HostConfig{
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +0000517 Notes: "Debian jessie; run by Go team on osuosl.org",
518 IsReverse: true,
519 ExpectNum: 5,
520 env: []string{"GOROOT_BOOTSTRAP=/usr/local/go-bootstrap"},
Brad Fitzpatrick4c6d3ea2019-10-10 17:44:44 +0000521 SSHUsername: "root",
Brad Fitzpatrickc53d4ba2019-10-17 05:08:40 +0000522 HermeticReverse: false, // TODO: run in chroots with overlayfs? https://github.com/golang/go/issues/34830#issuecomment-543386764
Brad Fitzpatrickf8a31062016-10-06 20:30:58 +0000523 },
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000524 "host-linux-ppc64le-osu": &HostConfig{
Brad Fitzpatrickc53d4ba2019-10-17 05:08:40 +0000525 Notes: "Debian Buster; run by Go team on osuosl.org; see x/build/env/linux-ppc64le/osuosl",
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +0000526 IsReverse: true,
527 ExpectNum: 5,
528 env: []string{"GOROOT_BOOTSTRAP=/usr/local/go-bootstrap"},
Brad Fitzpatrick4c6d3ea2019-10-10 17:44:44 +0000529 SSHUsername: "root",
Brad Fitzpatrickc53d4ba2019-10-17 05:08:40 +0000530 HermeticReverse: true,
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000531 },
Carlos Eduardo Seo202164e2019-02-25 17:05:12 -0300532 "host-linux-ppc64le-power9-osu": &HostConfig{
Brad Fitzpatrickc53d4ba2019-10-17 05:08:40 +0000533 Notes: "Debian Buster; run by Go team on osuosl.org; see x/build/env/linux-ppc64le/osuosl",
Carlos Eduardo Seo202164e2019-02-25 17:05:12 -0300534 IsReverse: true,
Carlos Eduardo Seoc373c472020-01-27 15:28:06 -0300535 env: []string{"GOROOT_BOOTSTRAP=/usr/local/go-bootstrap", "GOPPC64=power9"},
Carlos Eduardo Seoa07c53d2019-10-10 16:48:15 -0300536 SSHUsername: "root",
Brad Fitzpatrickc53d4ba2019-10-17 05:08:40 +0000537 HermeticReverse: true,
Carlos Eduardo Seo202164e2019-02-25 17:05:12 -0300538 },
Brad Fitzpatrickad0e3fb2017-04-06 22:16:28 +0000539 "host-linux-arm64-packet": &HostConfig{
Brad Fitzpatrickb568f662019-10-15 04:44:49 +0000540 Notes: "On 96 core packet.net host (Xenial) in Docker containers (Debian Buster); run by Go team. See x/build/env/linux-arm64/packet",
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +0000541 IsReverse: true,
542 HermeticReverse: true,
Alexander Rakoczyf9092bb2019-12-16 17:14:27 -0500543 ExpectNum: 8,
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +0000544 env: []string{"GOROOT_BOOTSTRAP=/usr/local/go-bootstrap"},
545 SSHUsername: "root",
Brad Fitzpatrickad0e3fb2017-04-06 22:16:28 +0000546 },
Carlos Amedee372ecfe2020-05-04 13:13:17 -0400547 "host-linux-arm64-aws": &HostConfig{
Carlos Amedee6c8dc322020-05-13 13:27:15 -0400548 Notes: "Debian Buster, EC2 arm64 instance. See x/build/env/linux-arm64/aws",
Carlos Amedee8c831502020-10-28 17:23:17 -0400549 VMImage: "ami-03089323a1d38e652",
Carlos Amedee5e227ac2020-05-19 17:26:14 -0400550 ContainerImage: "gobuilder-arm64-aws:latest",
551 machineType: "m6g.xlarge",
Carlos Amedee6c8dc322020-05-13 13:27:15 -0400552 isEC2: true,
Carlos Amedee372ecfe2020-05-04 13:13:17 -0400553 env: []string{"GOROOT_BOOTSTRAP=/usr/local/go-bootstrap"},
Carlos Amedeed72655c2020-10-08 16:49:48 -0400554 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-arm64",
555 SSHUsername: "root",
556 },
557 "host-linux-arm-aws": &HostConfig{
558 Notes: "Debian Buster, EC2 arm instance. See x/build/env/linux-arm/aws",
559 VMImage: "ami-07409163bccd5ac4d",
560 ContainerImage: "gobuilder-arm-aws:latest",
561 machineType: "m6g.xlarge",
562 isEC2: true,
563 env: []string{"GOROOT_BOOTSTRAP=/usr/local/go-bootstrap"},
564 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-arm",
Carlos Amedee4e08f9c2020-09-28 15:42:57 -0400565 SSHUsername: "root",
Carlos Amedee372ecfe2020-05-04 13:13:17 -0400566 },
Joshua M. Clulowa022e902019-10-17 01:48:13 -0700567 "host-illumos-amd64-jclulow": &HostConfig{
568 Notes: "SmartOS base64@19.1.0 zone",
569 Owner: "josh@sysmgr.org",
570 OwnerGithub: "jclulow",
571 IsReverse: true,
572 ExpectNum: 1,
573 SSHUsername: "gobuild",
574 },
Shawn Walker-Salas22e055b2017-07-07 13:41:20 -0700575 "host-solaris-oracle-amd64-oraclerel": &HostConfig{
576 Notes: "Oracle Solaris amd64 Release System",
Brad Fitzpatrickbab2ff92019-11-06 16:59:20 +0000577 Owner: "",
578 OwnerGithub: "rorth", // https://github.com/golang/go/issues/15581#issuecomment-550368581
Shawn Walker-Salas53a3d0e2017-06-27 10:11:15 -0700579 IsReverse: true,
580 ExpectNum: 1,
Shawn Walker-Salas821d1eb2017-07-31 13:58:19 -0700581 env: []string{"GOROOT_BOOTSTRAP=/opt/golang/go-solaris-amd64-bootstrap"},
Shawn Walker-Salas53a3d0e2017-06-27 10:11:15 -0700582 },
Xiaodong Liu5eaa6e02021-09-02 15:51:28 +0800583 "host-linux-loong64-3a5000": &HostConfig{
584 Notes: "Loongson 3A5000 Box hosted by Loongson; loong64 is the short name of LoongArch 64 bit version",
585 OwnerGithub: "XiaodongLoong",
586 IsReverse: true,
587 ExpectNum: 5,
588 env: []string{
589 "GOROOT_BOOTSTRAP=/usr/lib/go-1.15",
590 },
591 },
Meng Zhuo88052792019-09-10 07:21:11 +0800592 "host-linux-mipsle-mengzhuo": &HostConfig{
Meng Zhuobfc899a2021-08-31 10:55:47 +0800593 Notes: "Loongson 3A Box hosted by Meng Zhuo; actually MIPS64le despite the name",
Meng Zhuo88052792019-09-10 07:21:11 +0800594 OwnerGithub: "mengzhuo",
595 IsReverse: true,
596 ExpectNum: 1,
597 env: []string{
598 "GOROOT_BOOTSTRAP=/usr/lib/golang",
599 "GOMIPS64=hardfloat",
600 },
601 },
Brad Fitzpatrickf120ea32019-10-29 20:35:07 +0000602 "host-linux-mips64le-rtrk": &HostConfig{
603 Notes: "cavium,rhino_utm8 board hosted at RT-RK.com; quad-core cpu, 8GB of ram and 240GB ssd disks.",
604 OwnerGithub: "bogojevic", // and @milanknezevic. https://github.com/golang/go/issues/31217#issuecomment-547004892
605 IsReverse: true,
606 ExpectNum: 1,
607 env: []string{
608 "GOROOT_BOOTSTRAP=/usr/local/go-bootstrap",
609 },
610 },
611 "host-linux-mips64-rtrk": &HostConfig{
612 Notes: "cavium,rhino_utm8 board hosted at RT-RK.com; quad-core cpu, 8GB of ram and 240GB ssd disks.",
613 OwnerGithub: "bogojevic", // and @milanknezevic. https://github.com/golang/go/issues/31217#issuecomment-547004892
614 IsReverse: true,
615 ExpectNum: 1,
616 env: []string{
617 "GOROOT_BOOTSTRAP=/usr/local/go-bootstrap",
618 },
619 },
Elias Naur18919d62020-10-03 11:37:07 +0200620 "host-ios-arm64-corellium-ios": &HostConfig{
Dmitri Shuralyov4986fa22020-08-19 13:15:55 -0400621 Notes: "Virtual iOS devices hosted by Zenly on Corellium; see issues 31722 and 40523",
Elias Naur6bebc8e2019-05-01 20:33:26 +0200622 OwnerGithub: "znly",
623 IsReverse: true,
Elias Naur3b7f1152020-10-29 19:04:57 +0100624 ExpectNum: 3,
Elias Naur6bebc8e2019-05-01 20:33:26 +0200625 env: []string{
Elias Naur18919d62020-10-03 11:37:07 +0200626 "GOROOT_BOOTSTRAP=/var/mobile/go-ios-arm64-bootstrap",
Elias Naur6bebc8e2019-05-01 20:33:26 +0200627 },
628 },
Elias Naur4d0f77a2019-05-01 22:28:43 +0200629 "host-android-arm64-corellium-android": &HostConfig{
Dmitri Shuralyov4986fa22020-08-19 13:15:55 -0400630 Notes: "Virtual Android devices hosted by Zenly on Corellium; see issues 31722 and 40523",
Elias Naur4d0f77a2019-05-01 22:28:43 +0200631 OwnerGithub: "znly",
632 IsReverse: true,
Elias Naur3b7f1152020-10-29 19:04:57 +0100633 ExpectNum: 3,
Elias Naur4d0f77a2019-05-01 22:28:43 +0200634 env: []string{
635 "GOROOT_BOOTSTRAP=/data/data/com.termux/files/home/go-android-arm64-bootstrap",
636 },
637 },
Dmitri Shuralyovc9463302018-08-24 14:41:05 -0400638 "host-aix-ppc64-osuosl": &HostConfig{
639 Notes: "AIX 7.2 VM on OSU; run by Tony Reix",
640 OwnerGithub: "trex58",
641 IsReverse: true,
642 ExpectNum: 1,
643 env: []string{"GOROOT_BOOTSTRAP=/opt/freeware/lib/golang"},
644 },
Brad Fitzpatrickcfe14ab2019-02-25 20:35:29 +0000645 "host-android-amd64-emu": &HostConfig{
646 Notes: "Debian Buster w/ Android SDK + emulator (use nested virt)",
Elias Naur974e90a2019-03-01 11:21:20 +0100647 ContainerImage: "android-amd64-emu:bff27c0c9263",
Brad Fitzpatrickcfe14ab2019-02-25 20:35:29 +0000648 KonletVMImage: "android-amd64-emu",
649 NestedVirt: true,
650 buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64",
651 env: []string{"GOROOT_BOOTSTRAP=/go1.4"},
652 SSHUsername: "root",
653 },
Meng Zhuo2e053772020-11-25 00:44:38 +0800654 "host-linux-amd64-wsl": &HostConfig{
655 Notes: "Windows 10 WSL2 Ubuntu",
656 OwnerGithub: "mengzhuo",
657 IsReverse: true,
Baokun Leea4cf4892020-12-22 20:52:06 +0800658 ExpectNum: 2,
Meng Zhuo2e053772020-11-25 00:44:38 +0800659 env: []string{"GOROOT_BOOTSTRAP=/usr/lib/go"},
660 },
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000661}
662
Brad Fitzpatrickad7af462019-10-19 02:49:53 +0000663// CrossCompileConfig describes how to cross-compile a build on a
664// faster host.
665type CrossCompileConfig struct {
666 // CompileHostType is the host type to use for compilation
667 CompileHostType string
668
669 // CCForTarget is the CC_FOR_TARGET environment variable.
670 CCForTarget string
671
672 // GOARM is any GOARM= environment variable.
673 GOARM string
674
675 // AlwaysCrossCompile controls whether this builder always
676 // cross compiles. Otherwise it's only done for trybot runs.
677 AlwaysCrossCompile bool
678}
679
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000680func init() {
681 for key, c := range Hosts {
682 if key == "" {
683 panic("empty string key in Hosts")
684 }
685 if c.HostType == "" {
686 c.HostType = key
687 }
688 if c.HostType != key {
689 panic(fmt.Sprintf("HostType %q != key %q", c.HostType, key))
690 }
691 nSet := 0
Alexander Rakoczy10d5d322021-05-25 21:47:41 -0400692 if c.VMImage != "" {
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000693 nSet++
694 }
Alexander Rakoczy10d5d322021-05-25 21:47:41 -0400695 if c.ContainerImage != "" && !c.isEC2 {
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000696 nSet++
697 }
698 if c.IsReverse {
699 nSet++
700 }
701 if nSet != 1 {
Brad Fitzpatrick14d99732018-05-05 16:36:05 +0000702 panic(fmt.Sprintf("exactly one of VMImage, ContainerImage, IsReverse must be set for host %q; got %v", key, nSet))
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000703 }
Brad Fitzpatrick14d99732018-05-05 16:36:05 +0000704 if c.buildletURLTmpl == "" && (c.VMImage != "" || c.ContainerImage != "") {
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000705 panic(fmt.Sprintf("missing buildletURLTmpl for host type %q", key))
706 }
707 }
708}
709
710// A HostConfig describes the available ways to obtain buildlets of
Dmitri Shuralyovbaf8b212020-04-06 17:34:17 -0400711// different types. Some host configs can serve multiple
Brad Fitzpatrickade28622018-05-14 17:22:45 +0000712// builders. For example, a host config of "host-linux-jessie" can
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000713// serve linux-amd64, linux-amd64-race, linux-386, linux-386-387, etc.
714type HostConfig struct {
715 // HostType is the unique name of this host config. It is also
716 // the key in the Hosts map.
717 HostType string
718
719 // buildletURLTmpl is the URL "template" ($BUCKET is auto-expanded)
720 // for the URL to the buildlet binary.
Brad Fitzpatrick6ae87502018-05-04 02:42:17 +0000721 // This field is required for VM and Container builders. It's not
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000722 // needed for reverse buildlets because in that case, the buildlets
723 // are already running and their stage0 should know how to update it
724 // it automatically.
725 buildletURLTmpl string
726
Carlos Amedeed77c6d02020-08-18 13:32:05 -0400727 // Exactly 1 of these must be set (with the exception of EC2 instances).
728 // An EC2 instance may run a container inside a VM. In that case, a VMImage
729 // and ContainerImage will both be set.
Brad Fitzpatrick14d99732018-05-05 16:36:05 +0000730 VMImage string // e.g. "openbsd-amd64-60"
731 ContainerImage string // e.g. "linux-buildlet-std:latest" (suffix after "gcr.io/<PROJ>/")
732 IsReverse bool // if true, only use the reverse buildlet pool
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000733
734 // GCE options, if VMImage != ""
Brad Fitzpatricke9fe3dc2019-01-30 17:13:07 +0000735 machineType string // optional GCE instance type
736 RegularDisk bool // if true, use spinning disk instead of SSD
737 MinCPUPlatform string // optional; https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000738
Carlos Amedee6c8dc322020-05-13 13:27:15 -0400739 // EC2 options
740 isEC2 bool // if true, the instance is configured to run on EC2
741
Brad Fitzpatrick15521bc2017-02-24 17:50:49 +0000742 // ReverseOptions:
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +0000743 ExpectNum int // expected number of reverse buildlets of this type
744 HermeticReverse bool // whether reverse buildlet has fresh env per conn
Brad Fitzpatrick15521bc2017-02-24 17:50:49 +0000745
Brad Fitzpatrick0261b662019-02-15 22:05:42 +0000746 // Container image options, if ContainerImage != "":
Brad Fitzpatrick69dd6b22019-02-21 21:10:54 +0000747 NestedVirt bool // container requires VMX nested virtualization
748 KonletVMImage string // optional VM image (containing konlet) to use instead of default
Brad Fitzpatrick0261b662019-02-15 22:05:42 +0000749
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000750 // Optional base env. GOROOT_BOOTSTRAP should go here if the buildlet
751 // has Go 1.4+ baked in somewhere.
752 env []string
Andrew Gerrand8e28dc92016-03-22 09:05:52 +1100753
754 // These template URLs may contain $BUCKET which is expanded to the
755 // relevant Cloud Storage bucket as specified by the build environment.
756 goBootstrapURLTmpl string // optional URL to a built Go 1.4+ tar.gz
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800757
Jess Frazellebe067592017-04-13 19:38:46 +0000758 Owner string // optional email of owner; "bradfitz@golang.org", empty means golang-dev
759 OwnerGithub string // optional GitHub username of owner
760 Notes string // notes for humans
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000761
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +0000762 SSHUsername string // username to ssh as, empty means not supported
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000763}
764
765// A BuildConfig describes how to run a builder.
766type BuildConfig struct {
767 // Name is the unique name of the builder, in the form of
768 // "GOOS-GOARCH" or "GOOS-GOARCH-suffix". For example,
769 // "darwin-386", "linux-386-387", "linux-amd64-race". Some
770 // suffixes are well-known and carry special meaning, such as
771 // "-race".
772 Name string
773
774 // HostType is the required key into the Hosts map, describing
775 // the type of host this build will run on.
Brad Fitzpatrickade28622018-05-14 17:22:45 +0000776 // For example, "host-linux-jessie".
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000777 HostType string
778
Dmitri Shuralyovbaf8b212020-04-06 17:34:17 -0400779 // KnownIssue is a non-zero golang.org/issue/nnn number for a builder
Dmitri Shuralyov3b519a62020-09-25 11:52:04 -0400780 // that may fail due to a known issue, such as because it is a new
781 // builder still in development/testing, or because the feature
Dmitri Shuralyovbaf8b212020-04-06 17:34:17 -0400782 // or port that it's meant to test hasn't been added yet, etc.
783 //
784 // A non-zero value here means that failures on this builder should not
785 // be considered a serious regression and don't need investigation beyond
786 // what is already in scope of the listed issue.
787 KnownIssue int
788
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000789 Notes string // notes for humans
790
Brad Fitzpatrick756764c2019-03-07 17:44:41 +0000791 // tryBot optionally specifies a policy func for whether trybots are enabled.
792 // nil means off. Even if tryBot returns true, BuildConfig.BuildsRepo must also
793 // return true. See the implementation of BuildConfig.BuildsRepoTryBot.
794 // The proj is "go", "net", etc. The branch is proj's branch.
795 // The goBranch is the same as branch for proj "go", else it's the go branch
796 // ("master, "release-branch.go1.12", etc).
797 tryBot func(proj, branch, goBranch string) bool
798 tryOnly bool // only used for trybots, and not regular builds
Brad Fitzpatrick1c6d9162015-03-20 16:14:52 -0700799
Brad Fitzpatrick756764c2019-03-07 17:44:41 +0000800 CompileOnly bool // if true, compile tests, but don't run them
801 FlakyNet bool // network tests are flaky (try anyway, but ignore some failures)
802
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -0400803 // buildsRepo optionally specifies whether this builder does
804 // builds (of any type) for the given repo ("go", "net", etc.)
805 // and its branch ("master", "release-branch.go1.12", "dev.link", etc.).
806 // goBranch is the branch of "go" to build against. If repo == "go",
807 // goBranch == branch.
Dmitri Shuralyov77c96bb2020-03-19 10:34:11 -0400808 //
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -0400809 // If nil, a default set of repos as reported by buildRepoByDefault
810 // is built. See buildsRepoAtAll method for details.
Dmitri Shuralyov77c96bb2020-03-19 10:34:11 -0400811 //
812 // To implement a minor change to the default policy, create a
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -0400813 // function that uses buildRepoByDefault. For example:
Dmitri Shuralyov77c96bb2020-03-19 10:34:11 -0400814 //
815 // buildsRepo: func(repo, branch, goBranch string) bool {
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -0400816 // b := buildRepoByDefault(repo)
Dmitri Shuralyov77c96bb2020-03-19 10:34:11 -0400817 // // ... modify b from the default value as needed ...
818 // return b
819 // }
820 //
Brad Fitzpatrick756764c2019-03-07 17:44:41 +0000821 buildsRepo func(repo, branch, goBranch string) bool
Brad Fitzpatrick2c2d26c2019-03-01 16:54:25 +0000822
Dmitri Shuralyovad59fb12019-01-11 16:44:01 -0500823 // MinimumGoVersion optionally specifies the minimum Go version
824 // this builder is allowed to use. It can be useful for skipping
825 // builders that are too new and no longer support some supported
826 // Go versions. It doesn't need to be set for builders that support
827 // all supported Go versions.
828 //
829 // Note: This field currently has effect on trybot runs only.
Brad Fitzpatrick756764c2019-03-07 17:44:41 +0000830 //
831 // TODO: unexport this and make buildsRepoAtAll return false on too-old
832 // of repos. The callers in coordinator will need updating.
Dmitri Shuralyovad59fb12019-01-11 16:44:01 -0500833 MinimumGoVersion types.MajorMinor
834
Brad Fitzpatrickb911fb92017-04-13 04:34:42 +0000835 // SkipSnapshot, if true, means to not fetch a tarball
836 // snapshot of the world post-make.bash from the buildlet (and
837 // thus to not write it to Google Cloud Storage). This is
838 // incompatible with sharded tests, and should only be used
839 // for very slow builders or networks, unable to transfer
840 // the tarball in under ~5 minutes.
841 SkipSnapshot bool
842
Quentin Smith0d863782017-03-15 16:18:30 -0400843 // RunBench causes the coordinator to run benchmarks on this buildlet type.
844 RunBench bool
845
Brad Fitzpatricke37005b2016-09-22 23:29:31 +0000846 // StopAfterMake causes the build to stop after the make
847 // script completes, returning its result as the result of the
848 // whole build. It does not run or compile any of the tests,
849 // nor does it write a snapshot of the world to cloud
850 // storage. This option is only supported for builders whose
851 // BuildConfig.SplitMakeRun returns true.
852 StopAfterMake bool
853
Brad Fitzpatrick756764c2019-03-07 17:44:41 +0000854 // needsGoProxy is whether this builder should have GOPROXY set.
855 // Currently this is only for the longtest builder, which needs
856 // to run cmd/go tests fetching from the network.
857 needsGoProxy bool
858
Brad Fitzpatrickbfca87f2017-04-21 23:41:12 +0000859 // InstallRacePackages controls which packages to "go install
860 // -race <pkgs>" after running make.bash (or equivalent). If
861 // the builder ends in "-race", the default if non-nil is just
862 // "std".
863 InstallRacePackages []string
864
Brad Fitzpatrickbd4de1f2017-05-19 21:23:14 +0000865 // GoDeps is a list of of git sha1 commits that must be in the
866 // commit to be tested's history. If absent, this builder is
867 // not run for that commit.
868 GoDeps []string
869
Brad Fitzpatrickad7af462019-10-19 02:49:53 +0000870 // CrossCompileConfig optionally specifies whether and how
871 // this build is cross compiled.
872 CrossCompileConfig *CrossCompileConfig
873
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -0400874 // distTestAdjust optionally specifies a function that can
875 // adjust the cmd/dist test policy for this builder.
876 //
877 // The BuildConfig.ShouldRunDistTest method implements the
878 // default cmd/dist test policy, and then calls distTestAdjust
879 // to adjust that decision further, if distTestAdjust is not nil.
880 //
881 // The initial value of the run parameter is what the default
882 // policy said. The returned value from distTestAdjust is what
883 // BuildConfig.ShouldRunDistTest reports to the caller.
884 //
885 // For example:
886 //
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -0400887 // distTestAdjust: func(run bool, distTest string, isNormalTry bool) bool {
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -0400888 // // ... modify run from the initial value as needed ...
889 // return run
890 // }
891 //
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -0400892 distTestAdjust func(run bool, distTest string, isNormalTry bool) bool
Brad Fitzpatrick7b0a9982017-12-07 00:40:40 +0000893
Brad Fitzpatrick94d01412016-09-13 22:45:48 +0000894 // numTestHelpers is the number of _additional_ buildlets
895 // past the first one to help out with sharded tests.
Dmitri Shuralyov788b5c22020-11-06 07:55:36 -0500896 // For TryBots and SlowBots, the numTryHelpers value is used,
897 // unless it's zero, in which case numTestHelpers is used.
Brad Fitzpatrick94d01412016-09-13 22:45:48 +0000898 numTestHelpers int
Dmitri Shuralyov788b5c22020-11-06 07:55:36 -0500899 numTryTestHelpers int // For TryBots/SlowBots. If 0, numTestHelpers is used.
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -0700900
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -0700901 env []string // extra environment ("key=value") pairs
902 allScriptArgs []string
Brad Fitzpatrick34b995b2019-02-14 02:18:06 +0000903
904 testHostConf *HostConfig // override HostConfig for testing, at least for now
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -0800905}
906
Brad Fitzpatrick756764c2019-03-07 17:44:41 +0000907// Env returns the environment variables this builder should run with.
Andrew Gerrandcae837b2015-08-04 12:19:02 +1000908func (c *BuildConfig) Env() []string {
Brad Fitzpatrick00003f42016-05-06 18:55:26 +0000909 env := []string{"GO_BUILDER_NAME=" + c.Name}
910 if c.FlakyNet {
911 env = append(env, "GO_BUILDER_FLAKY_NET=1")
912 }
Dmitri Shuralyovdf328b12020-05-13 14:30:25 -0400913 if c.IsLongTest() {
914 // Set a private hook in cmd/dist to run main Go repository tests
915 // without the default -short flag. See golang.org/issue/12508.
916 env = append(env, "GO_TEST_SHORT=0")
917 }
Brad Fitzpatrickfb8c09a2019-10-30 03:59:13 +0000918 env = append(env, c.HostConfig().env...)
Brad Fitzpatrick00003f42016-05-06 18:55:26 +0000919 return append(env, c.env...)
Andrew Gerrandcae837b2015-08-04 12:19:02 +1000920}
Brad Fitzpatrick32d05202015-01-21 15:15:48 -0800921
Brad Fitzpatrick756764c2019-03-07 17:44:41 +0000922// ModulesEnv returns the extra module-specific environment variables
923// to append to this builder as a function of the repo being built
924// ("go", "oauth2", "net", etc).
925func (c *BuildConfig) ModulesEnv(repo string) (env []string) {
Carlos Amedee1e761992020-08-20 11:53:58 -0400926 // EC2 and reverse builders should set the public module proxy
927 // address instead of the internal proxy.
928 if (c.HostConfig().isEC2 || c.IsReverse()) && repo != "go" {
Brad Fitzpatricke12c9d22019-05-02 20:32:40 +0000929 env = append(env, "GOPROXY=https://proxy.golang.org")
Brad Fitzpatrick756764c2019-03-07 17:44:41 +0000930 }
931 switch repo {
Brad Fitzpatrick1b471b82019-03-13 04:44:17 +0000932 case "go":
933 if !c.OutboundNetworkAllowed() {
934 env = append(env, "GOPROXY=off")
935 }
Bryan C. Millsc753c212019-08-29 14:26:25 -0400936 case "oauth2", "build", "perf", "website":
Brad Fitzpatrick756764c2019-03-07 17:44:41 +0000937 env = append(env, "GO111MODULE=on")
938 }
Dmitri Shuralyov01fd2992019-09-09 16:48:08 -0400939 return env
940}
941
942// ShouldTestPackageInGOPATHMode is used to control whether the package
943// with the specified import path should be tested in GOPATH mode.
944//
945// When running tests for all golang.org/* repositories in GOPATH mode,
946// this method is called repeatedly with the full import path of each
947// package that is found and is being considered for testing in GOPATH
948// mode. It's not used and has no effect on import paths in the main
949// "go" repository. It has no effect on tests done in module mode.
950//
951// When considering making changes here, keep the release policy in mind:
952//
953// https://golang.org/doc/devel/release.html#policy
954//
955func (*BuildConfig) ShouldTestPackageInGOPATHMode(importPath string) bool {
956 if importPath == "golang.org/x/tools/gopls" ||
957 strings.HasPrefix(importPath, "golang.org/x/tools/gopls/") {
958 // Don't test golang.org/x/tools/gopls/... in GOPATH mode.
959 return false
960 }
Dmitri Shuralyov9bc86d72019-09-17 20:44:48 -0400961 if importPath == "golang.org/x/net/http2/h2demo" {
962 // Don't test golang.org/x/net/http2/h2demo in GOPATH mode.
963 //
964 // It was never tested before golang.org/issue/34361 because it
965 // had a +build h2demo constraint. But that build constraint is
966 // being removed, so explicitly skip testing it in GOPATH mode.
967 //
968 // The package is supported only in module mode now, since
969 // it requires third-party dependencies.
970 return false
971 }
Dmitri Shuralyov01fd2992019-09-09 16:48:08 -0400972 // Test everything else in GOPATH mode as usual.
973 return true
Brad Fitzpatrick756764c2019-03-07 17:44:41 +0000974}
975
Brad Fitzpatrickfb8c09a2019-10-30 03:59:13 +0000976func (c *BuildConfig) IsReverse() bool { return c.HostConfig().IsReverse }
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000977
Brad Fitzpatrickfb8c09a2019-10-30 03:59:13 +0000978func (c *BuildConfig) IsContainer() bool { return c.HostConfig().IsContainer() }
Brad Fitzpatrick14d99732018-05-05 16:36:05 +0000979func (c *HostConfig) IsContainer() bool { return c.ContainerImage != "" }
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000980
Brad Fitzpatrickfb8c09a2019-10-30 03:59:13 +0000981func (c *BuildConfig) IsVM() bool { return c.HostConfig().IsVM() }
Carlos Amedeed77c6d02020-08-18 13:32:05 -0400982
983// IsVM reports whether the instance running the job is ultimately a VM. Hosts where
984// a VM is used only to initiate a container are considered a container, not a VM.
985// EC2 instances may be configured to run in containers that are running
986// on custom AMIs.
987func (c *HostConfig) IsVM() bool {
988 if c.isEC2 {
989 return c.VMImage != "" && c.ContainerImage == ""
990 }
991 return c.VMImage != ""
992}
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +0000993
Brad Fitzpatrickf3c01932015-01-15 16:29:16 -0800994func (c *BuildConfig) GOOS() string { return c.Name[:strings.Index(c.Name, "-")] }
995
996func (c *BuildConfig) GOARCH() string {
997 arch := c.Name[strings.Index(c.Name, "-")+1:]
998 i := strings.Index(arch, "-")
999 if i == -1 {
1000 return arch
1001 }
1002 return arch[:i]
1003}
1004
Brad Fitzpatrickaab85042019-10-16 06:02:29 +00001005// MatchesSlowBotTerm reports whether some provided term from a
1006// TRY=... comment on a Run-TryBot+1 vote on Gerrit should match this
1007// build config.
1008func (c *BuildConfig) MatchesSlowBotTerm(term string) bool {
1009 return term != "" && (term == c.Name || slowBotAliases[term] == c.Name)
1010}
1011
Brad Fitzpatrick79f3fc02015-05-27 21:51:25 -07001012// FilePathJoin is mostly like filepath.Join (without the cleaning) except
1013// it uses the path separator of c.GOOS instead of the host system's.
1014func (c *BuildConfig) FilePathJoin(x ...string) string {
1015 if c.GOOS() == "windows" {
1016 return strings.Join(x, "\\")
1017 }
1018 return strings.Join(x, "/")
1019}
1020
Brad Fitzpatrick34b995b2019-02-14 02:18:06 +00001021// DistTestsExecTimeout returns how long the coordinator should wait
1022// for a cmd/dist test execution to run the provided dist test names.
1023func (c *BuildConfig) DistTestsExecTimeout(distTests []string) time.Duration {
1024 // TODO: consider using distTests? We never did before, but
1025 // now we have the TestStats in the coordinator. Pass in a
1026 // *buildstats.TestStats and use historical data times some
1027 // fudge factor? For now just use the old 20 minute limit
1028 // we've used since 2014, but scale it by the
1029 // GO_TEST_TIMEOUT_SCALE for the super slow builders which
1030 // struggle with, say, the cgo tests. (which should be broken
1031 // up into separate dist tests or shards, like the test/ dir
1032 // was)
1033 d := 20 * time.Minute
1034 d *= time.Duration(c.timeoutScale())
1035 return d
1036}
1037
1038// timeoutScale returns this builder's GO_TEST_TIMEOUT_SCALE value, or 1.
1039func (c *BuildConfig) timeoutScale() int {
1040 const pfx = "GO_TEST_TIMEOUT_SCALE="
Brad Fitzpatrickfb8c09a2019-10-30 03:59:13 +00001041 for _, env := range [][]string{c.env, c.HostConfig().env} {
Brad Fitzpatrick34b995b2019-02-14 02:18:06 +00001042 for _, kv := range env {
1043 if strings.HasPrefix(kv, pfx) {
1044 if n, err := strconv.Atoi(kv[len(pfx):]); err == nil && n > 0 {
1045 return n
1046 }
1047 }
1048 }
1049 }
1050 return 1
1051}
1052
Brad Fitzpatrickfb8c09a2019-10-30 03:59:13 +00001053// HostConfig returns the host configuration of c.
1054func (c *BuildConfig) HostConfig() *HostConfig {
Brad Fitzpatrick34b995b2019-02-14 02:18:06 +00001055 if c.testHostConf != nil {
1056 return c.testHostConf
1057 }
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00001058 if c, ok := Hosts[c.HostType]; ok {
1059 return c
1060 }
1061 panic(fmt.Sprintf("missing buildlet config for buildlet %q", c.Name))
Andrew Gerrand8e28dc92016-03-22 09:05:52 +11001062}
1063
Dmitri Shuralyov1cfe6dc2019-03-26 13:45:16 -04001064// GoBootstrapURL returns the URL of a built Go 1.4+ tar.gz for the
1065// build configuration type c, or empty string if there isn't one.
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00001066func (c *BuildConfig) GoBootstrapURL(e *buildenv.Environment) string {
Brad Fitzpatrickfb8c09a2019-10-30 03:59:13 +00001067 return strings.Replace(c.HostConfig().goBootstrapURLTmpl, "$BUCKET", e.BuildletBucket, 1)
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00001068}
1069
1070// BuildletBinaryURL returns the public URL of this builder's buildlet.
1071func (c *HostConfig) BuildletBinaryURL(e *buildenv.Environment) string {
Andrew Gerrand8e28dc92016-03-22 09:05:52 +11001072 tmpl := c.buildletURLTmpl
Evan Browna7311512016-02-14 15:59:59 -08001073 return strings.Replace(tmpl, "$BUCKET", e.BuildletBucket, 1)
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -08001074}
1075
Brad Fitzpatricka5383ff2015-06-17 08:22:14 -07001076func (c *BuildConfig) IsRace() bool {
1077 return strings.HasSuffix(c.Name, "-race")
1078}
1079
Dmitri Shuralyovdf328b12020-05-13 14:30:25 -04001080// IsLongTest reports whether this is a longtest builder.
1081// A longtest builder runs tests without the -short flag.
1082//
1083// A builder is considered to be a longtest builder
1084// if and only if its name ends with "-longtest".
Brad Fitzpatrick86650282019-03-11 18:49:56 +00001085func (c *BuildConfig) IsLongTest() bool {
1086 return strings.HasSuffix(c.Name, "-longtest")
1087}
1088
Brad Fitzpatrick1b471b82019-03-13 04:44:17 +00001089// OutboundNetworkAllowed reports whether this builder should be
1090// allowed to make outbound network requests. This is only enforced
1091// on some builders. (Currently most Linux ones)
1092func (c *BuildConfig) OutboundNetworkAllowed() bool {
Brad Fitzpatrick95bc93b2019-05-10 19:28:40 +00001093 return c.IsLongTest()
Brad Fitzpatrick1b471b82019-03-13 04:44:17 +00001094}
1095
Brad Fitzpatrickbfca87f2017-04-21 23:41:12 +00001096func (c *BuildConfig) GoInstallRacePackages() []string {
1097 if c.InstallRacePackages != nil {
1098 return append([]string(nil), c.InstallRacePackages...)
1099 }
1100 if c.IsRace() {
1101 return []string{"std"}
1102 }
1103 return nil
1104}
1105
Brad Fitzpatrickf8c24842015-01-16 09:54:03 -08001106// AllScript returns the relative path to the operating system's script to
1107// do the build and run its standard set of tests.
1108// Example values are "src/all.bash", "src/all.bat", "src/all.rc".
1109func (c *BuildConfig) AllScript() string {
Brad Fitzpatrick18840f872017-04-12 21:37:13 +00001110 if c.Name == "" {
1111 panic("bogus BuildConfig")
1112 }
Brad Fitzpatricka5383ff2015-06-17 08:22:14 -07001113 if c.IsRace() {
Brad Fitzpatrick32d05202015-01-21 15:15:48 -08001114 if strings.HasPrefix(c.Name, "windows-") {
1115 return "src/race.bat"
1116 }
1117 return "src/race.bash"
1118 }
Brad Fitzpatrickf8c24842015-01-16 09:54:03 -08001119 if strings.HasPrefix(c.Name, "windows-") {
1120 return "src/all.bat"
1121 }
1122 if strings.HasPrefix(c.Name, "plan9-") {
1123 return "src/all.rc"
1124 }
Brad Fitzpatrick8c6116a2016-05-05 00:42:49 +00001125 if strings.HasPrefix(c.Name, "misc-compile") {
Brad Fitzpatrickab7ff8a2015-04-29 14:44:46 -07001126 return "src/buildall.bash"
1127 }
Brad Fitzpatrickf8c24842015-01-16 09:54:03 -08001128 return "src/all.bash"
1129}
1130
Brad Fitzpatrick7d9b0362015-05-27 11:51:27 -07001131// SplitMakeRun reports whether the coordinator should first compile
1132// (using c.MakeScript), then snapshot, then run the tests (ideally
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001133// sharded) using cmd/dist test.
Brad Fitzpatrick7d9b0362015-05-27 11:51:27 -07001134// Eventually this function should always return true (and then be deleted)
1135// but for now we've only set up the scripts and verified that the main
1136// configurations work.
1137func (c *BuildConfig) SplitMakeRun() bool {
1138 switch c.AllScript() {
Brad Fitzpatrickde72d462016-05-04 17:47:12 +00001139 case "src/all.bash", "src/all.bat",
1140 "src/race.bash", "src/race.bat",
Dmitri Shuralyov0ff21932020-10-07 11:12:00 -04001141 "src/all.rc":
Brad Fitzpatrick7d9b0362015-05-27 11:51:27 -07001142 // These we've verified to work.
1143 return true
1144 }
Elias Naur8057bc82020-10-03 11:22:43 +02001145 // TODO(bradfitz): buildall.bash should really just be N small container
1146 // jobs instead of a "buildall.bash". Then we can delete this whole method.
Brad Fitzpatrick7d9b0362015-05-27 11:51:27 -07001147 return false
1148}
1149
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001150func (c *BuildConfig) IsTryOnly() bool { return c.tryOnly }
1151
1152func (c *BuildConfig) NeedsGoProxy() bool { return c.needsGoProxy }
1153
Dmitri Shuralyov1cfe6dc2019-03-26 13:45:16 -04001154// BuildsRepoPostSubmit reports whether the build configuration type c
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001155// should build the given repo ("go", "net", etc) and branch
1156// ("master", "release-branch.go1.12") as a post-submit build
1157// that shows up on https://build.golang.org/.
1158func (c *BuildConfig) BuildsRepoPostSubmit(repo, branch, goBranch string) bool {
1159 if c.tryOnly {
Andrew Gerrand234725b2015-06-04 16:45:17 -07001160 return false
1161 }
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001162 return c.buildsRepoAtAll(repo, branch, goBranch)
Andrew Gerrand234725b2015-06-04 16:45:17 -07001163}
1164
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001165// BuildsRepoTryBot reports whether the build configuration type c
1166// should build the given repo ("go", "net", etc) and branch
1167// ("master", "release-branch.go1.12") as a trybot.
1168func (c *BuildConfig) BuildsRepoTryBot(repo, branch, goBranch string) bool {
1169 return c.tryBot != nil && c.tryBot(repo, branch, goBranch) && c.buildsRepoAtAll(repo, branch, goBranch)
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00001170}
1171
Brad Fitzpatrick32d155d2019-03-19 17:17:23 +00001172// ShouldRunDistTest reports whether the named cmd/dist test should be
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04001173// run for this build config. The isNormalTry parameter is whether this
1174// is for a normal TryBot (non-SlowBot) run.
Brad Fitzpatrick32d155d2019-03-19 17:17:23 +00001175//
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04001176// In general, this returns true. When in normal trybot mode,
1177// some slow portable tests are only run on the fastest builder.
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001178//
1179// Individual builders can adjust this policy to fit their needs.
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04001180func (c *BuildConfig) ShouldRunDistTest(distTest string, isNormalTry bool) bool {
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001181 run := true
1182
1183 // This section implements the default cmd/dist test policy.
1184 // Any changes here will affect test coverage on all builders.
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04001185 if isNormalTry {
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001186 slowPortableTest := distTest == "api" // Whether a test is slow and has the same behavior everywhere.
1187 fastestBuilder := c.Name == "linux-amd64"
1188 if slowPortableTest && !fastestBuilder {
1189 // Don't run the test on this builder.
1190 run = false
1191 }
Brad Fitzpatrick32d155d2019-03-19 17:17:23 +00001192 }
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001193
1194 // Let individual builders adjust the cmd/dist test policy.
1195 if c.distTestAdjust != nil {
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04001196 run = c.distTestAdjust(run, distTest, isNormalTry)
Brad Fitzpatrick32d155d2019-03-19 17:17:23 +00001197 }
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001198
1199 return run
Brad Fitzpatrick32d155d2019-03-19 17:17:23 +00001200}
1201
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001202// buildsRepoAtAll reports whether we should do builds of the provided
1203// repo ("go", "sys", "net", etc). This applies to both post-submit
1204// and trybot builds. Use BuildsRepoPostSubmit for only post-submit
1205// or BuildsRepoTryBot for trybots.
Brad Fitzpatrick86650282019-03-11 18:49:56 +00001206//
1207// The branch is the branch of repo ("master",
1208// "release-branch.go1.12", etc); it is required. The goBranch is the
1209// branch of Go itself. It's required if repo != "go". When repo ==
1210// "go", the goBranch defaults to the value of branch.
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001211func (c *BuildConfig) buildsRepoAtAll(repo, branch, goBranch string) bool {
Brad Fitzpatrick86650282019-03-11 18:49:56 +00001212 if goBranch == "" {
1213 if repo == "go" {
1214 goBranch = branch
1215 } else {
1216 panic("missing goBranch")
1217 }
1218 }
1219 if branch == "" {
1220 panic("missing branch")
1221 }
1222 if repo == "" {
1223 panic("missing repo")
1224 }
Brad Fitzpatrick77b8b6b2019-02-28 23:20:41 +00001225 // Don't build old branches.
1226 const minGo1x = 11
Tobias Klauserb7b66932019-03-13 09:29:15 +01001227 for _, b := range []string{branch, goBranch} {
1228 if bmaj, bmin, ok := version.ParseReleaseBranch(b); ok {
1229 if bmaj != 1 || bmin < minGo1x {
1230 return false
1231 }
1232 bmm := types.MajorMinor{bmaj, bmin}
1233 if bmm.Less(c.MinimumGoVersion) {
1234 return false
1235 }
Brad Fitzpatrick85a73d72019-04-03 04:45:29 +00001236 if repo == "exp" {
1237 // Don't test exp against release branches; it's experimental.
1238 return false
1239 }
Tobias Klauserb7b66932019-03-13 09:29:15 +01001240 }
Dmitri Shuralyov56e5e742018-11-15 00:55:22 -05001241 }
Brad Fitzpatrick77b8b6b2019-02-28 23:20:41 +00001242
Dmitri Shuralyovac5b4192018-11-15 01:15:27 -05001243 // Build dev.boringcrypto branches only on linux/amd64 and windows/386 (see golang.org/issue/26791).
1244 if repo == "go" && (branch == "dev.boringcrypto" || strings.HasPrefix(branch, "dev.boringcrypto.")) {
1245 if c.Name != "linux-amd64" && c.Name != "windows-386-2008" {
1246 return false
1247 }
1248 }
Brad Fitzpatrickd6a8c272019-04-05 05:26:05 +00001249 if repo != "go" && !c.SplitMakeRun() {
1250 return false
1251 }
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001252 if p := c.buildsRepo; p != nil {
1253 return p(repo, branch, goBranch)
1254 }
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04001255 return buildRepoByDefault(repo)
Brad Fitzpatrickd6a8c272019-04-05 05:26:05 +00001256}
1257
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04001258// buildRepoByDefault reports whether builders should do builds
1259// for the given repo ("go", "net", etc.) by default.
1260//
1261// It's used directly by BuildConfig.buildsRepoAtAll method for
1262// builders with a nil BuildConfig.buildsRepo value.
1263// It's also used by many builders that provide a custom build
1264// repo policy (a non-nil BuildConfig.buildsRepo value) as part
1265// of making the decision of whether to build a given repo.
1266//
1267// As a result, it effectively implements the default build repo policy.
1268// Any changes here will affect repo coverage of many builders.
1269func buildRepoByDefault(repo string) bool {
Brad Fitzpatrick83c6b6a2019-03-14 20:35:32 +00001270 switch repo {
1271 case "go":
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04001272 // Build the main Go repository by default.
Brad Fitzpatrick83c6b6a2019-03-14 20:35:32 +00001273 return true
Brad Fitzpatrickc8ca9622019-12-07 05:14:28 +00001274 case "mobile", "exp", "build":
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04001275 // Don't build x/mobile, x/exp, x/build by default.
1276 //
1277 // Builders need to explicitly opt-in to build these repos.
Brad Fitzpatrickb8db43d2019-03-11 04:20:46 +00001278 return false
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04001279 default:
1280 // Build all other golang.org/x repositories by default.
1281 return true
Brad Fitzpatrickb8db43d2019-03-11 04:20:46 +00001282 }
Dmitri Shuralyov56e5e742018-11-15 00:55:22 -05001283}
1284
Brad Fitzpatrickd6a8c272019-04-05 05:26:05 +00001285func defaultPlusExp(repo, branch, goBranch string) bool {
1286 if repo == "exp" {
1287 return true
1288 }
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04001289 return buildRepoByDefault(repo)
Brad Fitzpatrickd6a8c272019-04-05 05:26:05 +00001290}
1291
Brad Fitzpatrickc8ca9622019-12-07 05:14:28 +00001292func defaultPlusExpBuild(repo, branch, goBranch string) bool {
1293 if repo == "exp" || repo == "build" {
1294 return true
1295 }
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04001296 return buildRepoByDefault(repo)
Brad Fitzpatrickc8ca9622019-12-07 05:14:28 +00001297}
1298
Andrew Gerrandfb774882015-05-21 14:02:38 +10001299// AllScriptArgs returns the set of arguments that should be passed to the
David Crawshawe078c6f2015-04-29 08:54:19 -04001300// all.bash-equivalent script. Usually empty.
1301func (c *BuildConfig) AllScriptArgs() []string {
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -07001302 return append([]string(nil), c.allScriptArgs...)
David Crawshawe078c6f2015-04-29 08:54:19 -04001303}
1304
Andrew Gerrandf83f3e42015-02-02 12:05:01 +00001305// MakeScript returns the relative path to the operating system's script to
1306// do the build.
1307// Example values are "src/make.bash", "src/make.bat", "src/make.rc".
1308func (c *BuildConfig) MakeScript() string {
1309 if strings.HasPrefix(c.Name, "windows-") {
1310 return "src/make.bat"
1311 }
1312 if strings.HasPrefix(c.Name, "plan9-") {
1313 return "src/make.rc"
1314 }
1315 return "src/make.bash"
1316}
1317
Andrew Gerrandfb774882015-05-21 14:02:38 +10001318// MakeScriptArgs returns the set of arguments that should be passed to the
1319// make.bash-equivalent script. Usually empty.
1320func (c *BuildConfig) MakeScriptArgs() []string {
1321 return c.AllScriptArgs()
1322}
1323
Andrew Gerrandf83f3e42015-02-02 12:05:01 +00001324// GorootFinal returns the default install location for
1325// releases for this platform.
1326func (c *BuildConfig) GorootFinal() string {
1327 if strings.HasPrefix(c.Name, "windows-") {
1328 return "c:\\go"
1329 }
1330 return "/usr/local/go"
1331}
1332
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -08001333// MachineType returns the GCE machine type to use for this builder.
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00001334func (c *HostConfig) MachineType() string {
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -08001335 if v := c.machineType; v != "" {
1336 return v
1337 }
Brad Fitzpatrick6ae87502018-05-04 02:42:17 +00001338 if c.IsContainer() {
1339 // Set a higher default machine size for containers,
1340 // so their /workdir tmpfs can be larger. The COS
1341 // image has no swap, so we want to make sure the
1342 // /workdir fits completely in memory.
Dmitri Shuralyov99393002019-11-22 18:01:25 -05001343 return "n1-standard-4" // 4 vCPUs, 15 GB mem
Brad Fitzpatrick6ae87502018-05-04 02:42:17 +00001344 }
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -08001345 return "n1-highcpu-2"
1346}
1347
Carlos Amedee6c8dc322020-05-13 13:27:15 -04001348// IsEC2 returns true if the machine type is an EC2 arm64 type.
1349func (c *HostConfig) IsEC2() bool {
1350 return c.isEC2
1351}
1352
David Crawshaweef380f2015-04-30 20:03:01 -04001353// ShortOwner returns a short human-readable owner.
1354func (c BuildConfig) ShortOwner() string {
Brad Fitzpatrickfb8c09a2019-10-30 03:59:13 +00001355 owner := c.HostConfig().Owner
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00001356 if owner == "" {
David Crawshaweef380f2015-04-30 20:03:01 -04001357 return "go-dev"
1358 }
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00001359 return strings.TrimSuffix(owner, "@golang.org")
David Crawshaweef380f2015-04-30 20:03:01 -04001360}
1361
Jess Frazellebe067592017-04-13 19:38:46 +00001362// OwnerGithub returns the Github handle of the owner.
1363func (c BuildConfig) OwnerGithub() string {
Brad Fitzpatrickfb8c09a2019-10-30 03:59:13 +00001364 return c.HostConfig().OwnerGithub
Jess Frazellebe067592017-04-13 19:38:46 +00001365}
1366
Brad Fitzpatrickf787cec2016-09-23 00:06:28 +00001367// PoolName returns a short summary of the builder's host type for the
Kevin Burke315d0bd2017-04-03 07:51:28 -07001368// https://farmer.golang.org/builders page.
Brad Fitzpatrickf787cec2016-09-23 00:06:28 +00001369func (c *HostConfig) PoolName() string {
1370 switch {
1371 case c.IsReverse:
1372 return "Reverse (dedicated machine/VM)"
Carlos Amedee6c8dc322020-05-13 13:27:15 -04001373 case c.IsEC2():
Carlos Amedee5e227ac2020-05-19 17:26:14 -04001374 return "EC2 VM Container"
Brad Fitzpatrick14d99732018-05-05 16:36:05 +00001375 case c.IsVM():
Brad Fitzpatrickf787cec2016-09-23 00:06:28 +00001376 return "GCE VM"
Brad Fitzpatrick14d99732018-05-05 16:36:05 +00001377 case c.IsContainer():
Brad Fitzpatrick6ae87502018-05-04 02:42:17 +00001378 return "Container"
Brad Fitzpatrickf787cec2016-09-23 00:06:28 +00001379 }
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +00001380 panic("unknown builder type")
1381}
1382
Brad Fitzpatrick69dd6b22019-02-21 21:10:54 +00001383// ContainerVMImage returns the base VM name (not the fully qualified
1384// URL resource name of the VM) that starts the konlet program that
Brad Fitzpatrick6994fc22019-05-17 20:08:13 +00001385// pulls & runs a container.
1386// The empty string means that no particular VM image is required
1387// and the caller can run this container in any host.
1388//
1389// This method is only applicable when c.IsContainer() is true.
Brad Fitzpatrick69dd6b22019-02-21 21:10:54 +00001390func (c *HostConfig) ContainerVMImage() string {
1391 if c.KonletVMImage != "" {
1392 return c.KonletVMImage
1393 }
Brad Fitzpatrick6994fc22019-05-17 20:08:13 +00001394 if c.NestedVirt {
1395 return "debian-stretch-vmx"
1396 }
Carlos Amedee5e227ac2020-05-19 17:26:14 -04001397 if c.isEC2 && c.ContainerImage != "" {
1398 return fmt.Sprintf("gcr.io/%s/%s", buildenv.Production.ProjectName, c.ContainerImage)
1399 }
Brad Fitzpatrick6994fc22019-05-17 20:08:13 +00001400 return ""
Brad Fitzpatrick69dd6b22019-02-21 21:10:54 +00001401}
1402
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +00001403// IsHermetic reports whether this host config gets a fresh
1404// environment (including /usr, /var, etc) for each execution. This is
1405// true for VMs, GKE, and reverse buildlets running their containers
1406// running in Docker, but false on some reverse buildlets.
1407func (c *HostConfig) IsHermetic() bool {
1408 switch {
1409 case c.IsReverse:
1410 return c.HermeticReverse
Carlos Amedee6c8dc322020-05-13 13:27:15 -04001411 case c.IsEC2():
1412 return true
Brad Fitzpatrick14d99732018-05-05 16:36:05 +00001413 case c.IsVM():
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +00001414 return true
Brad Fitzpatrick14d99732018-05-05 16:36:05 +00001415 case c.IsContainer():
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +00001416 return true
1417 }
1418 panic("unknown builder type")
Brad Fitzpatrickf787cec2016-09-23 00:06:28 +00001419}
1420
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -07001421// GCENumCPU reports the number of GCE CPUs this buildlet requires.
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00001422func (c *HostConfig) GCENumCPU() int {
Brad Fitzpatrick1b1e0862015-06-04 18:25:50 -07001423 t := c.MachineType()
1424 n, _ := strconv.Atoi(t[strings.LastIndex(t, "-")+1:])
1425 return n
1426}
1427
Dmitri Shuralyov788b5c22020-11-06 07:55:36 -05001428// NumTestHelpers reports how many additional buildlets
1429// past the first one to help out with sharded tests.
1430//
1431// isTry specifies whether it's for a pre-submit test
1432// run (a TryBot or SlowBot) where speed matters more.
Brad Fitzpatrick94d01412016-09-13 22:45:48 +00001433func (c *BuildConfig) NumTestHelpers(isTry bool) int {
1434 if isTry && c.numTryTestHelpers != 0 {
1435 return c.numTryTestHelpers
1436 }
1437 return c.numTestHelpers
1438}
1439
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00001440// defaultTrySet returns a trybot policy function that reports whether
1441// a project should use trybots. All the default projects are included,
1442// plus any given in extraProj.
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001443func defaultTrySet(extraProj ...string) func(proj, branch, goBranch string) bool {
1444 return func(proj, branch, goBranch string) bool {
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00001445 if proj == "go" {
1446 return true
1447 }
1448 for _, p := range extraProj {
1449 if proj == p {
1450 return true
1451 }
1452 }
1453 switch proj {
Brad Fitzpatrick83c6b6a2019-03-14 20:35:32 +00001454 case "grpc-review":
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00001455 return false
1456 }
1457 return true
1458 }
1459}
1460
1461// explicitTrySet returns a trybot policy function that reports
1462// whether a project should use trybots. Only the provided projects in
1463// projs are enabled.
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001464func explicitTrySet(projs ...string) func(proj, branch, goBranch string) bool {
1465 return func(proj, branch, goBranch string) bool {
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00001466 for _, p := range projs {
1467 if proj == p {
1468 return true
1469 }
1470 }
1471 return false
1472 }
1473}
1474
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -08001475func init() {
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -08001476 addBuilder(BuildConfig{
Brad Fitzpatrick05d9e9b2018-09-27 23:43:25 +00001477 Name: "freebsd-amd64-11_2",
1478 HostType: "host-freebsd-11_2",
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00001479 tryBot: explicitTrySet("sys"),
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001480 distTestAdjust: fasterTrybots,
Brad Fitzpatrick05d9e9b2018-09-27 23:43:25 +00001481 numTryTestHelpers: 4,
Carlos Amedee2ecf4242021-04-23 11:33:51 -04001482 buildsRepo: func(repo, branch, goBranch string) bool {
1483 // This builder is still used by Go 1.16 and 1.15,
1484 // so keep it around a bit longer. See golang.org/issue/45727.
1485 // Test relevant Go versions so that we're better informed.
1486 return atMostGo1(goBranch, 16) && buildRepoByDefault(repo)
1487 },
Brad Fitzpatrick05d9e9b2018-09-27 23:43:25 +00001488 })
1489 addBuilder(BuildConfig{
Carlos Amedee8050efc2021-04-20 13:43:05 -04001490 Name: "freebsd-amd64-11_4",
1491 HostType: "host-freebsd-11_4",
Carlos Amedee2ecf4242021-04-23 11:33:51 -04001492 tryBot: explicitTrySet("sys"),
1493 distTestAdjust: fasterTrybots,
Carlos Amedee8050efc2021-04-20 13:43:05 -04001494 numTryTestHelpers: 4,
Carlos Amedee8050efc2021-04-20 13:43:05 -04001495 })
1496 addBuilder(BuildConfig{
Carlos Amedee2ecf4242021-04-23 11:33:51 -04001497 Name: "freebsd-amd64-12_2",
1498 HostType: "host-freebsd-12_2",
1499 tryBot: defaultTrySet("sys"),
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001500
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001501 distTestAdjust: fasterTrybots, // If changing this policy, update TestShouldRunDistTest accordingly.
Brad Fitzpatrick75ed3772018-10-05 20:57:29 +00001502 numTryTestHelpers: 4,
Brad Fitzpatrick75ed3772018-10-05 20:57:29 +00001503 })
1504 addBuilder(BuildConfig{
Carlos Amedee8050efc2021-04-20 13:43:05 -04001505 Name: "freebsd-386-12_2",
1506 HostType: "host-freebsd-12_2",
1507 env: []string{"GOARCH=386", "GOHOSTARCH=386"},
Carlos Amedee2ecf4242021-04-23 11:33:51 -04001508 distTestAdjust: fasterTrybots,
Carlos Amedee8050efc2021-04-20 13:43:05 -04001509 numTryTestHelpers: 4,
Carlos Amedee8050efc2021-04-20 13:43:05 -04001510 })
1511 addBuilder(BuildConfig{
Brad Fitzpatrick13560662019-11-14 15:43:33 +00001512 Name: "freebsd-amd64-race",
Carlos Amedee2ecf4242021-04-23 11:33:51 -04001513 HostType: "host-freebsd-12_2-big",
Brad Fitzpatrickbed69d62017-02-27 16:05:25 +00001514 })
1515 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001516 Name: "freebsd-386-11_2",
1517 HostType: "host-freebsd-11_2",
1518 distTestAdjust: noTestDirAndNoReboot,
1519 tryBot: explicitTrySet("sys"),
1520 env: []string{"GOARCH=386", "GOHOSTARCH=386"},
Carlos Amedee2ecf4242021-04-23 11:33:51 -04001521 buildsRepo: func(repo, branch, goBranch string) bool {
1522 // This builder is still used by Go 1.16 and 1.15,
1523 // so keep it around a bit longer. See golang.org/issue/45727.
1524 // Test relevant Go versions so that we're better informed.
1525 return atMostGo1(goBranch, 16) && buildRepoByDefault(repo)
1526 },
Brad Fitzpatrick05d9e9b2018-09-27 23:43:25 +00001527 })
1528 addBuilder(BuildConfig{
Carlos Amedee8050efc2021-04-20 13:43:05 -04001529 Name: "freebsd-386-11_4",
1530 HostType: "host-freebsd-11_4",
1531 distTestAdjust: noTestDirAndNoReboot,
Carlos Amedee2ecf4242021-04-23 11:33:51 -04001532 tryBot: explicitTrySet("sys"),
Carlos Amedee8050efc2021-04-20 13:43:05 -04001533 env: []string{"GOARCH=386", "GOHOSTARCH=386"},
Carlos Amedee8050efc2021-04-20 13:43:05 -04001534 })
1535 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001536 Name: "linux-386",
Carlos Amedee23650a92021-08-18 17:45:09 -04001537 HostType: "host-linux-bullseye",
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001538 distTestAdjust: fasterTrybots,
1539 tryBot: defaultTrySet(),
Carlos Amedee23650a92021-08-18 17:45:09 -04001540 Notes: "Debian stable (currently Debian bullseye).",
Brad Fitzpatrickc889f4d2019-03-06 02:06:17 +00001541 env: []string{
1542 "GOARCH=386",
1543 "GOHOSTARCH=386",
Brad Fitzpatrick136868b2019-08-29 18:28:01 +00001544 "GO_DISABLE_OUTBOUND_NETWORK=1",
Brad Fitzpatrickc889f4d2019-03-06 02:06:17 +00001545 },
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00001546 numTestHelpers: 1,
1547 numTryTestHelpers: 3,
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -08001548 })
1549 addBuilder(BuildConfig{
Dmitri Shuralyov0f5b1a72020-10-07 11:24:42 -04001550 Name: "linux-386-softfloat",
1551 Notes: "GO386=softfloat",
1552 buildsRepo: func(repo, branch, goBranch string) bool {
1553 // GO386=softfloat is added in Go 1.16 (golang.org/issue/41848).
1554 return atLeastGo1(goBranch, 16) && (repo == "go" || repo == "crypto")
1555 },
Dmitri Shuralyov0f5b1a72020-10-07 11:24:42 -04001556 GoDeps: []string{
1557 "04b8a9fea57e37589d82410281f22ebde0027808", // CL 260017, "all: implement GO386=softfloat".
1558 },
1559 HostType: "host-linux-stretch",
1560 env: []string{"GOARCH=386", "GOHOSTARCH=386", "GO386=softfloat"},
1561 })
1562 addBuilder(BuildConfig{
Brad Fitzpatrickd6a8c272019-04-05 05:26:05 +00001563 Name: "linux-amd64",
Carlos Amedee701f7172021-08-19 13:27:43 -04001564 HostType: "host-linux-bullseye",
Brad Fitzpatrickd6a8c272019-04-05 05:26:05 +00001565 tryBot: defaultTrySet(),
Brad Fitzpatrickc8ca9622019-12-07 05:14:28 +00001566 buildsRepo: defaultPlusExpBuild,
Brad Fitzpatrickc889f4d2019-03-06 02:06:17 +00001567 env: []string{
Brad Fitzpatrick136868b2019-08-29 18:28:01 +00001568 "GO_DISABLE_OUTBOUND_NETWORK=1",
Brad Fitzpatrickc889f4d2019-03-06 02:06:17 +00001569 },
Brad Fitzpatrick6ae87502018-05-04 02:42:17 +00001570 numTestHelpers: 1,
1571 numTryTestHelpers: 4,
1572 RunBench: true,
Evan Brown08b68a92015-11-20 10:00:06 -08001573 })
Brad Fitzpatrick0261b662019-02-15 22:05:42 +00001574 addBuilder(BuildConfig{
Brad Fitzpatrick8bd8e0e2019-03-26 23:04:31 +00001575 Name: "linux-amd64-vmx",
1576 HostType: "host-linux-stretch-vmx",
Brad Fitzpatrick8bd8e0e2019-03-26 23:04:31 +00001577 buildsRepo: disabledBuilder,
Brad Fitzpatrick0261b662019-02-15 22:05:42 +00001578 })
Brad Fitzpatrick87137012017-11-18 03:31:35 +00001579
1580 const testAlpine = false // Issue 22689 (hide all red builders), Issue 19938 (get Alpine passing)
1581 if testAlpine {
1582 addBuilder(BuildConfig{
1583 Name: "linux-amd64-alpine",
1584 HostType: "host-linux-x86-alpine",
1585 })
1586 }
1587
Dmitri Shuralyov646d48d2021-04-23 16:56:37 -04001588 // addMiscCompileGo1 adds a misc-compile TryBot that
1589 // runs buildall.bash on the specified target(s), up to 3 max.
1590 // The targets are matched against the "go tool dist list" name,
1591 // but with hyphens instead of forward slashes ("linux-amd64", etc).
Dmitri Shuralyov4c544cb2020-11-02 22:25:51 -05001592 // If min is non-zero, it specifies the minimum Go 1.x version.
Dmitri Shuralyov646d48d2021-04-23 16:56:37 -04001593 addMiscCompileGo1 := func(min int, suffix string, targets ...string) {
1594 if len(targets) > 3 {
1595 // This limit will do until we have better visibility
1596 // into holistic TryBot completion times via metrics.
1597 panic("at most 3 targets may be specified to avoid making TryBots slow; see issues 32632 and 17104")
1598 }
Dmitri Shuralyov4c544cb2020-11-02 22:25:51 -05001599 var v types.MajorMinor
1600 var alsoNote string
1601 if min != 0 {
1602 v = types.MajorMinor{1, min}
1603 alsoNote = fmt.Sprintf(" Applies to Go 1.%d and newer.", min)
1604 }
Brad Fitzpatrick8c6116a2016-05-05 00:42:49 +00001605 addBuilder(BuildConfig{
Brad Fitzpatrickd7985a82019-03-06 05:20:12 +00001606 Name: "misc-compile" + suffix,
1607 HostType: "host-linux-jessie",
1608 tryBot: defaultTrySet(),
1609 env: []string{
Brad Fitzpatrick136868b2019-08-29 18:28:01 +00001610 "GO_DISABLE_OUTBOUND_NETWORK=1",
Brad Fitzpatrickd7985a82019-03-06 05:20:12 +00001611 },
Dmitri Shuralyov4c544cb2020-11-02 22:25:51 -05001612 tryOnly: true,
1613 MinimumGoVersion: v,
1614 CompileOnly: true,
Dmitri Shuralyov646d48d2021-04-23 16:56:37 -04001615 Notes: "Runs buildall.bash to cross-compile & vet std+cmd packages for " + strings.Join(targets, " & ") + ", but doesn't run any tests." + alsoNote,
Brad Fitzpatrick8c6116a2016-05-05 00:42:49 +00001616 allScriptArgs: []string{
1617 // Filtering pattern to buildall.bash:
Dmitri Shuralyov646d48d2021-04-23 16:56:37 -04001618 "^(" + strings.Join(targets, "|") + ")$",
Brad Fitzpatrick8c6116a2016-05-05 00:42:49 +00001619 },
1620 })
1621 }
Dmitri Shuralyov4c544cb2020-11-02 22:25:51 -05001622 // addMiscCompile adds a misc-compile TryBot
1623 // for all supported Go versions.
Dmitri Shuralyov646d48d2021-04-23 16:56:37 -04001624 addMiscCompile := func(suffix string, targets ...string) { addMiscCompileGo1(0, suffix, targets...) }
Dmitri Shuralyov78307532020-11-02 12:41:26 -05001625
Dmitri Shuralyov646d48d2021-04-23 16:56:37 -04001626 // Arrange so that no more than 3 ports are tested sequentially in each misc-compile
1627 // TryBot to avoid any individual misc-compile TryBot from becoming a bottleneck for
1628 // overall TryBot completion time (currently 10 minutes; see golang.org/issue/17104).
1629 //
1630 // The TestTryBotsCompileAllPorts test is used to detect any gaps in TryBot coverage
1631 // when new ports are added, and the misc-compile pairs below can be re-arranged.
1632 //
1633 // (In the past, we used flexible regexp patterns that matched all architectures
1634 // for a given GOOS value. However, over time as new architectures were added,
1635 // some misc-compile TryBot could become much slower than others.)
1636 //
1637 // See golang.org/issue/32632.
Dmitri Shuralyovf9ec3ca2021-04-27 15:33:27 -04001638 addMiscCompile("-mac-win", "darwin-amd64", "windows-arm", "windows-arm64")
Dmitri Shuralyov646d48d2021-04-23 16:56:37 -04001639 addMiscCompileGo1(16, "-darwinarm64", "darwin-arm64") // darwin/arm64 (for Go 1.16 and newer) only.
1640 addMiscCompile("-mips", "linux-mips", "linux-mips64")
1641 addMiscCompile("-mipsle", "linux-mipsle", "linux-mips64le")
1642 addMiscCompile("-ppc", "linux-ppc64", "linux-ppc64le", "aix-ppc64")
1643 addMiscCompile("-freebsd", "freebsd-386", "freebsd-arm", "freebsd-arm64")
1644 addMiscCompile("-netbsd", "netbsd-386", "netbsd-amd64")
1645 addMiscCompile("-netbsd-arm", "netbsd-arm", "netbsd-arm64")
1646 addMiscCompile("-openbsd", "openbsd-386", "openbsd-mips64")
1647 addMiscCompile("-openbsd-arm", "openbsd-arm", "openbsd-arm64")
1648 addMiscCompile("-plan9", "plan9-386", "plan9-amd64", "plan9-arm")
1649 addMiscCompile("-other-1", "solaris-amd64", "illumos-amd64", "dragonfly-amd64")
1650 addMiscCompile("-other-2", "linux-riscv64", "linux-s390x", "linux-arm-arm5") // 'linux-arm-arm5' is linux/arm with GOARM=5.
Dmitri Shuralyov55e1ef62020-09-28 11:04:35 -04001651
1652 // TODO: Issue 25963, get the misc-compile trybots for Android/iOS.
1653 // Then consider subrepos too, so "mobile" can at least be included
1654 // as a misc-compile for ^android- and ^ios-.
Brad Fitzpatrick8c6116a2016-05-05 00:42:49 +00001655
Brad Fitzpatrickab7ff8a2015-04-29 14:44:46 -07001656 addBuilder(BuildConfig{
Brad Fitzpatrick13560662019-11-14 15:43:33 +00001657 Name: "linux-amd64-nocgo",
Carlos Amedee701f7172021-08-19 13:27:43 -04001658 HostType: "host-linux-bullseye",
Brad Fitzpatrick13560662019-11-14 15:43:33 +00001659 Notes: "cgo disabled",
Brad Fitzpatrick83c6b6a2019-03-14 20:35:32 +00001660 buildsRepo: func(repo, branch, goBranch string) bool {
1661 switch repo {
1662 case "perf":
1663 // Requires sqlite, which requires cgo.
1664 return false
1665 case "mobile":
1666 return false
Brad Fitzpatrickf6d512d2019-12-12 17:43:59 +00001667 case "build":
1668 return false
Brad Fitzpatrick83c6b6a2019-03-14 20:35:32 +00001669 }
1670 return true
1671 },
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -08001672 env: []string{
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -08001673 "CGO_ENABLED=0",
Brad Fitzpatrick136868b2019-08-29 18:28:01 +00001674 "GO_DISABLE_OUTBOUND_NETWORK=1",
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -08001675 // This USER=root was required for Docker-based builds but probably isn't required
1676 // in the VM anymore, since the buildlet probably already has this in its environment.
1677 // (It was required because without cgo, it couldn't find the username)
1678 "USER=root",
1679 },
1680 })
1681 addBuilder(BuildConfig{
Brad Fitzpatrickb8db43d2019-03-11 04:20:46 +00001682 Name: "linux-amd64-noopt",
1683 Notes: "optimizations and inlining disabled",
Carlos Amedee701f7172021-08-19 13:27:43 -04001684 HostType: "host-linux-bullseye",
Brad Fitzpatrickb8db43d2019-03-11 04:20:46 +00001685 buildsRepo: onlyGo,
Brad Fitzpatrickd7985a82019-03-06 05:20:12 +00001686 env: []string{
Brad Fitzpatrick136868b2019-08-29 18:28:01 +00001687 "GO_DISABLE_OUTBOUND_NETWORK=1",
Brad Fitzpatrickd7985a82019-03-06 05:20:12 +00001688 "GO_GCFLAGS=-N -l",
1689 },
Brad Fitzpatrick50ba0cb2015-01-27 14:22:21 -08001690 })
1691 addBuilder(BuildConfig{
Brad Fitzpatrickde72d462016-05-04 17:47:12 +00001692 Name: "linux-amd64-ssacheck",
Carlos Amedee701f7172021-08-19 13:27:43 -04001693 HostType: "host-linux-bullseye",
Brad Fitzpatrickb8db43d2019-03-11 04:20:46 +00001694 buildsRepo: onlyGo,
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00001695 tryBot: nil, // TODO: add a func to conditionally run this trybot if compiler dirs are touched
Brad Fitzpatrickde72d462016-05-04 17:47:12 +00001696 CompileOnly: true,
1697 Notes: "SSA internal checks enabled",
Brad Fitzpatrickd7985a82019-03-06 05:20:12 +00001698 env: []string{
Brad Fitzpatrick136868b2019-08-29 18:28:01 +00001699 "GO_DISABLE_OUTBOUND_NETWORK=1",
Brad Fitzpatrickd7985a82019-03-06 05:20:12 +00001700 "GO_GCFLAGS=-d=ssa/check/on,dclstack",
1701 },
Brad Fitzpatrickbd4de1f2017-05-19 21:23:14 +00001702 GoDeps: []string{
1703 "f65abf6ddc8d1f3d403a9195fd74eaffa022b07f", // adds dclstack
1704 },
Keith Randalla04c8132016-03-18 15:30:38 -07001705 })
1706 addBuilder(BuildConfig{
Dmitri Shuralyovc0707032020-04-08 12:13:38 -04001707 Name: "linux-amd64-staticlockranking",
1708 HostType: "host-linux-stretch",
1709 Notes: "builder with GOEXPERIMENT=staticlockranking, see golang.org/issue/37937",
Dmitri Shuralyov77c96bb2020-03-19 10:34:11 -04001710 buildsRepo: func(repo, branch, goBranch string) bool {
1711 return repo == "go" && atLeastGo1(goBranch, 15)
1712 },
1713 env: []string{
1714 "GO_DISABLE_OUTBOUND_NETWORK=1",
1715 "GOEXPERIMENT=staticlockranking",
1716 },
1717 GoDeps: []string{
1718 "02057906f7272a4787b8a0b5b7cafff8ad3024f0", // A master commit from 2020/03/19, just before CL 222925 and CL 207619 have landed.
1719 },
1720 })
1721 addBuilder(BuildConfig{
Matthew Dempskydf58bba2021-06-16 23:08:22 -07001722 Name: "linux-amd64-unified",
1723 HostType: "host-linux-buster",
1724 Notes: "builder with GOEXPERIMENT=unified, see golang.org/issue/46786",
1725 tryBot: func(repo, branch, goBranch string) bool {
Matthew Dempsky4f8007b2021-08-12 15:11:41 -07001726 return (repo == "go" || repo == "tools") && (goBranch == "master" || goBranch == "dev.typeparams")
Matthew Dempskydf58bba2021-06-16 23:08:22 -07001727 },
1728 buildsRepo: func(repo, branch, goBranch string) bool {
Matthew Dempsky4f8007b2021-08-12 15:11:41 -07001729 return (repo == "go" || repo == "tools") && (goBranch == "master" || goBranch == "dev.typeparams")
Matthew Dempskydf58bba2021-06-16 23:08:22 -07001730 },
1731 env: []string{
1732 "GO_DISABLE_OUTBOUND_NETWORK=1",
1733 "GOEXPERIMENT=unified",
1734 },
1735 GoDeps: []string{
1736 "804ecc2581caf33ae347d6a1ce67436d1f74e93b", // CL 328215, which added GOEXPERIMENT=unified on dev.typeparams
1737 },
1738 numTestHelpers: 1,
1739 numTryTestHelpers: 4,
1740 })
1741 addBuilder(BuildConfig{
Brad Fitzpatrickbfca87f2017-04-21 23:41:12 +00001742 Name: "linux-amd64-racecompile",
Carlos Amedee701f7172021-08-19 13:27:43 -04001743 HostType: "host-linux-bullseye",
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00001744 tryBot: nil, // TODO: add a func to conditionally run this trybot if compiler dirs are touched
Brad Fitzpatrickbfca87f2017-04-21 23:41:12 +00001745 CompileOnly: true,
Brad Fitzpatrick4f5eef02017-04-24 21:14:05 +00001746 SkipSnapshot: true,
1747 StopAfterMake: true,
Cherry Zhang2ea12c12020-03-30 11:20:59 -04001748 InstallRacePackages: []string{"cmd/compile", "cmd/link"},
1749 Notes: "race-enabled cmd/compile and cmd/link",
Brad Fitzpatrickd7985a82019-03-06 05:20:12 +00001750 env: []string{
Brad Fitzpatrick136868b2019-08-29 18:28:01 +00001751 "GO_DISABLE_OUTBOUND_NETWORK=1",
Brad Fitzpatrickd7985a82019-03-06 05:20:12 +00001752 },
Brad Fitzpatrickbd4de1f2017-05-19 21:23:14 +00001753 GoDeps: []string{
1754 "22f1b56dab29d397d2bdbdd603d85e60fb678089", // adds cmd/compile -c; Issue 20222
1755 },
Brad Fitzpatrickbfca87f2017-04-21 23:41:12 +00001756 })
1757 addBuilder(BuildConfig{
Brad Fitzpatrick94d01412016-09-13 22:45:48 +00001758 Name: "linux-amd64-race",
Carlos Amedee701f7172021-08-19 13:27:43 -04001759 HostType: "host-linux-bullseye",
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00001760 tryBot: defaultTrySet(),
Brad Fitzpatrickc8ca9622019-12-07 05:14:28 +00001761 buildsRepo: defaultPlusExpBuild,
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001762 distTestAdjust: fasterTrybots,
Brad Fitzpatrick6ae87502018-05-04 02:42:17 +00001763 numTestHelpers: 1,
Brad Fitzpatrick94d01412016-09-13 22:45:48 +00001764 numTryTestHelpers: 5,
Brad Fitzpatrickd7985a82019-03-06 05:20:12 +00001765 env: []string{
Brad Fitzpatrick136868b2019-08-29 18:28:01 +00001766 "GO_DISABLE_OUTBOUND_NETWORK=1",
Brad Fitzpatrickd7985a82019-03-06 05:20:12 +00001767 },
Brad Fitzpatrick32d05202015-01-21 15:15:48 -08001768 })
1769 addBuilder(BuildConfig{
Brad Fitzpatrick13560662019-11-14 15:43:33 +00001770 Name: "linux-386-clang",
1771 HostType: "host-linux-clang",
1772 Notes: "Debian jessie + clang 3.9 instead of gcc",
1773 env: []string{"CC=/usr/bin/clang", "GOHOSTARCH=386"},
Brad Fitzpatricka0a155e2015-02-12 19:45:02 -08001774 })
1775 addBuilder(BuildConfig{
Brad Fitzpatrick13560662019-11-14 15:43:33 +00001776 Name: "linux-amd64-clang",
1777 HostType: "host-linux-clang",
1778 Notes: "Debian jessie + clang 3.9 instead of gcc",
1779 env: []string{"CC=/usr/bin/clang"},
Brad Fitzpatricka0a155e2015-02-12 19:45:02 -08001780 })
1781 addBuilder(BuildConfig{
Brad Fitzpatrick13560662019-11-14 15:43:33 +00001782 Name: "linux-386-sid",
1783 HostType: "host-linux-sid",
1784 Notes: "Debian sid (unstable)",
1785 env: []string{"GOHOSTARCH=386"},
Brad Fitzpatrickf0728e32015-02-13 19:01:32 -08001786 })
1787 addBuilder(BuildConfig{
Brad Fitzpatrick13560662019-11-14 15:43:33 +00001788 Name: "linux-amd64-sid",
1789 HostType: "host-linux-sid",
1790 Notes: "Debian sid (unstable)",
Brad Fitzpatrickf0728e32015-02-13 19:01:32 -08001791 })
1792 addBuilder(BuildConfig{
Brad Fitzpatrick13560662019-11-14 15:43:33 +00001793 Name: "linux-amd64-fedora",
1794 HostType: "host-linux-fedora",
1795 Notes: "Fedora",
Brad Fitzpatrick07bb1292019-05-08 16:25:38 +00001796 })
1797 addBuilder(BuildConfig{
Brad Fitzpatrick2c2d26c2019-03-01 16:54:25 +00001798 Name: "linux-amd64-androidemu",
1799 HostType: "host-android-amd64-emu",
1800 env: []string{
1801 "GOARCH=amd64",
1802 "GOOS=linux",
1803 "CGO_ENABLED=1",
Brad Fitzpatrick136868b2019-08-29 18:28:01 +00001804 "GO_DISABLE_OUTBOUND_NETWORK=1",
Brad Fitzpatrick2c2d26c2019-03-01 16:54:25 +00001805 },
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001806 tryBot: func(repo, branch, goBranch string) bool {
Brad Fitzpatrick2c2d26c2019-03-01 16:54:25 +00001807 // Only for mobile repo for now, not "go":
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001808 return repo == "mobile" && branch == "master" && goBranch == "master"
Brad Fitzpatrick2c2d26c2019-03-01 16:54:25 +00001809 },
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001810 buildsRepo: func(repo, branch, goBranch string) bool {
1811 return repo == "mobile" && branch == "master" && goBranch == "master"
Brad Fitzpatrick2c2d26c2019-03-01 16:54:25 +00001812 },
1813 Notes: "Runs GOOS=linux but with the Android emulator attached, for running x/mobile host tests.",
1814 })
1815 addBuilder(BuildConfig{
Brad Fitzpatrick13560662019-11-14 15:43:33 +00001816 Name: "linux-amd64-jessie",
1817 HostType: "host-linux-jessie",
Carlos Amedee701f7172021-08-19 13:27:43 -04001818 Notes: "Debian Jessie.",
Brad Fitzpatrickd7985a82019-03-06 05:20:12 +00001819 env: []string{
Brad Fitzpatrick136868b2019-08-29 18:28:01 +00001820 "GO_DISABLE_OUTBOUND_NETWORK=1",
Brad Fitzpatrickd7985a82019-03-06 05:20:12 +00001821 },
Brad Fitzpatrickade28622018-05-14 17:22:45 +00001822 })
1823 addBuilder(BuildConfig{
Dmitri Shuralyov90d5e7c2020-12-07 22:31:50 -05001824 Name: "linux-amd64-stretch",
1825 HostType: "host-linux-stretch",
1826 Notes: "Debian Stretch. Same as the normal 'linux-amd64' builder at this time, but with -stretch suffix. Used for release builds.",
1827 buildsRepo: disabledBuilder, // Disabled because the "linux-amd64" builder does identical work.
1828 env: []string{
1829 "GO_DISABLE_OUTBOUND_NETWORK=1",
1830 },
1831 })
1832 addBuilder(BuildConfig{
Carlos Amedee43864932021-08-16 15:35:39 -04001833 Name: "linux-amd64-bullseye",
1834 HostType: "host-linux-bullseye",
1835 Notes: "Debian Bullseye.",
1836 env: []string{
1837 "GO_DISABLE_OUTBOUND_NETWORK=1",
1838 },
1839 })
1840 addBuilder(BuildConfig{
Carlos Amedee81f4b092020-11-02 15:11:10 -05001841 Name: "linux-amd64-buster",
1842 HostType: "host-linux-buster",
1843 Notes: "Debian Buster.",
1844 env: []string{
1845 "GO_DISABLE_OUTBOUND_NETWORK=1",
1846 },
Carlos Amedee81f4b092020-11-02 15:11:10 -05001847 })
1848 addBuilder(BuildConfig{
Carlos Amedee23650a92021-08-18 17:45:09 -04001849 Name: "linux-386-jessie",
1850 HostType: "host-linux-jessie",
1851 Notes: "Debian Jessie, 32-bit builder.",
Dmitri Shuralyov90d5e7c2020-12-07 22:31:50 -05001852 env: []string{
1853 "GOARCH=386",
1854 "GOHOSTARCH=386",
1855 "GO_DISABLE_OUTBOUND_NETWORK=1",
1856 },
1857 })
1858 addBuilder(BuildConfig{
1859 Name: "linux-386-stretch",
1860 HostType: "host-linux-stretch",
1861 Notes: "Debian Stretch, 32-bit builder.",
1862 env: []string{
1863 "GOARCH=386",
1864 "GOHOSTARCH=386",
1865 "GO_DISABLE_OUTBOUND_NETWORK=1",
1866 },
1867 })
1868 addBuilder(BuildConfig{
Carlos Amedee23650a92021-08-18 17:45:09 -04001869 Name: "linux-386-buster",
1870 HostType: "host-linux-buster",
1871 Notes: "Debian Buster, 32-bit builder.",
1872 env: []string{
1873 "GOARCH=386",
1874 "GOHOSTARCH=386",
1875 "GO_DISABLE_OUTBOUND_NETWORK=1",
1876 },
1877 })
1878 addBuilder(BuildConfig{
Brad Fitzpatrick13560662019-11-14 15:43:33 +00001879 Name: "linux-amd64-longtest",
1880 HostType: "host-linux-stretch-morecpu",
1881 Notes: "Debian Stretch with go test -short=false",
Dmitri Shuralyov5a8fb632020-05-26 18:19:05 -04001882 tryBot: func(repo, branch, goBranch string) bool {
1883 onReleaseBranch := strings.HasPrefix(branch, "release-branch.")
1884 return repo == "go" && onReleaseBranch // See issue 37827.
1885 },
Brad Fitzpatrick86650282019-03-11 18:49:56 +00001886 buildsRepo: func(repo, branch, goBranch string) bool {
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04001887 // Test all repos, ignoring buildRepoByDefault.
1888 // For golang.org/x repos, don't test non-latest versions.
Brad Fitzpatrick86650282019-03-11 18:49:56 +00001889 return repo == "go" || (branch == "master" && goBranch == "master")
1890 },
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00001891 needsGoProxy: true, // for cmd/go module tests
Alberto Donizettie7d3cfb2018-05-29 21:03:23 +02001892 env: []string{
Brad Fitzpatrick61ce0be2019-03-14 16:06:57 +00001893 "GO_TEST_TIMEOUT_SCALE=5", // give them lots of time
Alberto Donizettie7d3cfb2018-05-29 21:03:23 +02001894 },
Dmitri Shuralyov7d700e02020-12-21 14:42:00 -05001895 numTryTestHelpers: 4, // Target time is < 15 min for golang.org/issue/42661.
Brad Fitzpatrick65a9d982018-05-16 19:50:39 +00001896 })
1897 addBuilder(BuildConfig{
Brad Fitzpatrick13560662019-11-14 15:43:33 +00001898 Name: "linux-386-longtest",
1899 HostType: "host-linux-stretch-morecpu",
1900 Notes: "Debian Stretch with go test -short=false; to get 32-bit coverage",
Dmitri Shuralyov5a8fb632020-05-26 18:19:05 -04001901 tryBot: func(repo, branch, goBranch string) bool {
1902 onReleaseBranch := strings.HasPrefix(branch, "release-branch.")
1903 return repo == "go" && onReleaseBranch // See issue 37827.
1904 },
Brad Fitzpatrick70a7cc82019-10-21 16:58:47 +00001905 buildsRepo: func(repo, branch, goBranch string) bool {
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04001906 b := buildRepoByDefault(repo)
1907 if repo != "go" && !(branch == "master" && goBranch == "master") {
1908 // For golang.org/x repos, don't test non-latest versions.
1909 b = false
Brad Fitzpatrickf6d512d2019-12-12 17:43:59 +00001910 }
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04001911 return b
Brad Fitzpatrick70a7cc82019-10-21 16:58:47 +00001912 },
1913 needsGoProxy: true, // for cmd/go module tests
1914 env: []string{
Dmitri Shuralyovbe58d062020-05-18 19:34:15 -04001915 "GOARCH=386",
1916 "GOHOSTARCH=386",
Brad Fitzpatrick70a7cc82019-10-21 16:58:47 +00001917 "GO_TEST_TIMEOUT_SCALE=5", // give them lots of time
1918 },
Dmitri Shuralyov7d700e02020-12-21 14:42:00 -05001919 numTryTestHelpers: 4, // Target time is < 15 min for golang.org/issue/42661.
Brad Fitzpatrick70a7cc82019-10-21 16:58:47 +00001920 })
1921 addBuilder(BuildConfig{
Brad Fitzpatrickcd2ea432018-06-28 20:30:35 +00001922 Name: "js-wasm",
1923 HostType: "host-js-wasm",
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00001924 tryBot: explicitTrySet("go"),
Brad Fitzpatrickb8db43d2019-03-11 04:20:46 +00001925 buildsRepo: func(repo, branch, goBranch string) bool {
Brad Fitzpatrick86650282019-03-11 18:49:56 +00001926 switch repo {
1927 case "go":
1928 return true
Brad Fitzpatrickf6d512d2019-12-12 17:43:59 +00001929 case "build", "mobile", "exp", "benchmarks", "debug", "perf", "talks", "tools", "tour", "website":
Brad Fitzpatrick86650282019-03-11 18:49:56 +00001930 return false
1931 default:
1932 return branch == "master" && goBranch == "master"
1933 }
Brad Fitzpatrickb8db43d2019-03-11 04:20:46 +00001934 },
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04001935 distTestAdjust: func(run bool, distTest string, isNormalTry bool) bool {
1936 if isNormalTry {
Brad Fitzpatrickcd2ea432018-06-28 20:30:35 +00001937 if strings.Contains(distTest, "/internal/") ||
1938 strings.Contains(distTest, "vendor/golang.org/x/arch") {
1939 return false
1940 }
1941 switch distTest {
Dmitri Shuralyov3f45b3b2021-08-31 17:45:43 -04001942 case "cmd/go", "nolibgcc:crypto/x509", "reboot":
Brad Fitzpatrickcd2ea432018-06-28 20:30:35 +00001943 return false
1944 }
Brad Fitzpatrickcd2ea432018-06-28 20:30:35 +00001945 }
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001946 return run
Brad Fitzpatrickcd2ea432018-06-28 20:30:35 +00001947 },
Brad Fitzpatricked99f862019-10-10 19:09:40 +00001948 numTryTestHelpers: 5,
Brad Fitzpatrick4b011fe2018-05-11 05:54:32 +00001949 env: []string{
1950 "GOOS=js", "GOARCH=wasm", "GOHOSTOS=linux", "GOHOSTARCH=amd64",
1951 "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/workdir/go/misc/wasm",
Brad Fitzpatrick136868b2019-08-29 18:28:01 +00001952 "GO_DISABLE_OUTBOUND_NETWORK=1",
Brad Fitzpatrick4b011fe2018-05-11 05:54:32 +00001953 },
1954 })
1955 addBuilder(BuildConfig{
Dmitri Shuralyov01e47d92020-12-21 14:12:25 -05001956 Name: "openbsd-amd64-64",
1957 HostType: "host-openbsd-amd64-64",
1958 MinimumGoVersion: types.MajorMinor{1, 11},
1959 distTestAdjust: noTestDirAndNoReboot,
Dmitri Shuralyova5d30732018-10-04 18:14:50 -04001960 })
1961 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001962 Name: "openbsd-386-64",
1963 HostType: "host-openbsd-386-64",
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001964 distTestAdjust: noTestDirAndNoReboot,
Dmitri Shuralyova5d30732018-10-04 18:14:50 -04001965 })
Joel Sing23861f92019-08-31 03:09:05 +10001966 addBuilder(BuildConfig{
Dmitri Shuralyov0a4bf692020-12-23 13:33:19 -05001967 Name: "openbsd-amd64-68",
1968 HostType: "host-openbsd-amd64-68",
1969 tryBot: defaultTrySet(),
1970 distTestAdjust: noTestDirAndNoReboot,
1971 numTryTestHelpers: 4,
Dmitri Shuralyov3a574da2020-11-12 12:27:32 -05001972 })
1973 addBuilder(BuildConfig{
Dmitri Shuralyov01e47d92020-12-21 14:12:25 -05001974 Name: "openbsd-386-68",
1975 HostType: "host-openbsd-386-68",
1976 tryBot: explicitTrySet("sys"),
1977 distTestAdjust: noTestDirAndNoReboot,
1978 numTryTestHelpers: 4,
Dmitri Shuralyov3a574da2020-11-12 12:27:32 -05001979 })
1980 addBuilder(BuildConfig{
Joel Sing6a8b9e12020-04-17 01:47:53 +10001981 Name: "openbsd-arm-jsing",
1982 HostType: "host-openbsd-arm-joelsing",
1983 SkipSnapshot: true,
1984 buildsRepo: func(repo, branch, goBranch string) bool {
1985 switch repo {
1986 case "go", "net", "sys":
1987 return branch == "master" && goBranch == "master"
1988 default:
1989 return false
1990 }
1991 },
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04001992 distTestAdjust: noTestDirAndNoReboot,
1993 tryBot: nil,
Joel Sing23861f92019-08-31 03:09:05 +10001994 env: []string{
1995 // The machine is slow.
1996 "GO_TEST_TIMEOUT_SCALE=5",
1997 },
1998 })
Dmitri Shuralyova5d30732018-10-04 18:14:50 -04001999 addBuilder(BuildConfig{
Joel Singb91348e2020-08-21 04:42:01 +10002000 Name: "openbsd-arm64-jsing",
2001 HostType: "host-openbsd-arm64-joelsing",
2002 SkipSnapshot: true,
2003 buildsRepo: func(repo, branch, goBranch string) bool {
2004 switch repo {
2005 case "go", "net", "sys":
2006 return branch == "master" && goBranch == "master"
2007 default:
2008 return false
2009 }
2010 },
2011 distTestAdjust: noTestDirAndNoReboot,
2012 tryBot: nil,
2013 env: []string{
2014 // The machine is slow.
2015 "GO_TEST_TIMEOUT_SCALE=5",
2016 },
2017 })
2018 addBuilder(BuildConfig{
Joel Sing18a54c62020-08-24 02:02:40 +10002019 Name: "openbsd-mips64-jsing",
2020 HostType: "host-openbsd-mips64-joelsing",
2021 SkipSnapshot: true,
Joel Sing18a54c62020-08-24 02:02:40 +10002022 buildsRepo: func(repo, branch, goBranch string) bool {
2023 switch repo {
2024 case "go", "net", "sys":
2025 return branch == "master" && goBranch == "master"
2026 default:
2027 return false
2028 }
2029 },
2030 distTestAdjust: noTestDirAndNoReboot,
2031 tryBot: nil,
2032 env: []string{
2033 // The machine is slow.
2034 "GO_TEST_TIMEOUT_SCALE=5",
2035 },
2036 })
2037 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002038 Name: "netbsd-amd64-9_0",
2039 HostType: "host-netbsd-amd64-9_0",
2040 distTestAdjust: noTestDirAndNoReboot,
2041 tryBot: explicitTrySet("sys"),
Dmitri Shuralyov219acbf2020-04-02 08:55:30 -04002042 })
2043 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002044 Name: "netbsd-386-9_0",
2045 HostType: "host-netbsd-386-9_0",
2046 distTestAdjust: noTestDirAndNoReboot,
Dmitri Shuralyov219acbf2020-04-02 08:55:30 -04002047 })
2048 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002049 Name: "netbsd-arm-bsiegert",
2050 HostType: "host-netbsd-arm-bsiegert",
2051 distTestAdjust: noTestDirAndNoReboot,
2052 tryBot: nil,
Benny Siegertebee6e92019-03-19 14:28:04 +01002053 env: []string{
2054 // The machine is slow.
2055 "GO_TEST_TIMEOUT_SCALE=10",
2056 },
2057 })
2058 addBuilder(BuildConfig{
Tobias Klauserda0cd802020-09-28 10:28:32 +02002059 Name: "netbsd-arm64-bsiegert",
2060 HostType: "host-netbsd-arm64-bsiegert",
2061 buildsRepo: func(repo, branch, goBranch string) bool {
2062 return atLeastGo1(goBranch, 16) && buildRepoByDefault(repo)
2063 },
Benny Siegert7c9f64d2020-08-18 20:42:30 +02002064 distTestAdjust: noTestDirAndNoReboot,
2065 tryBot: nil,
2066 env: []string{
2067 // The machine is slow.
2068 "GO_TEST_TIMEOUT_SCALE=10",
2069 },
2070 })
2071 addBuilder(BuildConfig{
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00002072 Name: "plan9-386",
2073 HostType: "host-plan9-386-gce",
Brad Fitzpatrickf7a5fcf2019-04-03 05:03:37 +00002074 numTestHelpers: 1,
Brad Fitzpatrick67073b92019-04-18 19:33:19 +00002075 tryOnly: true, // disable it for now; Issue 31261, Issue 29801
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04002076 distTestAdjust: func(run bool, distTest string, isNormalTry bool) bool {
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002077 switch distTest {
Brad Fitzpatricka865ae32019-01-18 22:19:58 +00002078 case "api",
2079 "go_test:cmd/go": // takes over 20 minutes without working SMP
2080 return false
2081 }
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002082 return run
Brad Fitzpatricka865ae32019-01-18 22:19:58 +00002083 },
Tobias Klauser22d3b242019-11-28 11:33:00 +01002084 buildsRepo: onlyMasterDefault,
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -08002085 })
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -08002086 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002087 Name: "windows-amd64-2008",
2088 HostType: "host-windows-amd64-2008",
2089 distTestAdjust: noTestDirAndNoReboot,
2090 buildsRepo: onlyGo,
Andrew Bonventreccab5db2018-04-30 17:16:33 -04002091 env: []string{
2092 "GOARCH=amd64",
2093 "GOHOSTARCH=amd64",
2094 // cmd/go takes ~188 seconds on windows-amd64
2095 // now, which is over the 180 second default
2096 // dist test timeout. So, bump this builder
2097 // up:
2098 "GO_TEST_TIMEOUT_SCALE=2",
2099 },
Brad Fitzpatrick97a4f812017-04-24 20:32:02 +00002100 })
2101 addBuilder(BuildConfig{
Jeff Johnsonf8afd1d2017-04-27 13:12:08 -07002102 Name: "windows-386-2008",
2103 HostType: "host-windows-amd64-2008",
Brad Fitzpatrickc8ca9622019-12-07 05:14:28 +00002104 buildsRepo: defaultPlusExpBuild,
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002105 distTestAdjust: fasterTrybots,
Jeff Johnsonf8afd1d2017-04-27 13:12:08 -07002106 env: []string{"GOARCH=386", "GOHOSTARCH=386"},
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00002107 tryBot: defaultTrySet(),
Brad Fitzpatrick7b0a9982017-12-07 00:40:40 +00002108 numTryTestHelpers: 4,
Jeff Johnsonf8afd1d2017-04-27 13:12:08 -07002109 })
2110 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002111 Name: "windows-amd64-2012",
2112 HostType: "host-windows-amd64-2012",
2113 distTestAdjust: noTestDirAndNoReboot,
2114 buildsRepo: onlyGo,
Andrew Bonventreccab5db2018-04-30 17:16:33 -04002115 env: []string{
2116 "GOARCH=amd64",
2117 "GOHOSTARCH=amd64",
2118 // cmd/go takes ~188 seconds on windows-amd64
2119 // now, which is over the 180 second default
2120 // dist test timeout. So, bump this builder
2121 // up:
2122 "GO_TEST_TIMEOUT_SCALE=2",
2123 },
Brad Fitzpatrick97a4f812017-04-24 20:32:02 +00002124 })
2125 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002126 Name: "windows-amd64-2016",
2127 HostType: "host-windows-amd64-2016",
2128 buildsRepo: defaultPlusExpBuild,
2129 distTestAdjust: fasterTrybots,
Andrew Bonventreccab5db2018-04-30 17:16:33 -04002130 env: []string{
2131 "GOARCH=amd64",
2132 "GOHOSTARCH=amd64",
2133 // cmd/go takes ~188 seconds on windows-amd64
2134 // now, which is over the 180 second default
2135 // dist test timeout. So, bump this builder
2136 // up:
2137 "GO_TEST_TIMEOUT_SCALE=2",
2138 },
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00002139 tryBot: defaultTrySet(),
Brad Fitzpatrick9251bc92017-07-27 04:52:12 +00002140 numTryTestHelpers: 5,
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -08002141 })
2142 addBuilder(BuildConfig{
Brad Fitzpatrick13560662019-11-14 15:43:33 +00002143 Name: "windows-amd64-longtest",
Dmitri Shuralyov99393002019-11-22 18:01:25 -05002144 HostType: "host-windows-amd64-2016-big",
Brad Fitzpatrick13560662019-11-14 15:43:33 +00002145 Notes: "Windows Server 2016 with go test -short=false",
Dmitri Shuralyov5a8fb632020-05-26 18:19:05 -04002146 tryBot: func(repo, branch, goBranch string) bool {
2147 onReleaseBranch := strings.HasPrefix(branch, "release-branch.")
2148 return repo == "go" && onReleaseBranch // See issue 37827.
2149 },
Brad Fitzpatrick70a7cc82019-10-21 16:58:47 +00002150 buildsRepo: func(repo, branch, goBranch string) bool {
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04002151 b := defaultPlusExpBuild(repo, branch, goBranch)
2152 if repo != "go" && !(branch == "master" && goBranch == "master") {
2153 // For golang.org/x repos, don't test non-latest versions.
2154 b = false
Brad Fitzpatrickf9c537e2019-10-28 20:16:36 +00002155 }
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04002156 return b
Brad Fitzpatrick70a7cc82019-10-21 16:58:47 +00002157 },
2158 needsGoProxy: true, // for cmd/go module tests
2159 env: []string{
Brad Fitzpatrick70a7cc82019-10-21 16:58:47 +00002160 "GO_TEST_TIMEOUT_SCALE=5", // give them lots of time
2161 },
Dmitri Shuralyov7d700e02020-12-21 14:42:00 -05002162 numTryTestHelpers: 4, // Target time is < 15 min for golang.org/issue/42661.
Brad Fitzpatrick70a7cc82019-10-21 16:58:47 +00002163 })
2164 addBuilder(BuildConfig{
Brad Fitzpatrick86650282019-03-11 18:49:56 +00002165 Name: "windows-amd64-race",
Dmitri Shuralyov6afe8a22020-05-27 11:58:11 -04002166 HostType: "host-windows-amd64-2016-big",
Brad Fitzpatrick86650282019-03-11 18:49:56 +00002167 Notes: "Only runs -race tests (./race.bat)",
Andrew Bonventreccab5db2018-04-30 17:16:33 -04002168 env: []string{
2169 "GOARCH=amd64",
2170 "GOHOSTARCH=amd64",
2171 // cmd/go takes ~188 seconds on windows-amd64
2172 // now, which is over the 180 second default
2173 // dist test timeout. So, bump this builder
2174 // up:
2175 "GO_TEST_TIMEOUT_SCALE=2"},
Brad Fitzpatrickcc587d42015-02-06 17:32:15 -08002176 })
2177 addBuilder(BuildConfig{
Jason A. Donenfeld9bcb0832020-11-28 15:02:05 +01002178 Name: "windows-arm-zx2c4",
2179 HostType: "host-windows-arm64-zx2c4",
Jason A. Donenfeld5d75ed72020-11-20 18:35:33 +01002180 env: []string{
2181 "GOARM=7",
Jason A. Donenfeldb6220de2020-12-01 20:06:23 +01002182 "GO_TEST_TIMEOUT_SCALE=3"},
Jason A. Donenfeld5d75ed72020-11-20 18:35:33 +01002183 })
2184 addBuilder(BuildConfig{
Alexander Rakoczy666c18f2021-06-15 16:42:51 -04002185 Name: "windows-arm64-10",
2186 HostType: "host-windows-arm64-mini",
2187 numTryTestHelpers: 1,
2188 buildsRepo: func(repo, branch, goBranch string) bool {
2189 return atLeastGo1(goBranch, 17) && buildRepoByDefault(repo)
2190 },
Alexander Rakoczy3a6c4f32021-08-25 15:50:51 -04002191 env: []string{
2192 "GOARCH=arm64",
Alexander Rakoczy3a6c4f32021-08-25 15:50:51 -04002193 },
2194 })
2195 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002196 Name: "darwin-amd64-10_12",
2197 HostType: "host-darwin-10_12",
2198 distTestAdjust: macTestPolicy,
Carlos Amedee6469a762021-04-22 13:51:16 -04002199 buildsRepo: func(repo, branch, goBranch string) bool {
2200 // macOS 10.12 not supported after Go 1.16
2201 return atMostGo1(goBranch, 16) && buildRepoByDefault(repo)
2202 },
Brad Fitzpatrick7b0a9982017-12-07 00:40:40 +00002203 })
2204 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002205 Name: "darwin-amd64-10_14",
2206 HostType: "host-darwin-10_14",
2207 distTestAdjust: macTestPolicy,
2208 buildsRepo: defaultPlusExp,
Brad Fitzpatrick8bd8e0e2019-03-26 23:04:31 +00002209 })
2210 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002211 Name: "darwin-amd64-10_15",
2212 HostType: "host-darwin-10_15",
2213 distTestAdjust: macTestPolicy,
2214 buildsRepo: defaultPlusExpBuild,
Carlos Amedeed6dec9c2019-11-19 14:55:01 +00002215 })
2216 addBuilder(BuildConfig{
Carlos Amedeed576fd32021-01-29 15:47:13 -05002217 Name: "darwin-amd64-11_0",
2218 HostType: "host-darwin-amd64-11_0",
2219 distTestAdjust: macTestPolicy,
2220 buildsRepo: defaultPlusExpBuild,
Carlos Amedeed576fd32021-01-29 15:47:13 -05002221 })
2222 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002223 Name: "darwin-amd64-nocgo",
2224 HostType: "host-darwin-10_15",
2225 distTestAdjust: noTestDirAndNoReboot,
2226 env: []string{"CGO_ENABLED=0"},
Brad Fitzpatrickfcf7a582019-04-30 22:37:31 +00002227 })
2228 addBuilder(BuildConfig{
Alexander Rakoczy9ad13ba2020-12-15 12:58:50 -05002229 Name: "darwin-arm64-11_0-toothrot",
2230 HostType: "host-darwin-arm64-11_0-toothrot",
2231 distTestAdjust: macTestPolicy,
2232 buildsRepo: func(repo, branch, goBranch string) bool {
2233 // Darwin ARM64 added in Go 1.16.
2234 return atLeastGo1(goBranch, 16) && defaultPlusExpBuild(repo, branch, goBranch)
2235 },
Alexander Rakoczy9ad13ba2020-12-15 12:58:50 -05002236 })
2237 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002238 Name: "darwin-amd64-race",
2239 HostType: "host-darwin-10_15",
2240 distTestAdjust: macTestPolicy,
2241 buildsRepo: onlyGo,
Brad Fitzpatrick409147c2017-01-18 22:45:12 +00002242 })
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00002243 addBuilder(BuildConfig{
Elias Naur18919d62020-10-03 11:37:07 +02002244 Name: "ios-arm64-corellium",
2245 HostType: "host-ios-arm64-corellium-ios",
Elias Naur6bebc8e2019-05-01 20:33:26 +02002246 Notes: "Virtual iPhone SE running on Corellium; owned by zenly",
2247 buildsRepo: func(repo, branch, goBranch string) bool {
2248 return repo == "go" && branch == "master" && goBranch == "master"
2249 },
2250 })
2251 addBuilder(BuildConfig{
Elias Naur4d0f77a2019-05-01 22:28:43 +02002252 Name: "android-arm64-corellium",
2253 HostType: "host-android-arm64-corellium-android",
2254 Notes: "Virtual Android running on Corellium; owned by zenly",
2255 buildsRepo: func(repo, branch, goBranch string) bool {
2256 return repo == "go" && branch == "master" && goBranch == "master"
2257 },
2258 })
2259 addBuilder(BuildConfig{
Elias Naur7ae75392019-05-02 00:54:54 +02002260 Name: "android-arm-corellium",
2261 HostType: "host-android-arm64-corellium-android",
2262 Notes: "Virtual Android running on Corellium; owned by zenly",
2263 buildsRepo: func(repo, branch, goBranch string) bool {
2264 return repo == "go" && branch == "master" && goBranch == "master"
2265 },
2266 env: []string{
2267 "CGO_ENABLED=1",
Elias Naur7ae75392019-05-02 00:54:54 +02002268 "GOARCH=arm",
2269 },
2270 })
2271 addBuilder(BuildConfig{
Brad Fitzpatrickcfe14ab2019-02-25 20:35:29 +00002272 Name: "android-386-emu",
2273 HostType: "host-android-amd64-emu", // same amd64 host is used for 386 builder
2274 Notes: "Android emulator on GCE",
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00002275 buildsRepo: func(repo, branch, goBranch string) bool {
Brad Fitzpatrick2c2d26c2019-03-01 16:54:25 +00002276 switch repo {
Brad Fitzpatrickf6d512d2019-12-12 17:43:59 +00002277 case "build", "blog", "talks", "review", "tour", "website":
Brad Fitzpatrick2c2d26c2019-03-01 16:54:25 +00002278 return false
2279 }
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00002280 return atLeastGo1(branch, 13) && atLeastGo1(goBranch, 13)
Brad Fitzpatrick2c2d26c2019-03-01 16:54:25 +00002281 },
Brad Fitzpatrickcfe14ab2019-02-25 20:35:29 +00002282 env: []string{
2283 "GOARCH=386",
2284 "GOOS=android",
2285 "GOHOSTARCH=amd64",
2286 "GOHOSTOS=linux",
2287 "CGO_ENABLED=1",
2288 },
2289 })
2290 addBuilder(BuildConfig{
Brad Fitzpatrick4e29d672019-04-18 19:45:32 +00002291 Name: "android-amd64-emu",
2292 HostType: "host-android-amd64-emu",
2293 Notes: "Android emulator on GCE",
2294 numTryTestHelpers: 3,
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00002295 tryBot: func(repo, branch, goBranch string) bool {
Brad Fitzpatrick6d867c82019-04-26 14:04:00 +00002296 switch repo {
2297 case "go", "mobile", "sys", "net", "tools", "crypto", "sync", "text", "time":
2298 return atLeastGo1(branch, 13) && atLeastGo1(goBranch, 13)
2299 }
2300 return false
Brad Fitzpatrick6f511712019-02-28 17:32:45 +00002301 },
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00002302 buildsRepo: func(repo, branch, goBranch string) bool {
Brad Fitzpatrick2c2d26c2019-03-01 16:54:25 +00002303 switch repo {
Brad Fitzpatrickf6d512d2019-12-12 17:43:59 +00002304 case "build", "blog", "talks", "review", "tour", "website":
Brad Fitzpatrick2c2d26c2019-03-01 16:54:25 +00002305 return false
2306 }
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00002307 return atLeastGo1(branch, 13) && atLeastGo1(goBranch, 13)
Brad Fitzpatrick2c2d26c2019-03-01 16:54:25 +00002308 },
Brad Fitzpatrickcfe14ab2019-02-25 20:35:29 +00002309 env: []string{
2310 "GOARCH=amd64",
2311 "GOOS=android",
2312 "GOHOSTARCH=amd64",
2313 "GOHOSTOS=linux",
2314 "CGO_ENABLED=1",
2315 },
2316 })
2317 addBuilder(BuildConfig{
Joshua M. Clulowa022e902019-10-17 01:48:13 -07002318 Name: "illumos-amd64",
2319 HostType: "host-illumos-amd64-jclulow",
2320 MinimumGoVersion: types.MajorMinor{1, 13},
2321 })
2322 addBuilder(BuildConfig{
Shawn Walker-Salas22e055b2017-07-07 13:41:20 -07002323 Name: "solaris-amd64-oraclerel",
2324 HostType: "host-solaris-oracle-amd64-oraclerel",
2325 Notes: "Oracle Solaris release version",
2326 })
2327 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002328 Name: "linux-ppc64-buildlet",
2329 HostType: "host-linux-ppc64-osu",
2330 FlakyNet: true,
2331 distTestAdjust: ppc64DistTestPolicy,
Lynn Boger3a0fcf72021-03-11 13:00:33 -06002332 env: []string{"GO_TEST_TIMEOUT_SCALE=2"}, // see golang.org/issues/44422
Brad Fitzpatrickf8a31062016-10-06 20:30:58 +00002333 })
2334 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002335 Name: "linux-ppc64le-buildlet",
2336 HostType: "host-linux-ppc64le-osu",
2337 FlakyNet: true,
2338 distTestAdjust: ppc64DistTestPolicy,
Lynn Boger3a0fcf72021-03-11 13:00:33 -06002339 env: []string{"GO_TEST_TIMEOUT_SCALE=2"}, // see golang.org/issues/44422
Brad Fitzpatrickc2a36fd2016-03-01 04:49:24 +00002340 })
2341 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002342 Name: "linux-ppc64le-power9osu",
2343 HostType: "host-linux-ppc64le-power9-osu",
2344 FlakyNet: true,
2345 distTestAdjust: ppc64DistTestPolicy,
Lynn Boger3a0fcf72021-03-11 13:00:33 -06002346 env: []string{"GO_TEST_TIMEOUT_SCALE=2"}, // see golang.org/issues/44422
Carlos Eduardo Seo202164e2019-02-25 17:05:12 -03002347 })
2348 addBuilder(BuildConfig{
Brad Fitzpatrickad0e3fb2017-04-06 22:16:28 +00002349 Name: "linux-arm64-packet",
2350 HostType: "host-linux-arm64-packet",
Brad Fitzpatrick8fa933c2019-03-07 05:16:49 +00002351 FlakyNet: true, // maybe not flaky, but here conservatively
Brad Fitzpatrickad0e3fb2017-04-06 22:16:28 +00002352 })
2353 addBuilder(BuildConfig{
Carlos Amedee34b0d642021-03-19 14:53:06 -04002354 Name: "linux-arm64-aws",
2355 HostType: "host-linux-arm64-aws",
2356 tryBot: defaultTrySet(),
2357 numTryTestHelpers: 1,
Carlos Amedeed77c6d02020-08-18 13:32:05 -04002358 })
2359 addBuilder(BuildConfig{
Carlos Amedeec1822c72021-03-19 13:54:17 -04002360 Name: "linux-arm-aws",
2361 HostType: "host-linux-arm-aws",
2362 tryBot: defaultTrySet(),
2363 numTryTestHelpers: 1,
Carlos Amedee3bd8f472021-08-05 11:02:29 -04002364 env: []string{
2365 "GOARCH=arm",
2366 "GOARM=6",
2367 "GOHOSTARCH=arm",
2368 },
Carlos Amedeed72655c2020-10-08 16:49:48 -04002369 })
2370 addBuilder(BuildConfig{
Xiaodong Liu5eaa6e02021-09-02 15:51:28 +08002371 HostType: "host-linux-loong64-3a5000",
2372 Name: "linux-loong64-3a5000",
2373 SkipSnapshot: true,
2374 distTestAdjust: loong64DistTestPolicy,
2375 buildsRepo: loong64BuildsRepoPolicy,
2376 env: []string{
2377 "GOARCH=loong64",
2378 "GOHOSTARCH=loong64",
2379 },
2380 KnownIssue: 46229,
2381 })
2382 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002383 FlakyNet: true,
2384 HostType: "host-linux-mipsle-mengzhuo",
2385 Name: "linux-mips64le-mengzhuo",
2386 SkipSnapshot: true,
2387 distTestAdjust: mipsDistTestPolicy,
2388 buildsRepo: mipsBuildsRepoPolicy,
Brad Fitzpatrickf120ea32019-10-29 20:35:07 +00002389 })
2390 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002391 FlakyNet: true,
2392 HostType: "host-linux-mips64le-rtrk",
2393 Name: "linux-mips64le-rtrk",
2394 SkipSnapshot: true,
2395 distTestAdjust: mipsDistTestPolicy,
2396 buildsRepo: mipsBuildsRepoPolicy,
Brad Fitzpatrickf120ea32019-10-29 20:35:07 +00002397 env: []string{
2398 "GOARCH=mips64le",
2399 "GOHOSTARCH=mips64le",
2400 },
2401 })
2402 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002403 FlakyNet: true,
2404 HostType: "host-linux-mips64le-rtrk",
2405 Name: "linux-mipsle-rtrk",
2406 SkipSnapshot: true,
2407 distTestAdjust: mipsDistTestPolicy,
2408 buildsRepo: mipsBuildsRepoPolicy,
Brad Fitzpatrickf120ea32019-10-29 20:35:07 +00002409 env: []string{
2410 "GOARCH=mipsle",
2411 "GOHOSTARCH=mipsle",
2412 },
2413 })
2414 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002415 FlakyNet: true,
2416 HostType: "host-linux-mips64-rtrk",
2417 Name: "linux-mips64-rtrk",
2418 SkipSnapshot: true,
2419 distTestAdjust: mipsDistTestPolicy,
2420 buildsRepo: mipsBuildsRepoPolicy,
Brad Fitzpatrickf120ea32019-10-29 20:35:07 +00002421 env: []string{
2422 "GOARCH=mips64",
2423 "GOHOSTARCH=mips64",
2424 },
2425 })
2426 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002427 FlakyNet: true,
2428 HostType: "host-linux-mips64-rtrk",
2429 Name: "linux-mips-rtrk",
2430 SkipSnapshot: true,
2431 distTestAdjust: mipsDistTestPolicy,
2432 buildsRepo: mipsBuildsRepoPolicy,
Brad Fitzpatrickf120ea32019-10-29 20:35:07 +00002433 env: []string{
2434 "GOARCH=mips",
2435 "GOHOSTARCH=mips",
Meng Zhuo88052792019-09-10 07:21:11 +08002436 },
2437 })
2438 addBuilder(BuildConfig{
Meng Zhuo1b562162021-09-01 15:08:03 +08002439 HostType: "host-linux-riscv64-joelsing",
2440 Name: "linux-riscv64-jsing",
2441 SkipSnapshot: true,
2442 env: []string{"GO_TEST_TIMEOUT_SCALE=4"},
2443 distTestAdjust: riscvDistTestPolicy,
Joel Sing8ea6a2c2020-09-28 04:25:41 +10002444 buildsRepo: func(repo, branch, goBranch string) bool {
2445 switch repo {
2446 case "go", "net", "sys":
2447 return branch == "master" && goBranch == "master"
2448 default:
2449 return false
2450 }
2451 },
2452 })
2453 addBuilder(BuildConfig{
Meng Zhuo1b562162021-09-01 15:08:03 +08002454 HostType: "host-linux-riscv64-unleashed",
2455 Name: "linux-riscv64-unleashed",
2456 SkipSnapshot: true,
2457 env: []string{"GO_TEST_TIMEOUT_SCALE=4"},
2458 distTestAdjust: riscvDistTestPolicy,
Brad Fitzpatrick773364d2019-11-12 06:19:21 +00002459 buildsRepo: func(repo, branch, goBranch string) bool {
2460 switch repo {
2461 case "go", "net", "sys":
2462 return branch == "master" && goBranch == "master"
2463 default:
2464 return false
2465 }
2466 },
2467 })
2468 addBuilder(BuildConfig{
Meng Zhuo1b562162021-09-01 15:08:03 +08002469 HostType: "host-linux-riscv64-unmatched",
2470 Name: "linux-riscv64-unmatched",
2471 env: []string{"GO_TEST_TIMEOUT_SCALE=4"},
2472 FlakyNet: true,
Meng Zhuo1b562162021-09-01 15:08:03 +08002473 buildsRepo: onlyMasterDefault,
2474 distTestAdjust: riscvDistTestPolicy,
Meng Zhuo7fa5d572021-08-27 12:26:14 +08002475 })
2476 addBuilder(BuildConfig{
Brad Fitzpatrickc2a36fd2016-03-01 04:49:24 +00002477 Name: "linux-s390x-ibm",
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00002478 HostType: "host-linux-s390x",
Brad Fitzpatrick94d01412016-09-13 22:45:48 +00002479 numTestHelpers: 0,
Brad Fitzpatrickc2a36fd2016-03-01 04:49:24 +00002480 })
Brad Fitzpatrick30761a02016-04-08 19:40:23 +00002481 addBuilder(BuildConfig{
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00002482 Name: "linux-s390x-crosscompile",
Brad Fitzpatrick76cf9682019-12-04 21:27:28 +00002483 HostType: "host-s390x-cross",
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00002484 Notes: "s390x cross-compile builder for releases; doesn't run tests",
2485 CompileOnly: true,
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00002486 tryOnly: true, // but not in trybot set for now
Brad Fitzpatrick9702f6a2016-08-30 20:32:33 +00002487 env: []string{
Brad Fitzpatrick9702f6a2016-08-30 20:32:33 +00002488 "CGO_ENABLED=1",
2489 "GOARCH=s390x",
2490 "GOHOSTARCH=amd64",
2491 "CC_FOR_TARGET=s390x-linux-gnu-gcc",
2492 },
2493 })
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +00002494 addBuilder(BuildConfig{
2495 Name: "linux-amd64-localdev",
2496 HostType: "host-linux-amd64-localdev",
2497 Notes: "for localhost development only",
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00002498 tryOnly: true,
Brad Fitzpatrick4eceee22017-07-22 19:15:56 +00002499 })
Brad Fitzpatricke47c4472017-08-05 22:56:18 +00002500 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002501 Name: "dragonfly-amd64",
2502 HostType: "host-dragonfly-amd64-master",
2503 Notes: "DragonFly BSD master, run by DragonFly team",
2504 distTestAdjust: noTestDirAndNoReboot,
Antonio Huete Jimenez249a2482021-04-30 13:35:02 +00002505 env: []string{"GO_TEST_TIMEOUT_SCALE=2"}, // see golang.org/issue/45216
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002506 SkipSnapshot: true,
Bryan C. Mills5a2c6112019-08-29 12:37:31 -04002507 buildsRepo: func(repo, branch, goBranch string) bool {
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04002508 return atLeastGo1(goBranch, 14) && buildRepoByDefault(repo)
Bryan C. Mills5a2c6112019-08-29 12:37:31 -04002509 },
Brad Fitzpatricke47c4472017-08-05 22:56:18 +00002510 })
2511 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002512 Name: "freebsd-arm-paulzhol",
2513 HostType: "host-freebsd-arm-paulzhol",
2514 distTestAdjust: noTestDirAndNoReboot,
2515 SkipSnapshot: true,
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00002516 buildsRepo: func(repo, branch, goBranch string) bool {
2517 // This was a fragile little machine with limited memory.
2518 // Only run a few of the core subrepos for now while
2519 // we figure out what's killing it.
2520 switch repo {
2521 case "go", "sys", "net":
2522 return true
2523 }
2524 return false
2525 },
Brad Fitzpatricke47c4472017-08-05 22:56:18 +00002526 env: []string{
2527 "GOARM=7",
2528 "CGO_ENABLED=1",
2529 },
2530 })
Brad Fitzpatrick2446fb32017-08-06 15:57:06 +00002531 addBuilder(BuildConfig{
Dmitri Goutnik39f3d492019-10-03 07:56:19 -05002532 Name: "freebsd-arm64-dmgk",
2533 HostType: "host-freebsd-arm64-dmgk",
Tobias Klauserc0a862a2019-10-25 21:21:38 +02002534 buildsRepo: func(repo, branch, goBranch string) bool {
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04002535 return atLeastGo1(goBranch, 14) && buildRepoByDefault(repo)
Tobias Klauserc0a862a2019-10-25 21:21:38 +02002536 },
Dmitri Goutnik39f3d492019-10-03 07:56:19 -05002537 })
2538 addBuilder(BuildConfig{
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002539 Name: "plan9-arm",
2540 HostType: "host-plan9-arm-0intro",
2541 distTestAdjust: noTestDirAndNoReboot,
2542 buildsRepo: onlyMasterDefault,
Brad Fitzpatrick2446fb32017-08-06 15:57:06 +00002543 })
2544 addBuilder(BuildConfig{
David du Colombier9d711212021-04-05 20:42:05 +02002545 Name: "plan9-amd64-0intro",
David du Colombier4c648a92019-11-22 20:19:11 +01002546 HostType: "host-plan9-amd64-0intro",
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04002547 distTestAdjust: func(run bool, distTest string, isNormalTry bool) bool {
2548 run = noTestDirAndNoReboot(run, distTest, isNormalTry)
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002549 switch distTest {
David du Colombier2bfcb612019-05-08 19:42:00 +02002550 case "api",
2551 "go_test:cmd/go": // takes over 20 minutes without working SMP
2552 return false
2553 }
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002554 return run
David du Colombier2bfcb612019-05-08 19:42:00 +02002555 },
Tobias Klauser22d3b242019-11-28 11:33:00 +01002556 buildsRepo: onlyMasterDefault,
Brad Fitzpatrick2446fb32017-08-06 15:57:06 +00002557 })
Dmitri Shuralyovc9463302018-08-24 14:41:05 -04002558 addBuilder(BuildConfig{
David du Colombier4c648a92019-11-22 20:19:11 +01002559 Name: "plan9-386-0intro",
2560 HostType: "host-plan9-386-0intro",
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04002561 distTestAdjust: func(run bool, distTest string, isNormalTry bool) bool {
2562 run = noTestDirAndNoReboot(run, distTest, isNormalTry)
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002563 switch distTest {
David du Colombier7373b402019-05-09 18:52:40 +02002564 case "api",
2565 "go_test:cmd/go": // takes over 20 minutes without working SMP
2566 return false
2567 }
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002568 return run
David du Colombier7373b402019-05-09 18:52:40 +02002569 },
Tobias Klauser22d3b242019-11-28 11:33:00 +01002570 buildsRepo: onlyMasterDefault,
David du Colombier7373b402019-05-09 18:52:40 +02002571 })
2572 addBuilder(BuildConfig{
Tobias Klauserb7b66932019-03-13 09:29:15 +01002573 Name: "aix-ppc64",
2574 HostType: "host-aix-ppc64-osuosl",
2575 MinimumGoVersion: types.MajorMinor{1, 12},
Tobias Klauser1e1239b2018-12-04 15:46:08 +01002576 env: []string{
2577 "PATH=/opt/freeware/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java7_64/jre/bin:/usr/java7_64/bin",
2578 },
Brad Fitzpatrick0bbb12f2019-04-19 14:37:11 +00002579 buildsRepo: func(repo, branch, goBranch string) bool {
2580 switch repo {
Bryan C. Mills6b2867e2019-12-16 19:09:01 +00002581 case "tools", "tour", "website":
Bryan C. Mills485f9302019-08-29 15:05:21 -04002582 // The PATH on this builder is misconfigured in a way that causes
2583 // any test that executes a 'go' command as a subprocess to fail.
Bryan C. Mills5a2c6112019-08-29 12:37:31 -04002584 // (https://golang.org/issue/31567).
Bryan C. Mills485f9302019-08-29 15:05:21 -04002585 // Skip affected repos until the builder is fixed.
Bryan C. Mills5a2c6112019-08-29 12:37:31 -04002586 return false
Brad Fitzpatrick0bbb12f2019-04-19 14:37:11 +00002587 }
Dmitri Shuralyov43ea6942021-02-19 12:17:28 -05002588 return buildRepoByDefault(repo)
Brad Fitzpatrick0bbb12f2019-04-19 14:37:11 +00002589 },
Dmitri Shuralyovc9463302018-08-24 14:41:05 -04002590 })
Meng Zhuo2e053772020-11-25 00:44:38 +08002591 addBuilder(BuildConfig{
2592 Name: "linux-amd64-wsl",
2593 HostType: "host-linux-amd64-wsl",
2594 Notes: "Windows 10 WSL2 Ubuntu",
2595 FlakyNet: true,
2596 SkipSnapshot: true, // The builder has a slow uplink bandwidth.
2597 })
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00002598}
Brad Fitzpatrick9702f6a2016-08-30 20:32:33 +00002599
Brad Fitzpatrickc328d042017-04-12 00:35:37 +00002600// addBuilder adds c to the Builders map after doing some sanity
2601// checks.
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -08002602func addBuilder(c BuildConfig) {
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -08002603 if c.Name == "" {
2604 panic("empty name")
2605 }
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00002606 if c.HostType == "" {
2607 panic(fmt.Sprintf("missing HostType for builder %q", c.Name))
2608 }
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -08002609 if _, dup := Builders[c.Name]; dup {
Brad Fitzpatrick2446fb32017-08-06 15:57:06 +00002610 panic("dup name " + c.Name)
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -08002611 }
Brad Fitzpatrick328c9b82016-09-21 21:27:37 +00002612 if _, ok := Hosts[c.HostType]; !ok {
2613 panic(fmt.Sprintf("undefined HostType %q for builder %q", c.HostType, c.Name))
Brad Fitzpatrick6925ce82015-09-08 15:18:47 -07002614 }
Brad Fitzpatrickb911fb92017-04-13 04:34:42 +00002615 if c.SkipSnapshot && (c.numTestHelpers > 0 || c.numTryTestHelpers > 0) {
2616 panic(fmt.Sprintf("config %q's SkipSnapshot is not compatible with sharded test helpers", c.Name))
2617 }
Brad Fitzpatrickc328d042017-04-12 00:35:37 +00002618
2619 types := 0
Brad Fitzpatrick14d99732018-05-05 16:36:05 +00002620 for _, fn := range []func() bool{c.IsReverse, c.IsContainer, c.IsVM} {
Brad Fitzpatrickc328d042017-04-12 00:35:37 +00002621 if fn() {
2622 types++
2623 }
2624 }
2625 if types != 1 {
Brad Fitzpatrick6ae87502018-05-04 02:42:17 +00002626 panic(fmt.Sprintf("build config %q host type inconsistent (must be Reverse, Image, or VM)", c.Name))
Brad Fitzpatrickc328d042017-04-12 00:35:37 +00002627 }
2628
Brad Fitzpatrick5eb896e2018-10-26 17:52:25 +00002629 Builders[c.Name] = &c
Brad Fitzpatrick46cc7592015-01-15 12:46:22 -08002630}
Brad Fitzpatrickc328d042017-04-12 00:35:37 +00002631
Dmitri Shuralyov4c544cb2020-11-02 22:25:51 -05002632// tryNewMiscCompile is an intermediate step towards adding a real addMiscCompile TryBot.
2633// It adds a post-submit-only builder with KnownIssue, GoDeps set to the provided values,
2634// and runs on a limited set of branches to get test results without potential disruption
2635// for contributors. It can be modified as needed when onboarding a misc-compile builder.
2636func tryNewMiscCompile(suffix, rx string, knownIssue int, goDeps []string) {
2637 if knownIssue == 0 {
2638 panic("tryNewMiscCompile: knownIssue parameter must be non-zero")
2639 }
2640 addBuilder(BuildConfig{
2641 Name: "misc-compile" + suffix,
Carlos Amedee701f7172021-08-19 13:27:43 -04002642 HostType: "host-linux-bullseye",
Dmitri Shuralyov4c544cb2020-11-02 22:25:51 -05002643 buildsRepo: func(repo, branch, goBranch string) bool { return repo == "go" && branch == "master" },
2644 KnownIssue: knownIssue,
2645 GoDeps: goDeps,
2646 env: []string{"GO_DISABLE_OUTBOUND_NETWORK=1"},
2647 CompileOnly: true,
2648 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),
2649 allScriptArgs: []string{
2650 // Filtering pattern to buildall.bash:
2651 rx,
2652 },
2653 })
2654}
2655
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002656// fasterTrybots is a distTestAdjust policy function.
2657// It skips (returns false) the test/ directory and reboot tests for trybots.
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04002658func fasterTrybots(run bool, distTest string, isNormalTry bool) bool {
2659 if isNormalTry {
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002660 if strings.HasPrefix(distTest, "test:") || distTest == "reboot" {
Brad Fitzpatrick5a66f4e2019-03-17 22:28:15 +00002661 return false // skip test
2662 }
Brad Fitzpatrick7b0a9982017-12-07 00:40:40 +00002663 }
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002664 return run
Brad Fitzpatrick7b0a9982017-12-07 00:40:40 +00002665}
2666
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002667// noTestDirAndNoReboot is a distTestAdjust policy function.
2668// It skips (returns false) the test/ directory and reboot tests for all builds.
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04002669func noTestDirAndNoReboot(run bool, distTest string, isNormalTry bool) bool {
Brad Fitzpatrick5a66f4e2019-03-17 22:28:15 +00002670 if strings.HasPrefix(distTest, "test:") || distTest == "reboot" {
Brad Fitzpatrick7b0a9982017-12-07 00:40:40 +00002671 return false // skip test
2672 }
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002673 return run
Brad Fitzpatrick7b0a9982017-12-07 00:40:40 +00002674}
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00002675
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002676// ppc64DistTestPolicy is a distTestAdjust policy function
Brad Fitzpatrick02e7e2b2019-10-29 08:02:19 -07002677// that's shared by linux-ppc64le, -ppc64le-power9osu, and -ppc64.
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04002678func ppc64DistTestPolicy(run bool, distTest string, isNormalTry bool) bool {
Brad Fitzpatrick02e7e2b2019-10-29 08:02:19 -07002679 if distTest == "reboot" {
2680 // Skip test. It seems to use a lot of memory?
2681 // See https://golang.org/issue/35233.
2682 return false
2683 }
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002684 return run
Brad Fitzpatrick02e7e2b2019-10-29 08:02:19 -07002685}
2686
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002687// mipsDistTestPolicy is a distTestAdjust policy function
Brad Fitzpatrickf120ea32019-10-29 20:35:07 +00002688// that's shared by the slow mips builders.
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04002689func mipsDistTestPolicy(run bool, distTest string, isNormalTry bool) bool {
Brad Fitzpatrickf120ea32019-10-29 20:35:07 +00002690 switch distTest {
2691 case "api", "reboot":
2692 return false
2693 }
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002694 return run
Brad Fitzpatrickf120ea32019-10-29 20:35:07 +00002695}
2696
2697// mipsBuildsRepoPolicy is a buildsRepo policy function
2698// that's shared by the slow mips builders.
2699func mipsBuildsRepoPolicy(repo, branch, goBranch string) bool {
2700 switch repo {
2701 case "go", "net", "sys":
2702 return branch == "master" && goBranch == "master"
2703 default:
2704 return false
2705 }
2706}
2707
Meng Zhuo1b562162021-09-01 15:08:03 +08002708// riscvDistTestPolicy is same as mipsDistTestPolicy for now.
2709var riscvDistTestPolicy = mipsDistTestPolicy
2710
Xiaodong Liu5eaa6e02021-09-02 15:51:28 +08002711// loong64DistTestPolicy is a distTestAdjust policy function
2712func loong64DistTestPolicy(run bool, distTest string, isNormalTry bool) bool {
2713 switch distTest {
2714 case "api", "reboot":
2715 return false
2716 }
2717 return run
2718}
2719
2720// loong64BuildsRepoPolicy is a buildsRepo policy function
2721func loong64BuildsRepoPolicy(repo, branch, goBranch string) bool {
2722 switch repo {
2723 case "go", "net", "sys":
2724 return branch == "master" && goBranch == "master"
2725 default:
2726 return false
2727 }
2728}
2729
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00002730// TryBuildersForProject returns the builders that should run as part of
2731// a TryBot set for the given project.
2732// The project argument is of the form "go", "net", "sys", etc.
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00002733// The branch is the branch of that project ("master", "release-branch.go1.12", etc)
2734// The goBranch is the branch of Go to use. If proj == "go", then branch == goBranch.
2735func TryBuildersForProject(proj, branch, goBranch string) []*BuildConfig {
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00002736 var confs []*BuildConfig
2737 for _, conf := range Builders {
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00002738 if conf.BuildsRepoTryBot(proj, branch, goBranch) {
Brad Fitzpatrickc517aed2018-10-26 19:21:58 +00002739 confs = append(confs, conf)
2740 }
2741 }
2742 sort.Slice(confs, func(i, j int) bool {
2743 return confs[i].Name < confs[j].Name
2744 })
2745 return confs
2746}
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00002747
Cherry Zhang50a78802020-03-13 17:09:21 -04002748// atLeastGo1 reports whether branch is "release-branch.go1.N" where N >= min.
2749// It assumes "master" and "dev.*" branches are already greater than min, and
2750// always includes them.
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00002751func atLeastGo1(branch string, min int) bool {
2752 if branch == "master" {
2753 return true
2754 }
Cherry Zhang50a78802020-03-13 17:09:21 -04002755 if strings.HasPrefix(branch, "dev.") {
2756 // Treat dev branches current.
2757 // If a dev branch is active, it will be current.
2758 // If it is not active, it doesn't matter anyway.
2759 // TODO: dev.boringcrypto.go1.N branches may be the
2760 // exception. Currently we only build boringcrypto
2761 // on linux/amd64 and windows/386, which support all
2762 // versions of Go, so it doesn't actually matter.
2763 return true
2764 }
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00002765 major, minor, ok := version.ParseReleaseBranch(branch)
2766 return ok && major == 1 && minor >= min
2767}
2768
Dmitri Shuralyova1a9ec12020-03-10 13:26:20 -04002769// atMostGo1 reports whether branch is "release-branch.go1.N" where N <= max.
2770// It assumes "master" branch is already greater than max, and doesn't include it.
2771func atMostGo1(branch string, max int) bool {
2772 major, minor, ok := version.ParseReleaseBranch(branch)
2773 return ok && major == 1 && minor <= max
2774}
2775
Brad Fitzpatrick756764c2019-03-07 17:44:41 +00002776// onlyGo is a common buildsRepo policy value that only builds the main "go" repo.
2777func onlyGo(repo, branch, goBranch string) bool { return repo == "go" }
Brad Fitzpatrick8bd8e0e2019-03-26 23:04:31 +00002778
Tobias Klauser22d3b242019-11-28 11:33:00 +01002779// onlyMasterDefault is a common buildsRepo policy value that only builds
2780// default repos on the master branch.
2781func onlyMasterDefault(repo, branch, goBranch string) bool {
Dmitri Shuralyov5d9c9922020-07-01 14:45:10 -04002782 return branch == "master" && goBranch == "master" && buildRepoByDefault(repo)
Brad Fitzpatrickb61ecd02019-10-10 04:17:45 +00002783}
Brad Fitzpatrickf7a5fcf2019-04-03 05:03:37 +00002784
Brad Fitzpatrick8bd8e0e2019-03-26 23:04:31 +00002785// disabledBuilder is a buildsRepo policy function that always return false.
2786func disabledBuilder(repo, branch, goBranch string) bool { return false }
Brad Fitzpatrickc72a0ed2019-03-27 23:03:50 +00002787
2788// macTestPolicy is the test policy for Macs.
2789//
2790// We have limited Mac resources. It's not worth wasting time testing
2791// portable things on them. That is, if there's a slow test that will
2792// still fail slowly on another builder where we have more resources
2793// (like linux-amd64), then there's no point testing it redundantly on
2794// the Macs.
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04002795func macTestPolicy(run bool, distTest string, isNormalTry bool) bool {
Brad Fitzpatrickc72a0ed2019-03-27 23:03:50 +00002796 if strings.HasPrefix(distTest, "test:") {
2797 return false
2798 }
2799 switch distTest {
2800 case "reboot", "api", "doc_progs",
2801 "wiki", "bench_go1", "codewalk":
2802 return false
2803 }
Dmitri Shuralyov81f06ce2020-04-09 16:24:30 -04002804 if isNormalTry {
Brad Fitzpatrickc72a0ed2019-03-27 23:03:50 +00002805 switch distTest {
2806 case "runtime:cpu124", "race", "moved_goroot":
2807 return false
2808 }
2809 // TODO: more. Look at bigquery results once we have more data.
2810 }
Dmitri Shuralyov75a37cb2020-04-09 12:47:03 -04002811 return run
Brad Fitzpatrickc72a0ed2019-03-27 23:03:50 +00002812}