Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 1 | // 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. |
| 7 | package dashboard |
| 8 | |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 9 | import ( |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 10 | "fmt" |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 11 | "strconv" |
| 12 | "strings" |
Evan Brown | a731151 | 2016-02-14 15:59:59 -0800 | [diff] [blame] | 13 | |
| 14 | "golang.org/x/build/buildenv" |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 15 | ) |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 16 | |
| 17 | // Builders are the different build configurations. |
| 18 | // The keys are like "darwin-amd64" or "linux-386-387". |
| 19 | // This map should not be modified by other packages. |
| 20 | var Builders = map[string]BuildConfig{} |
| 21 | |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 22 | // Hosts contains the names and configs of all the types of |
| 23 | // buildlets. They can be VMs, containers, or dedicated machines. |
| 24 | var Hosts = map[string]*HostConfig{ |
| 25 | "host-linux-kubestd": &HostConfig{ |
| 26 | Notes: "Kubernetes container on GKE.", |
Brad Fitzpatrick | c87bb98 | 2016-10-12 14:59:20 +0000 | [diff] [blame] | 27 | KubeImage: "linux-x86-std-kube:latest", |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 28 | buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64", |
| 29 | env: []string{"GOROOT_BOOTSTRAP=/go1.4"}, |
| 30 | }, |
Brad Fitzpatrick | 46ecb43 | 2016-09-23 20:44:43 +0000 | [diff] [blame] | 31 | "host-linux-armhf-cross": &HostConfig{ |
| 32 | Notes: "Kubernetes container on GKE built from env/crosscompile/linux-armhf-jessie", |
| 33 | KubeImage: "linux-armhf-jessie:latest", |
| 34 | buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64", |
| 35 | env: []string{"GOROOT_BOOTSTRAP=/go1.4"}, |
| 36 | }, |
| 37 | |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 38 | "host-nacl-kube": &HostConfig{ |
| 39 | Notes: "Kubernetes container on GKE.", |
| 40 | KubeImage: "linux-x86-nacl:latest", |
| 41 | buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64", |
| 42 | env: []string{"GOROOT_BOOTSTRAP=/go1.4"}, |
| 43 | }, |
| 44 | "host-s390x-cross-kube": &HostConfig{ |
| 45 | Notes: "Kubernetes container on GKE.", |
| 46 | KubeImage: "linux-s390x-stretch:latest", |
| 47 | buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.linux-amd64", |
| 48 | env: []string{"GOROOT_BOOTSTRAP=/go1.4"}, |
| 49 | }, |
| 50 | "host-linux-clang": &HostConfig{ |
| 51 | Notes: "GCE VM with clang.", |
| 52 | VMImage: "linux-buildlet-clang", |
| 53 | buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64", |
| 54 | env: []string{"GOROOT_BOOTSTRAP=/go1.4"}, |
| 55 | }, |
| 56 | "host-linux-sid": &HostConfig{ |
| 57 | Notes: "GCE VM with Debian sid.", |
| 58 | VMImage: "linux-buildlet-sid", |
| 59 | buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.linux-amd64", |
| 60 | env: []string{"GOROOT_BOOTSTRAP=/go1.4"}, |
| 61 | }, |
| 62 | "host-linux-arm": &HostConfig{ |
| 63 | IsReverse: true, |
| 64 | env: []string{"GOROOT_BOOTSTRAP=/usr/local/go"}, |
| 65 | ReverseAliases: []string{"linux-arm", "linux-arm-arm5"}, |
| 66 | }, |
Brad Fitzpatrick | 4776272 | 2016-12-10 19:10:49 +0000 | [diff] [blame] | 67 | "host-openbsd-amd64-60": &HostConfig{ |
| 68 | VMImage: "openbsd-amd64-60", |
| 69 | machineType: "n1-highcpu-4", |
| 70 | buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.openbsd-amd64", |
| 71 | goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/gobootstrap-openbsd-amd64-60.tar.gz", |
| 72 | Notes: "OpenBSD 6.0; GCE VM is built from script in build/env/openbsd-amd64", |
| 73 | }, |
Brad Fitzpatrick | d621541 | 2016-12-14 22:41:25 +0000 | [diff] [blame] | 74 | "host-openbsd-386-60": &HostConfig{ |
| 75 | VMImage: "openbsd-386-60", |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 76 | machineType: "n1-highcpu-4", |
| 77 | buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.openbsd-386", |
Brad Fitzpatrick | d621541 | 2016-12-14 22:41:25 +0000 | [diff] [blame] | 78 | goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/gobootstrap-openbsd-386-60.tar.gz", |
| 79 | Notes: "OpenBSD 6.0; GCE VM is built from script in build/env/openbsd-386", |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 80 | }, |
| 81 | "host-freebsd-93-gce": &HostConfig{ |
| 82 | VMImage: "freebsd-amd64-gce93", |
| 83 | machineType: "n1-highcpu-4", |
| 84 | buildletURLTmpl: "https://storage.googleapis.com/$BUCKET/buildlet.freebsd-amd64", |
| 85 | goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-freebsd-amd64.tar.gz", |
| 86 | }, |
| 87 | "host-freebsd-101-gce": &HostConfig{ |
| 88 | VMImage: "freebsd-amd64-gce101", |
| 89 | Notes: "FreeBSD 10.1; GCE VM is built from script in build/env/freebsd-amd64", |
| 90 | machineType: "n1-highcpu-4", |
| 91 | buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.freebsd-amd64", // TODO(bradfitz): why was this http instead of https? |
| 92 | goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-freebsd-amd64.tar.gz", |
| 93 | env: []string{"CC=clang"}, |
| 94 | }, |
| 95 | "host-netbsd-gce": &HostConfig{ |
| 96 | VMImage: "netbsd-amd64-gce", |
| 97 | Notes: "NetBSD tip; GCE VM is built from script in build/env/netbsd-amd64", |
| 98 | machineType: "n1-highcpu-2", |
| 99 | buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.netbsd-amd64", |
| 100 | goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/gobootstrap-netbsd-amd64.tar.gz", |
| 101 | }, |
| 102 | "host-plan9-386-gce": &HostConfig{ |
Brad Fitzpatrick | 5cdbabd | 2016-10-18 13:25:38 +0000 | [diff] [blame] | 103 | VMImage: "plan9-386-v4", |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 104 | Notes: "Plan 9 from 0intro; GCE VM is built from script in build/env/plan9-386", |
| 105 | buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.plan9-386", |
| 106 | goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/gobootstrap-plan9-386.tar.gz", |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 107 | |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 108 | // We *were* using n1-standard-1 because Plan 9 can only |
| 109 | // reliably use a single CPU. Using 2 or 4 and we see |
| 110 | // test failures. See: |
| 111 | // https://golang.org/issue/8393 |
| 112 | // https://golang.org/issue/9491 |
| 113 | // n1-standard-1 has 3.6 GB of memory which WAS (see below) |
| 114 | // overkill (userspace probably only sees 2GB anyway), |
| 115 | // but it's the cheapest option. And plenty to keep |
| 116 | // our ~250 MB of inputs+outputs in its ramfs. |
| 117 | // |
| 118 | // But the docs says "For the n1 series of machine |
| 119 | // types, a virtual CPU is implemented as a single |
| 120 | // hyperthread on a 2.6GHz Intel Sandy Bridge Xeon or |
| 121 | // Intel Ivy Bridge Xeon (or newer) processor. This |
| 122 | // means that the n1-standard-2 machine type will see |
| 123 | // a whole physical core." |
| 124 | // |
| 125 | // ... so we used n1-highcpu-2 (1.80 RAM, still |
| 126 | // plenty), just so we can get 1 whole core for the |
| 127 | // single-core Plan 9. It will see 2 virtual cores and |
| 128 | // only use 1, but we hope that 1 will be more powerful |
| 129 | // and we'll stop timing out on tests. |
| 130 | machineType: "n1-highcpu-4", |
David du Colombier | 3689a13 | 2016-12-02 00:15:58 +0100 | [diff] [blame] | 131 | env: []string{"GO_TEST_TIMEOUT_SCALE=2"}, |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 132 | }, |
| 133 | "host-windows-gce": &HostConfig{ |
| 134 | VMImage: "windows-buildlet-v2", |
| 135 | machineType: "n1-highcpu-4", |
| 136 | buildletURLTmpl: "http://storage.googleapis.com/$BUCKET/buildlet.windows-amd64", |
| 137 | goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-windows-amd64.tar.gz", |
| 138 | RegularDisk: true, |
| 139 | }, |
| 140 | "host-darwin-10_8": &HostConfig{ |
| 141 | IsReverse: true, |
| 142 | Notes: "MacStadium OS X 10.8 VM under VMWare ESXi", |
| 143 | env: []string{ |
| 144 | "GOROOT_BOOTSTRAP=/Users/gopher/go1.4", |
| 145 | }, |
| 146 | ReverseAliases: []string{"darwin-amd64-10_8"}, |
| 147 | }, |
| 148 | "host-darwin-10_10": &HostConfig{ |
| 149 | IsReverse: true, |
| 150 | Notes: "MacStadium OS X 10.10 VM under VMWare ESXi", |
| 151 | env: []string{ |
| 152 | "GOROOT_BOOTSTRAP=/Users/gopher/go1.4", |
| 153 | }, |
| 154 | ReverseAliases: []string{"darwin-amd64-10_10"}, |
| 155 | }, |
| 156 | "host-darwin-10_11": &HostConfig{ |
| 157 | IsReverse: true, |
| 158 | Notes: "MacStadium OS X 10.11 VM under VMWare ESXi", |
| 159 | env: []string{ |
| 160 | "GOROOT_BOOTSTRAP=/Users/gopher/go1.4", |
| 161 | }, |
| 162 | ReverseAliases: []string{"darwin-amd64-10_11"}, |
| 163 | }, |
Brad Fitzpatrick | 409147c | 2017-01-18 22:45:12 +0000 | [diff] [blame] | 164 | "host-darwin-10_12": &HostConfig{ |
| 165 | IsReverse: true, |
| 166 | Notes: "MacStadium OS X 10.12 VM under VMWare ESXi", |
| 167 | env: []string{ |
| 168 | "GOROOT_BOOTSTRAP=/Users/gopher/go1.4", |
| 169 | }, |
| 170 | ReverseAliases: []string{"darwin-amd64-10_12"}, |
| 171 | }, |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 172 | "host-linux-s390x": &HostConfig{ |
| 173 | Notes: "run by IBM", |
| 174 | IsReverse: true, |
| 175 | env: []string{"GOROOT_BOOTSTRAP=/var/buildlet/go-linux-s390x-bootstrap"}, |
| 176 | ReverseAliases: []string{"linux-s390x-ibm"}, |
| 177 | }, |
Brad Fitzpatrick | f8a3106 | 2016-10-06 20:30:58 +0000 | [diff] [blame] | 178 | "host-linux-ppc64-osu": &HostConfig{ |
| 179 | Notes: "Debian jessie; run by Go team on osuosl.org", |
| 180 | IsReverse: true, |
| 181 | env: []string{"GOROOT_BOOTSTRAP=/usr/local/go-bootstrap"}, |
| 182 | ReverseAliases: []string{"linux-ppc64-buildlet"}, |
| 183 | }, |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 184 | "host-linux-ppc64le-osu": &HostConfig{ |
| 185 | Notes: "Debian jessie; run by Go team on osuosl.org", |
| 186 | IsReverse: true, |
| 187 | env: []string{"GOROOT_BOOTSTRAP=/usr/local/go-bootstrap"}, |
| 188 | ReverseAliases: []string{"linux-ppc64le-buildlet"}, |
| 189 | }, |
| 190 | "host-linux-arm64-linaro": &HostConfig{ |
| 191 | Notes: "Ubuntu wily; run by Go team, from linaro", |
| 192 | IsReverse: true, |
| 193 | env: []string{"GOROOT_BOOTSTRAP=/usr/local/go-bootstrap"}, |
| 194 | ReverseAliases: []string{"linux-arm64-buildlet"}, |
| 195 | }, |
| 196 | "host-solaris-amd64": &HostConfig{ |
| 197 | Notes: "run by Go team on Joyent, on a SmartOS 'infrastructure container'", |
| 198 | IsReverse: true, |
| 199 | env: []string{"GOROOT_BOOTSTRAP=/root/go-solaris-amd64-bootstrap"}, |
| 200 | ReverseAliases: []string{"solaris-amd64-smartosbuildlet"}, |
| 201 | }, |
Brad Fitzpatrick | 31e2bfa | 2016-11-03 17:35:15 +0000 | [diff] [blame] | 202 | "host-linux-mips": &HostConfig{ |
Brad Fitzpatrick | 01647ec | 2016-11-09 18:53:36 +0000 | [diff] [blame] | 203 | Notes: "Run by Brendan Kirby, imgtec.com", |
| 204 | IsReverse: true, |
| 205 | env: []string{ |
| 206 | "GOROOT_BOOTSTRAP=/usr/local/go-bootstrap-mips", |
| 207 | "GOARCH=mips", |
| 208 | "GOHOSTARCH=mips", |
Brad Fitzpatrick | 4776272 | 2016-12-10 19:10:49 +0000 | [diff] [blame] | 209 | "GO_TEST_TIMEOUT_SCALE=4", |
Brad Fitzpatrick | 01647ec | 2016-11-09 18:53:36 +0000 | [diff] [blame] | 210 | }, |
Brad Fitzpatrick | 31e2bfa | 2016-11-03 17:35:15 +0000 | [diff] [blame] | 211 | ReverseAliases: []string{"linux-mips"}, |
| 212 | }, |
| 213 | "host-linux-mipsle": &HostConfig{ |
Brad Fitzpatrick | 01647ec | 2016-11-09 18:53:36 +0000 | [diff] [blame] | 214 | Notes: "Run by Brendan Kirby, imgtec.com", |
| 215 | IsReverse: true, |
| 216 | env: []string{ |
| 217 | "GOROOT_BOOTSTRAP=/usr/local/go-bootstrap-mipsle", |
| 218 | "GOARCH=mipsle", |
| 219 | "GOHOSTARCH=mipsle", |
| 220 | }, |
Brad Fitzpatrick | 31e2bfa | 2016-11-03 17:35:15 +0000 | [diff] [blame] | 221 | ReverseAliases: []string{"linux-mipsle"}, |
| 222 | }, |
| 223 | "host-linux-mips64": &HostConfig{ |
Brad Fitzpatrick | 01647ec | 2016-11-09 18:53:36 +0000 | [diff] [blame] | 224 | Notes: "Run by Brendan Kirby, imgtec.com", |
| 225 | IsReverse: true, |
| 226 | env: []string{ |
| 227 | "GOROOT_BOOTSTRAP=/usr/local/go-bootstrap-mips64", |
| 228 | "GOARCH=mips64", |
| 229 | "GOHOSTARCH=mips64", |
Brad Fitzpatrick | 4776272 | 2016-12-10 19:10:49 +0000 | [diff] [blame] | 230 | "GO_TEST_TIMEOUT_SCALE=4", |
Brad Fitzpatrick | 01647ec | 2016-11-09 18:53:36 +0000 | [diff] [blame] | 231 | }, |
Brad Fitzpatrick | 31e2bfa | 2016-11-03 17:35:15 +0000 | [diff] [blame] | 232 | ReverseAliases: []string{"linux-mips64"}, |
| 233 | }, |
| 234 | "host-linux-mips64le": &HostConfig{ |
Brad Fitzpatrick | 01647ec | 2016-11-09 18:53:36 +0000 | [diff] [blame] | 235 | Notes: "Run by Brendan Kirby, imgtec.com", |
| 236 | IsReverse: true, |
| 237 | env: []string{ |
| 238 | "GOROOT_BOOTSTRAP=/usr/local/go-bootstrap-mips64le", |
| 239 | "GOARCH=mips64le", |
| 240 | "GOHOSTARCH=mips64le", |
| 241 | }, |
Brad Fitzpatrick | 31e2bfa | 2016-11-03 17:35:15 +0000 | [diff] [blame] | 242 | ReverseAliases: []string{"linux-mips64le"}, |
| 243 | }, |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 244 | } |
| 245 | |
| 246 | func init() { |
| 247 | for key, c := range Hosts { |
| 248 | if key == "" { |
| 249 | panic("empty string key in Hosts") |
| 250 | } |
| 251 | if c.HostType == "" { |
| 252 | c.HostType = key |
| 253 | } |
| 254 | if c.HostType != key { |
| 255 | panic(fmt.Sprintf("HostType %q != key %q", c.HostType, key)) |
| 256 | } |
| 257 | nSet := 0 |
| 258 | if c.VMImage != "" { |
| 259 | nSet++ |
| 260 | } |
| 261 | if c.KubeImage != "" { |
| 262 | nSet++ |
| 263 | } |
| 264 | if c.IsReverse { |
| 265 | nSet++ |
| 266 | } |
| 267 | if nSet != 1 { |
| 268 | panic(fmt.Sprintf("exactly one of VMImage, KubeImage, IsReverse must be set for host %q; got %v", key, nSet)) |
| 269 | } |
| 270 | if c.buildletURLTmpl == "" && (c.VMImage != "" || c.KubeImage != "") { |
| 271 | panic(fmt.Sprintf("missing buildletURLTmpl for host type %q", key)) |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | // A HostConfig describes the available ways to obtain buildlets of |
| 277 | // different types. Some host configs can server multiple |
| 278 | // builders. For example, a host config of "host-linux-kube-std" can |
| 279 | // serve linux-amd64, linux-amd64-race, linux-386, linux-386-387, etc. |
| 280 | type HostConfig struct { |
| 281 | // HostType is the unique name of this host config. It is also |
| 282 | // the key in the Hosts map. |
| 283 | HostType string |
| 284 | |
| 285 | // buildletURLTmpl is the URL "template" ($BUCKET is auto-expanded) |
| 286 | // for the URL to the buildlet binary. |
| 287 | // This field is required for GCE and Kubernetes builders. It's not |
| 288 | // needed for reverse buildlets because in that case, the buildlets |
| 289 | // are already running and their stage0 should know how to update it |
| 290 | // it automatically. |
| 291 | buildletURLTmpl string |
| 292 | |
| 293 | // Exactly 1 of these must be set: |
Brad Fitzpatrick | 4776272 | 2016-12-10 19:10:49 +0000 | [diff] [blame] | 294 | VMImage string // e.g. "openbsd-amd64-60" |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 295 | KubeImage string // e.g. "linux-buildlet-std:latest" (suffix after "gcr.io/<PROJ>/") |
| 296 | IsReverse bool // if true, only use the reverse buildlet pool |
| 297 | |
| 298 | // GCE options, if VMImage != "" |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 299 | machineType string // optional GCE instance type |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 300 | RegularDisk bool // if true, use spinning disk instead of SSD |
| 301 | |
| 302 | // Optional base env. GOROOT_BOOTSTRAP should go here if the buildlet |
| 303 | // has Go 1.4+ baked in somewhere. |
| 304 | env []string |
Andrew Gerrand | 8e28dc9 | 2016-03-22 09:05:52 +1100 | [diff] [blame] | 305 | |
| 306 | // These template URLs may contain $BUCKET which is expanded to the |
| 307 | // relevant Cloud Storage bucket as specified by the build environment. |
| 308 | goBootstrapURLTmpl string // optional URL to a built Go 1.4+ tar.gz |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 309 | |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 310 | Owner string // optional email of owner; "bradfitz@golang.org", empty means golang-dev |
| 311 | Notes string // notes for humans |
| 312 | |
| 313 | // ReverseAliases lists alternate names for this buildlet |
| 314 | // config, for older clients doing a reverse dial into the |
| 315 | // coordinator from outside. This prevents us from updating |
| 316 | // 75+ dedicated machines/VMs atomically, switching them to |
| 317 | // the new "host-*" names. |
| 318 | // This is only applicable if IsReverse. |
| 319 | ReverseAliases []string |
| 320 | } |
| 321 | |
| 322 | // A BuildConfig describes how to run a builder. |
| 323 | type BuildConfig struct { |
| 324 | // Name is the unique name of the builder, in the form of |
| 325 | // "GOOS-GOARCH" or "GOOS-GOARCH-suffix". For example, |
| 326 | // "darwin-386", "linux-386-387", "linux-amd64-race". Some |
| 327 | // suffixes are well-known and carry special meaning, such as |
| 328 | // "-race". |
| 329 | Name string |
| 330 | |
| 331 | // HostType is the required key into the Hosts map, describing |
| 332 | // the type of host this build will run on. |
| 333 | // For example, "host-linux-kube-std". |
| 334 | HostType string |
| 335 | |
| 336 | Notes string // notes for humans |
| 337 | |
Brad Fitzpatrick | eb52e71 | 2015-05-13 18:38:20 -0700 | [diff] [blame] | 338 | TryOnly bool // only used for trybots, and not regular builds |
Brad Fitzpatrick | de72d46 | 2016-05-04 17:47:12 +0000 | [diff] [blame] | 339 | CompileOnly bool // if true, compile tests, but don't run them |
Brad Fitzpatrick | 00003f4 | 2016-05-06 18:55:26 +0000 | [diff] [blame] | 340 | FlakyNet bool // network tests are flaky (try anyway, but ignore some failures) |
Brad Fitzpatrick | 1c6d916 | 2015-03-20 16:14:52 -0700 | [diff] [blame] | 341 | |
Brad Fitzpatrick | e37005b | 2016-09-22 23:29:31 +0000 | [diff] [blame] | 342 | // StopAfterMake causes the build to stop after the make |
| 343 | // script completes, returning its result as the result of the |
| 344 | // whole build. It does not run or compile any of the tests, |
| 345 | // nor does it write a snapshot of the world to cloud |
| 346 | // storage. This option is only supported for builders whose |
| 347 | // BuildConfig.SplitMakeRun returns true. |
| 348 | StopAfterMake bool |
| 349 | |
Brad Fitzpatrick | 94d0141 | 2016-09-13 22:45:48 +0000 | [diff] [blame] | 350 | // numTestHelpers is the number of _additional_ buildlets |
| 351 | // past the first one to help out with sharded tests. |
| 352 | // For trybots, the numTryHelpers value is used, unless it's |
| 353 | // zero, in which case numTestHelpers is used. |
| 354 | numTestHelpers int |
| 355 | numTryTestHelpers int // for trybots. if 0, numTesthelpers is used |
Brad Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 356 | |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 357 | env []string // extra environment ("key=value") pairs |
| 358 | allScriptArgs []string |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 359 | } |
| 360 | |
Andrew Gerrand | cae837b | 2015-08-04 12:19:02 +1000 | [diff] [blame] | 361 | func (c *BuildConfig) Env() []string { |
Brad Fitzpatrick | 00003f4 | 2016-05-06 18:55:26 +0000 | [diff] [blame] | 362 | env := []string{"GO_BUILDER_NAME=" + c.Name} |
| 363 | if c.FlakyNet { |
| 364 | env = append(env, "GO_BUILDER_FLAKY_NET=1") |
| 365 | } |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 366 | env = append(env, c.hostConf().env...) |
Brad Fitzpatrick | 00003f4 | 2016-05-06 18:55:26 +0000 | [diff] [blame] | 367 | return append(env, c.env...) |
Andrew Gerrand | cae837b | 2015-08-04 12:19:02 +1000 | [diff] [blame] | 368 | } |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 369 | |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 370 | func (c *BuildConfig) IsReverse() bool { return c.hostConf().IsReverse } |
| 371 | |
| 372 | func (c *BuildConfig) IsKube() bool { return c.hostConf().IsKube() } |
| 373 | func (c *HostConfig) IsKube() bool { return c.KubeImage != "" } |
| 374 | |
| 375 | func (c *BuildConfig) IsGCE() bool { return c.hostConf().IsGCE() } |
| 376 | func (c *HostConfig) IsGCE() bool { return c.VMImage != "" } |
| 377 | |
Brad Fitzpatrick | f3c0193 | 2015-01-15 16:29:16 -0800 | [diff] [blame] | 378 | func (c *BuildConfig) GOOS() string { return c.Name[:strings.Index(c.Name, "-")] } |
| 379 | |
| 380 | func (c *BuildConfig) GOARCH() string { |
| 381 | arch := c.Name[strings.Index(c.Name, "-")+1:] |
| 382 | i := strings.Index(arch, "-") |
| 383 | if i == -1 { |
| 384 | return arch |
| 385 | } |
| 386 | return arch[:i] |
| 387 | } |
| 388 | |
Brad Fitzpatrick | 79f3fc0 | 2015-05-27 21:51:25 -0700 | [diff] [blame] | 389 | // FilePathJoin is mostly like filepath.Join (without the cleaning) except |
| 390 | // it uses the path separator of c.GOOS instead of the host system's. |
| 391 | func (c *BuildConfig) FilePathJoin(x ...string) string { |
| 392 | if c.GOOS() == "windows" { |
| 393 | return strings.Join(x, "\\") |
| 394 | } |
| 395 | return strings.Join(x, "/") |
| 396 | } |
| 397 | |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 398 | func (c *BuildConfig) hostConf() *HostConfig { |
| 399 | if c, ok := Hosts[c.HostType]; ok { |
| 400 | return c |
| 401 | } |
| 402 | panic(fmt.Sprintf("missing buildlet config for buildlet %q", c.Name)) |
Andrew Gerrand | 8e28dc9 | 2016-03-22 09:05:52 +1100 | [diff] [blame] | 403 | } |
| 404 | |
| 405 | // BuildletBinaryURL returns the public URL of this builder's buildlet. |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 406 | func (c *BuildConfig) GoBootstrapURL(e *buildenv.Environment) string { |
| 407 | return strings.Replace(c.hostConf().goBootstrapURLTmpl, "$BUCKET", e.BuildletBucket, 1) |
| 408 | } |
| 409 | |
| 410 | // BuildletBinaryURL returns the public URL of this builder's buildlet. |
| 411 | func (c *HostConfig) BuildletBinaryURL(e *buildenv.Environment) string { |
Andrew Gerrand | 8e28dc9 | 2016-03-22 09:05:52 +1100 | [diff] [blame] | 412 | tmpl := c.buildletURLTmpl |
Evan Brown | a731151 | 2016-02-14 15:59:59 -0800 | [diff] [blame] | 413 | return strings.Replace(tmpl, "$BUCKET", e.BuildletBucket, 1) |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 414 | } |
| 415 | |
Brad Fitzpatrick | a5383ff | 2015-06-17 08:22:14 -0700 | [diff] [blame] | 416 | func (c *BuildConfig) IsRace() bool { |
| 417 | return strings.HasSuffix(c.Name, "-race") |
| 418 | } |
| 419 | |
Brad Fitzpatrick | f8c2484 | 2015-01-16 09:54:03 -0800 | [diff] [blame] | 420 | // AllScript returns the relative path to the operating system's script to |
| 421 | // do the build and run its standard set of tests. |
| 422 | // Example values are "src/all.bash", "src/all.bat", "src/all.rc". |
| 423 | func (c *BuildConfig) AllScript() string { |
Brad Fitzpatrick | a5383ff | 2015-06-17 08:22:14 -0700 | [diff] [blame] | 424 | if c.IsRace() { |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 425 | if strings.HasPrefix(c.Name, "windows-") { |
| 426 | return "src/race.bat" |
| 427 | } |
| 428 | return "src/race.bash" |
| 429 | } |
Brad Fitzpatrick | f8c2484 | 2015-01-16 09:54:03 -0800 | [diff] [blame] | 430 | if strings.HasPrefix(c.Name, "windows-") { |
| 431 | return "src/all.bat" |
| 432 | } |
| 433 | if strings.HasPrefix(c.Name, "plan9-") { |
| 434 | return "src/all.rc" |
| 435 | } |
Brad Fitzpatrick | 0e84fc7 | 2015-02-18 14:12:22 -0800 | [diff] [blame] | 436 | if strings.HasPrefix(c.Name, "nacl-") { |
| 437 | return "src/nacltest.bash" |
| 438 | } |
David Crawshaw | 953e869 | 2015-09-03 13:35:10 -0400 | [diff] [blame] | 439 | if strings.HasPrefix(c.Name, "android-") { |
| 440 | return "src/androidtest.bash" |
| 441 | } |
David Crawshaw | e078c6f | 2015-04-29 08:54:19 -0400 | [diff] [blame] | 442 | if strings.HasPrefix(c.Name, "darwin-arm") { |
| 443 | return "src/iostest.bash" |
| 444 | } |
Brad Fitzpatrick | 8c6116a | 2016-05-05 00:42:49 +0000 | [diff] [blame] | 445 | if strings.HasPrefix(c.Name, "misc-compile") { |
Brad Fitzpatrick | ab7ff8a | 2015-04-29 14:44:46 -0700 | [diff] [blame] | 446 | return "src/buildall.bash" |
| 447 | } |
Brad Fitzpatrick | f8c2484 | 2015-01-16 09:54:03 -0800 | [diff] [blame] | 448 | return "src/all.bash" |
| 449 | } |
| 450 | |
Brad Fitzpatrick | 7d9b036 | 2015-05-27 11:51:27 -0700 | [diff] [blame] | 451 | // SplitMakeRun reports whether the coordinator should first compile |
| 452 | // (using c.MakeScript), then snapshot, then run the tests (ideally |
| 453 | // sharded) using c.RunScript. |
| 454 | // Eventually this function should always return true (and then be deleted) |
| 455 | // but for now we've only set up the scripts and verified that the main |
| 456 | // configurations work. |
| 457 | func (c *BuildConfig) SplitMakeRun() bool { |
| 458 | switch c.AllScript() { |
Brad Fitzpatrick | de72d46 | 2016-05-04 17:47:12 +0000 | [diff] [blame] | 459 | case "src/all.bash", "src/all.bat", |
| 460 | "src/race.bash", "src/race.bat", |
| 461 | "src/all.rc", |
| 462 | "src/nacltest.bash": |
Brad Fitzpatrick | 7d9b036 | 2015-05-27 11:51:27 -0700 | [diff] [blame] | 463 | // These we've verified to work. |
| 464 | return true |
| 465 | } |
Brad Fitzpatrick | de72d46 | 2016-05-04 17:47:12 +0000 | [diff] [blame] | 466 | // TODO(bradfitz): make androidtest.bash and iotest.bash work |
| 467 | // too. And buildall.bash should really just be N small |
| 468 | // Kubernetes jobs instead of a "buildall.bash". Then we can |
| 469 | // delete this whole method. |
Brad Fitzpatrick | 7d9b036 | 2015-05-27 11:51:27 -0700 | [diff] [blame] | 470 | return false |
| 471 | } |
| 472 | |
Andrew Gerrand | 234725b | 2015-06-04 16:45:17 -0700 | [diff] [blame] | 473 | func (c *BuildConfig) BuildSubrepos() bool { |
| 474 | if !c.SplitMakeRun() { |
| 475 | return false |
| 476 | } |
Andrew Gerrand | af7d181 | 2015-06-11 10:01:24 -0700 | [diff] [blame] | 477 | // TODO(adg,bradfitz): expand this as required |
| 478 | switch c.Name { |
Brad Fitzpatrick | d83028e | 2016-09-07 05:41:02 +0000 | [diff] [blame] | 479 | case "darwin-amd64-10_8", |
| 480 | "darwin-amd64-10_10", |
| 481 | "darwin-amd64-10_11", |
| 482 | "darwin-386-10_11", |
Andrew Gerrand | af7d181 | 2015-06-11 10:01:24 -0700 | [diff] [blame] | 483 | "freebsd-386-gce101", "freebsd-amd64-gce101", |
| 484 | "linux-386", "linux-amd64", "linux-amd64-nocgo", |
Brad Fitzpatrick | d621541 | 2016-12-14 22:41:25 +0000 | [diff] [blame] | 485 | "openbsd-386-60", "openbsd-amd64-60", |
Andrew Gerrand | af7d181 | 2015-06-11 10:01:24 -0700 | [diff] [blame] | 486 | "plan9-386", |
| 487 | "windows-386-gce", "windows-amd64-gce": |
| 488 | return true |
Brad Fitzpatrick | 9d1e515 | 2017-01-24 21:48:04 +0000 | [diff] [blame] | 489 | case "darwin-amd64-10_12": |
| 490 | // Don't build subrepos on Sierra until |
| 491 | // https://github.com/golang/go/issues/18751#issuecomment-274955794 |
| 492 | // is addressed. |
| 493 | return false |
Andrew Gerrand | af7d181 | 2015-06-11 10:01:24 -0700 | [diff] [blame] | 494 | default: |
| 495 | return false |
| 496 | } |
Andrew Gerrand | 234725b | 2015-06-04 16:45:17 -0700 | [diff] [blame] | 497 | } |
| 498 | |
Andrew Gerrand | fb77488 | 2015-05-21 14:02:38 +1000 | [diff] [blame] | 499 | // AllScriptArgs returns the set of arguments that should be passed to the |
David Crawshaw | e078c6f | 2015-04-29 08:54:19 -0400 | [diff] [blame] | 500 | // all.bash-equivalent script. Usually empty. |
| 501 | func (c *BuildConfig) AllScriptArgs() []string { |
| 502 | if strings.HasPrefix(c.Name, "darwin-arm") { |
| 503 | return []string{"-restart"} |
| 504 | } |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 505 | return append([]string(nil), c.allScriptArgs...) |
David Crawshaw | e078c6f | 2015-04-29 08:54:19 -0400 | [diff] [blame] | 506 | } |
| 507 | |
Andrew Gerrand | f83f3e4 | 2015-02-02 12:05:01 +0000 | [diff] [blame] | 508 | // MakeScript returns the relative path to the operating system's script to |
| 509 | // do the build. |
| 510 | // Example values are "src/make.bash", "src/make.bat", "src/make.rc". |
| 511 | func (c *BuildConfig) MakeScript() string { |
| 512 | if strings.HasPrefix(c.Name, "windows-") { |
| 513 | return "src/make.bat" |
| 514 | } |
| 515 | if strings.HasPrefix(c.Name, "plan9-") { |
| 516 | return "src/make.rc" |
| 517 | } |
Brad Fitzpatrick | de72d46 | 2016-05-04 17:47:12 +0000 | [diff] [blame] | 518 | if strings.HasPrefix(c.Name, "nacl-") { |
| 519 | return "src/naclmake.bash" |
| 520 | } |
Andrew Gerrand | f83f3e4 | 2015-02-02 12:05:01 +0000 | [diff] [blame] | 521 | return "src/make.bash" |
| 522 | } |
| 523 | |
Andrew Gerrand | fb77488 | 2015-05-21 14:02:38 +1000 | [diff] [blame] | 524 | // MakeScriptArgs returns the set of arguments that should be passed to the |
| 525 | // make.bash-equivalent script. Usually empty. |
| 526 | func (c *BuildConfig) MakeScriptArgs() []string { |
| 527 | return c.AllScriptArgs() |
| 528 | } |
| 529 | |
| 530 | // RunScript returns the relative path to the operating system's script to |
| 531 | // run the test suite. |
| 532 | // Example values are "src/run.bash", "src/run.bat", "src/run.rc". |
| 533 | func (c *BuildConfig) RunScript() string { |
| 534 | if strings.HasPrefix(c.Name, "windows-") { |
| 535 | return "src/run.bat" |
| 536 | } |
| 537 | if strings.HasPrefix(c.Name, "plan9-") { |
| 538 | return "src/run.rc" |
| 539 | } |
| 540 | return "src/run.bash" |
| 541 | } |
| 542 | |
| 543 | // RunScriptArgs returns the set of arguments that should be passed to the |
| 544 | // run.bash-equivalent script. |
| 545 | func (c *BuildConfig) RunScriptArgs() []string { |
| 546 | return []string{"--no-rebuild"} |
| 547 | } |
| 548 | |
Andrew Gerrand | f83f3e4 | 2015-02-02 12:05:01 +0000 | [diff] [blame] | 549 | // GorootFinal returns the default install location for |
| 550 | // releases for this platform. |
| 551 | func (c *BuildConfig) GorootFinal() string { |
| 552 | if strings.HasPrefix(c.Name, "windows-") { |
| 553 | return "c:\\go" |
| 554 | } |
| 555 | return "/usr/local/go" |
| 556 | } |
| 557 | |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 558 | // MachineType returns the GCE machine type to use for this builder. |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 559 | func (c *HostConfig) MachineType() string { |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 560 | if v := c.machineType; v != "" { |
| 561 | return v |
| 562 | } |
| 563 | return "n1-highcpu-2" |
| 564 | } |
| 565 | |
David Crawshaw | eef380f | 2015-04-30 20:03:01 -0400 | [diff] [blame] | 566 | // ShortOwner returns a short human-readable owner. |
| 567 | func (c BuildConfig) ShortOwner() string { |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 568 | owner := c.hostConf().Owner |
| 569 | if owner == "" { |
David Crawshaw | eef380f | 2015-04-30 20:03:01 -0400 | [diff] [blame] | 570 | return "go-dev" |
| 571 | } |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 572 | return strings.TrimSuffix(owner, "@golang.org") |
David Crawshaw | eef380f | 2015-04-30 20:03:01 -0400 | [diff] [blame] | 573 | } |
| 574 | |
Brad Fitzpatrick | f787cec | 2016-09-23 00:06:28 +0000 | [diff] [blame] | 575 | // PoolName returns a short summary of the builder's host type for the |
| 576 | // http://farmer.golang.org/builders page. |
| 577 | func (c *HostConfig) PoolName() string { |
| 578 | switch { |
| 579 | case c.IsReverse: |
| 580 | return "Reverse (dedicated machine/VM)" |
| 581 | case c.IsGCE(): |
| 582 | return "GCE VM" |
| 583 | case c.IsKube(): |
| 584 | return "Kubernetes container" |
| 585 | } |
| 586 | return "??" |
| 587 | } |
| 588 | |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 589 | // GCENumCPU reports the number of GCE CPUs this buildlet requires. |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 590 | func (c *HostConfig) GCENumCPU() int { |
Brad Fitzpatrick | 1b1e086 | 2015-06-04 18:25:50 -0700 | [diff] [blame] | 591 | t := c.MachineType() |
| 592 | n, _ := strconv.Atoi(t[strings.LastIndex(t, "-")+1:]) |
| 593 | return n |
| 594 | } |
| 595 | |
Brad Fitzpatrick | 94d0141 | 2016-09-13 22:45:48 +0000 | [diff] [blame] | 596 | func (c *BuildConfig) NumTestHelpers(isTry bool) int { |
| 597 | if isTry && c.numTryTestHelpers != 0 { |
| 598 | return c.numTryTestHelpers |
| 599 | } |
| 600 | return c.numTestHelpers |
| 601 | } |
| 602 | |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 603 | func init() { |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 604 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 605 | Name: "freebsd-amd64-gce93", |
| 606 | HostType: "host-freebsd-93-gce", |
| 607 | numTestHelpers: 1, |
Bill Thiede | 222a9c0 | 2015-01-21 21:16:54 -0800 | [diff] [blame] | 608 | }) |
| 609 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 610 | Name: "freebsd-amd64-gce101", |
| 611 | HostType: "host-freebsd-101-gce", |
| 612 | numTestHelpers: 2, |
| 613 | numTryTestHelpers: 4, |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 614 | }) |
| 615 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 616 | Name: "freebsd-amd64-race", |
| 617 | HostType: "host-freebsd-101-gce", |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 618 | }) |
| 619 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 620 | Name: "freebsd-386-gce101", |
| 621 | HostType: "host-freebsd-101-gce", |
| 622 | env: []string{"GOARCH=386", "GOHOSTARCH=386"}, |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 623 | }) |
| 624 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 625 | Name: "linux-386", |
| 626 | HostType: "host-linux-kubestd", |
| 627 | env: []string{"GOARCH=386", "GOHOSTARCH=386"}, |
| 628 | numTestHelpers: 1, |
| 629 | numTryTestHelpers: 3, |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 630 | }) |
| 631 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 632 | Name: "linux-386-387", |
| 633 | Notes: "GO386=387", |
| 634 | HostType: "host-linux-kubestd", |
| 635 | env: []string{"GOARCH=386", "GOHOSTARCH=386", "GO386=387"}, |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 636 | }) |
| 637 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 638 | Name: "linux-amd64", |
| 639 | HostType: "host-linux-kubestd", |
| 640 | numTestHelpers: 3, |
Evan Brown | 08b68a9 | 2015-11-20 10:00:06 -0800 | [diff] [blame] | 641 | }) |
Brad Fitzpatrick | 8c6116a | 2016-05-05 00:42:49 +0000 | [diff] [blame] | 642 | |
| 643 | addMiscCompile := func(suffix, rx string) { |
| 644 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 645 | Name: "misc-compile" + suffix, |
| 646 | HostType: "host-linux-kubestd", |
| 647 | TryOnly: true, |
| 648 | CompileOnly: true, |
| 649 | Notes: "Runs buildall.sh to cross-compile std packages for " + rx + ", but doesn't run any tests.", |
Brad Fitzpatrick | 8c6116a | 2016-05-05 00:42:49 +0000 | [diff] [blame] | 650 | allScriptArgs: []string{ |
| 651 | // Filtering pattern to buildall.bash: |
| 652 | rx, |
| 653 | }, |
| 654 | }) |
| 655 | } |
Brad Fitzpatrick | 98922e1 | 2016-11-12 00:32:48 +0000 | [diff] [blame] | 656 | addMiscCompile("", "^(linux-arm64|linux-mips64.*|nacl-arm|solaris-amd64|freebsd-arm|darwin-386)$") |
| 657 | // TODO(bradfitz): add linux-mips* (or just make a "-mips" suffix builder) to add 32-bit |
| 658 | // mips, once that port is finished. |
Brad Fitzpatrick | 8c6116a | 2016-05-05 00:42:49 +0000 | [diff] [blame] | 659 | addMiscCompile("-ppc", "^(linux-ppc64|linux-ppc64le)$") |
| 660 | addMiscCompile("-netbsd", "^netbsd-") |
| 661 | addMiscCompile("-plan9", "^plan9-") |
| 662 | |
Brad Fitzpatrick | ab7ff8a | 2015-04-29 14:44:46 -0700 | [diff] [blame] | 663 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 664 | Name: "linux-amd64-nocgo", |
| 665 | HostType: "host-linux-kubestd", |
| 666 | Notes: "cgo disabled", |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 667 | env: []string{ |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 668 | "CGO_ENABLED=0", |
| 669 | // This USER=root was required for Docker-based builds but probably isn't required |
| 670 | // in the VM anymore, since the buildlet probably already has this in its environment. |
| 671 | // (It was required because without cgo, it couldn't find the username) |
| 672 | "USER=root", |
| 673 | }, |
| 674 | }) |
| 675 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 676 | Name: "linux-amd64-noopt", |
| 677 | Notes: "optimizations and inlining disabled", |
| 678 | HostType: "host-linux-kubestd", |
| 679 | env: []string{"GO_GCFLAGS=-N -l"}, |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 680 | }) |
| 681 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | de72d46 | 2016-05-04 17:47:12 +0000 | [diff] [blame] | 682 | Name: "linux-amd64-ssacheck", |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 683 | HostType: "host-linux-kubestd", |
Brad Fitzpatrick | de72d46 | 2016-05-04 17:47:12 +0000 | [diff] [blame] | 684 | CompileOnly: true, |
| 685 | Notes: "SSA internal checks enabled", |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 686 | env: []string{"GO_GCFLAGS=-d=ssa/check/on"}, |
Keith Randall | a04c813 | 2016-03-18 15:30:38 -0700 | [diff] [blame] | 687 | }) |
| 688 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 94d0141 | 2016-09-13 22:45:48 +0000 | [diff] [blame] | 689 | Name: "linux-amd64-race", |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 690 | HostType: "host-linux-kubestd", |
Brad Fitzpatrick | 94d0141 | 2016-09-13 22:45:48 +0000 | [diff] [blame] | 691 | numTestHelpers: 2, |
| 692 | numTryTestHelpers: 5, |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 693 | }) |
| 694 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 695 | Name: "linux-386-clang", |
| 696 | HostType: "host-linux-clang", |
| 697 | Notes: "Debian wheezy + clang 3.5 instead of gcc", |
| 698 | env: []string{"CC=/usr/bin/clang", "GOHOSTARCH=386"}, |
Brad Fitzpatrick | a0a155e | 2015-02-12 19:45:02 -0800 | [diff] [blame] | 699 | }) |
| 700 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 701 | Name: "linux-amd64-clang", |
| 702 | HostType: "host-linux-clang", |
| 703 | Notes: "Debian wheezy + clang 3.5 instead of gcc", |
| 704 | env: []string{"CC=/usr/bin/clang"}, |
Brad Fitzpatrick | a0a155e | 2015-02-12 19:45:02 -0800 | [diff] [blame] | 705 | }) |
| 706 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 707 | Name: "linux-386-sid", |
| 708 | HostType: "host-linux-sid", |
| 709 | Notes: "Debian sid (unstable)", |
| 710 | env: []string{"GOHOSTARCH=386"}, |
Brad Fitzpatrick | f0728e3 | 2015-02-13 19:01:32 -0800 | [diff] [blame] | 711 | }) |
| 712 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 713 | Name: "linux-amd64-sid", |
| 714 | HostType: "host-linux-sid", |
| 715 | Notes: "Debian sid (unstable)", |
Brad Fitzpatrick | f0728e3 | 2015-02-13 19:01:32 -0800 | [diff] [blame] | 716 | }) |
| 717 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 94d0141 | 2016-09-13 22:45:48 +0000 | [diff] [blame] | 718 | Name: "linux-arm", |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 719 | HostType: "host-linux-arm", |
Brad Fitzpatrick | 94d0141 | 2016-09-13 22:45:48 +0000 | [diff] [blame] | 720 | FlakyNet: true, |
| 721 | numTestHelpers: 2, |
| 722 | numTryTestHelpers: 7, |
Brad Fitzpatrick | dfe8286 | 2015-03-01 09:23:57 -0800 | [diff] [blame] | 723 | }) |
| 724 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | e37005b | 2016-09-22 23:29:31 +0000 | [diff] [blame] | 725 | Name: "linux-arm-nativemake", |
| 726 | Notes: "runs make.bash on real ARM hardware, but does not run tests", |
| 727 | HostType: "host-linux-arm", |
| 728 | StopAfterMake: true, |
| 729 | }) |
| 730 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 731 | Name: "linux-arm-arm5", |
| 732 | HostType: "host-linux-arm", |
| 733 | Notes: "GOARM=5, but running on newer-than GOARM=5 hardware", |
| 734 | FlakyNet: true, |
Brad Fitzpatrick | 1c43756 | 2015-05-11 08:47:37 -0700 | [diff] [blame] | 735 | env: []string{ |
Brad Fitzpatrick | bab0718 | 2015-05-13 15:16:31 -0700 | [diff] [blame] | 736 | "GOARM=5", |
Brad Fitzpatrick | 1c43756 | 2015-05-11 08:47:37 -0700 | [diff] [blame] | 737 | "GO_TEST_TIMEOUT_SCALE=5", // slow. |
| 738 | }, |
Brad Fitzpatrick | f319bb6 | 2015-05-07 11:36:25 -0700 | [diff] [blame] | 739 | }) |
| 740 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 741 | Name: "nacl-386", |
| 742 | HostType: "host-nacl-kube", |
| 743 | numTestHelpers: 3, |
| 744 | env: []string{"GOOS=nacl", "GOARCH=386", "GOHOSTOS=linux", "GOHOSTARCH=amd64"}, |
Brad Fitzpatrick | 0e84fc7 | 2015-02-18 14:12:22 -0800 | [diff] [blame] | 745 | }) |
| 746 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 747 | Name: "nacl-amd64p32", |
| 748 | HostType: "host-nacl-kube", |
| 749 | numTestHelpers: 3, |
| 750 | env: []string{"GOOS=nacl", "GOARCH=amd64p32", "GOHOSTOS=linux", "GOHOSTARCH=amd64"}, |
Evan Brown | 6cd016f | 2016-01-26 15:13:47 -0800 | [diff] [blame] | 751 | }) |
| 752 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | d621541 | 2016-12-14 22:41:25 +0000 | [diff] [blame] | 753 | Name: "openbsd-amd64-60", |
Brad Fitzpatrick | 4776272 | 2016-12-10 19:10:49 +0000 | [diff] [blame] | 754 | HostType: "host-openbsd-amd64-60", |
| 755 | numTestHelpers: 2, |
| 756 | numTryTestHelpers: 5, |
| 757 | }) |
| 758 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | d621541 | 2016-12-14 22:41:25 +0000 | [diff] [blame] | 759 | Name: "openbsd-386-60", |
| 760 | HostType: "host-openbsd-386-60", |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 761 | numTestHelpers: 2, |
| 762 | numTryTestHelpers: 5, |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 763 | }) |
| 764 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 765 | Name: "netbsd-amd64-gce", |
| 766 | HostType: "host-netbsd-gce", |
| 767 | numTestHelpers: 1, |
Brad Fitzpatrick | 011a895 | 2016-04-04 18:03:49 +0000 | [diff] [blame] | 768 | }) |
| 769 | |
| 770 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 771 | Name: "plan9-386", |
| 772 | HostType: "host-plan9-386-gce", |
Brad Fitzpatrick | 94d0141 | 2016-09-13 22:45:48 +0000 | [diff] [blame] | 773 | numTestHelpers: 1, |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 774 | }) |
Brad Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 775 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 776 | Name: "windows-amd64-gce", |
| 777 | HostType: "host-windows-gce", |
| 778 | env: []string{"GOARCH=amd64", "GOHOSTARCH=amd64"}, |
| 779 | numTestHelpers: 1, |
| 780 | numTryTestHelpers: 5, |
Brad Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 781 | }) |
| 782 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 783 | Name: "windows-amd64-race", |
| 784 | HostType: "host-windows-gce", |
| 785 | Notes: "Only runs -race tests (./race.bat)", |
| 786 | env: []string{"GOARCH=amd64", "GOHOSTARCH=amd64"}, |
Brad Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 787 | }) |
| 788 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 789 | Name: "windows-386-gce", |
| 790 | HostType: "host-windows-gce", |
| 791 | env: []string{"GOARCH=386", "GOHOSTARCH=386"}, |
| 792 | numTestHelpers: 1, |
| 793 | numTryTestHelpers: 5, |
Brad Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 794 | }) |
David Crawshaw | 66c36dd | 2015-04-23 10:23:22 -0400 | [diff] [blame] | 795 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 796 | Name: "darwin-amd64-10_8", |
| 797 | HostType: "host-darwin-10_8", |
Brad Fitzpatrick | 8b77adf | 2016-08-30 19:55:08 +0000 | [diff] [blame] | 798 | }) |
| 799 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 800 | Name: "darwin-amd64-10_10", |
| 801 | HostType: "host-darwin-10_10", |
Brad Fitzpatrick | 8b77adf | 2016-08-30 19:55:08 +0000 | [diff] [blame] | 802 | }) |
Brad Fitzpatrick | d83028e | 2016-09-07 05:41:02 +0000 | [diff] [blame] | 803 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 94d0141 | 2016-09-13 22:45:48 +0000 | [diff] [blame] | 804 | Name: "darwin-amd64-10_11", |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 805 | HostType: "host-darwin-10_11", |
Brad Fitzpatrick | 94d0141 | 2016-09-13 22:45:48 +0000 | [diff] [blame] | 806 | numTestHelpers: 2, |
| 807 | numTryTestHelpers: 3, |
Brad Fitzpatrick | d83028e | 2016-09-07 05:41:02 +0000 | [diff] [blame] | 808 | }) |
Brad Fitzpatrick | 409147c | 2017-01-18 22:45:12 +0000 | [diff] [blame] | 809 | addBuilder(BuildConfig{ |
| 810 | Name: "darwin-amd64-10_12", |
| 811 | HostType: "host-darwin-10_12", |
| 812 | }) |
Brad Fitzpatrick | 8b77adf | 2016-08-30 19:55:08 +0000 | [diff] [blame] | 813 | |
David Crawshaw | e29c0bb | 2015-07-22 10:54:18 -0400 | [diff] [blame] | 814 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 815 | Name: "android-arm-sdk19", |
| 816 | Notes: "Android ARM device running android-19 (KitKat 4.4), attatched to Mac Mini", |
| 817 | env: []string{"GOOS=android", "GOARCH=arm"}, |
David Crawshaw | e29c0bb | 2015-07-22 10:54:18 -0400 | [diff] [blame] | 818 | }) |
| 819 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 820 | Name: "android-arm64-sdk21", |
| 821 | Notes: "Android arm64 device using the android-21 toolchain, attatched to Mac Mini", |
| 822 | env: []string{"GOOS=android", "GOARCH=arm64"}, |
David Crawshaw | 1a1fe1e | 2015-11-20 11:08:04 -0500 | [diff] [blame] | 823 | }) |
| 824 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 825 | Name: "android-386-sdk21", |
| 826 | Notes: "Android 386 device using the android-21 toolchain, attatched to Mac Mini", |
| 827 | env: []string{"GOOS=android", "GOARCH=386"}, |
David Crawshaw | 1a1fe1e | 2015-11-20 11:08:04 -0500 | [diff] [blame] | 828 | }) |
| 829 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 830 | Name: "android-amd64-sdk21", |
| 831 | Notes: "Android amd64 device using the android-21 toolchain, attatched to Mac Mini", |
| 832 | env: []string{"GOOS=android", "GOARCH=amd64"}, |
David Crawshaw | 1a1fe1e | 2015-11-20 11:08:04 -0500 | [diff] [blame] | 833 | }) |
| 834 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 835 | Name: "darwin-arm-a5ios", |
| 836 | Notes: "iPhone 4S (A5 processor), via a Mac Mini; owned by crawshaw", |
| 837 | env: []string{"GOARCH=arm", "GOHOSTARCH=amd64"}, |
David Crawshaw | e078c6f | 2015-04-29 08:54:19 -0400 | [diff] [blame] | 838 | }) |
David Crawshaw | e078c6f | 2015-04-29 08:54:19 -0400 | [diff] [blame] | 839 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 840 | Name: "darwin-arm64-a7ios", |
| 841 | Notes: "iPad Mini 3 (A7 processor), via a Mac Mini; owned by crawshaw", |
| 842 | env: []string{"GOARCH=arm64", "GOHOSTARCH=amd64"}, |
| 843 | }) |
| 844 | |
| 845 | addBuilder(BuildConfig{ |
| 846 | Name: "solaris-amd64-smartosbuildlet", |
| 847 | HostType: "host-solaris-amd64", |
David Crawshaw | e078c6f | 2015-04-29 08:54:19 -0400 | [diff] [blame] | 848 | }) |
Brad Fitzpatrick | c2a36fd | 2016-03-01 04:49:24 +0000 | [diff] [blame] | 849 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | f8a3106 | 2016-10-06 20:30:58 +0000 | [diff] [blame] | 850 | Name: "linux-ppc64-buildlet", |
| 851 | HostType: "host-linux-ppc64-osu", |
| 852 | FlakyNet: true, |
| 853 | }) |
| 854 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 855 | Name: "linux-ppc64le-buildlet", |
| 856 | HostType: "host-linux-ppc64le-osu", |
| 857 | FlakyNet: true, |
Brad Fitzpatrick | c2a36fd | 2016-03-01 04:49:24 +0000 | [diff] [blame] | 858 | }) |
| 859 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 860 | Name: "linux-arm64-buildlet", |
| 861 | HostType: "host-linux-arm64-linaro", |
| 862 | FlakyNet: true, |
Brad Fitzpatrick | c2a36fd | 2016-03-01 04:49:24 +0000 | [diff] [blame] | 863 | }) |
| 864 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 31e2bfa | 2016-11-03 17:35:15 +0000 | [diff] [blame] | 865 | Name: "linux-mips", |
| 866 | HostType: "host-linux-mips", |
| 867 | }) |
| 868 | addBuilder(BuildConfig{ |
| 869 | Name: "linux-mipsle", |
| 870 | HostType: "host-linux-mipsle", |
| 871 | }) |
| 872 | addBuilder(BuildConfig{ |
| 873 | Name: "linux-mips64", |
| 874 | HostType: "host-linux-mips64", |
| 875 | }) |
| 876 | addBuilder(BuildConfig{ |
| 877 | Name: "linux-mips64le", |
| 878 | HostType: "host-linux-mips64le", |
| 879 | }) |
| 880 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | c2a36fd | 2016-03-01 04:49:24 +0000 | [diff] [blame] | 881 | Name: "linux-s390x-ibm", |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 882 | HostType: "host-linux-s390x", |
Brad Fitzpatrick | 94d0141 | 2016-09-13 22:45:48 +0000 | [diff] [blame] | 883 | numTestHelpers: 0, |
Brad Fitzpatrick | c2a36fd | 2016-03-01 04:49:24 +0000 | [diff] [blame] | 884 | }) |
Brad Fitzpatrick | 30761a0 | 2016-04-08 19:40:23 +0000 | [diff] [blame] | 885 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 886 | Name: "linux-s390x-crosscompile", |
| 887 | HostType: "host-s390x-cross-kube", |
| 888 | Notes: "s390x cross-compile builder for releases; doesn't run tests", |
| 889 | CompileOnly: true, |
| 890 | TryOnly: true, // but not in trybot set for now |
Brad Fitzpatrick | 9702f6a | 2016-08-30 20:32:33 +0000 | [diff] [blame] | 891 | env: []string{ |
Brad Fitzpatrick | 9702f6a | 2016-08-30 20:32:33 +0000 | [diff] [blame] | 892 | "CGO_ENABLED=1", |
| 893 | "GOARCH=s390x", |
| 894 | "GOHOSTARCH=amd64", |
| 895 | "CC_FOR_TARGET=s390x-linux-gnu-gcc", |
| 896 | }, |
| 897 | }) |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 898 | } |
Brad Fitzpatrick | 9702f6a | 2016-08-30 20:32:33 +0000 | [diff] [blame] | 899 | |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 900 | func (c BuildConfig) isMobile() bool { |
| 901 | return strings.HasPrefix(c.Name, "android-") || strings.HasPrefix(c.Name, "darwin-arm") |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 902 | } |
| 903 | |
| 904 | func addBuilder(c BuildConfig) { |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 905 | if c.Name == "" { |
| 906 | panic("empty name") |
| 907 | } |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 908 | if c.isMobile() && c.HostType == "" { |
| 909 | htyp := "host-" + c.Name |
| 910 | if _, ok := Hosts[htyp]; !ok { |
| 911 | Hosts[htyp] = &HostConfig{ |
| 912 | HostType: htyp, |
| 913 | IsReverse: true, |
| 914 | goBootstrapURLTmpl: "https://storage.googleapis.com/$BUCKET/go1.4-darwin-amd64.tar.gz", |
| 915 | ReverseAliases: []string{c.Name}, |
| 916 | } |
| 917 | c.HostType = htyp |
| 918 | } |
| 919 | } |
| 920 | if c.HostType == "" { |
| 921 | panic(fmt.Sprintf("missing HostType for builder %q", c.Name)) |
| 922 | } |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 923 | if _, dup := Builders[c.Name]; dup { |
| 924 | panic("dup name") |
| 925 | } |
Brad Fitzpatrick | 328c9b8 | 2016-09-21 21:27:37 +0000 | [diff] [blame] | 926 | if _, ok := Hosts[c.HostType]; !ok { |
| 927 | panic(fmt.Sprintf("undefined HostType %q for builder %q", c.HostType, c.Name)) |
Brad Fitzpatrick | 6925ce8 | 2015-09-08 15:18:47 -0700 | [diff] [blame] | 928 | } |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 929 | Builders[c.Name] = c |
| 930 | } |