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 | 83455d1 | 2015-02-19 16:14:20 -0800 | [diff] [blame] | 9 | import "strings" |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 10 | |
| 11 | // Builders are the different build configurations. |
| 12 | // The keys are like "darwin-amd64" or "linux-386-387". |
| 13 | // This map should not be modified by other packages. |
| 14 | var Builders = map[string]BuildConfig{} |
| 15 | |
David Crawshaw | 66c36dd | 2015-04-23 10:23:22 -0400 | [diff] [blame^] | 16 | // A BuildConfig describes how to run a builder. |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 17 | type BuildConfig struct { |
| 18 | // Name is the unique name of the builder, in the form of |
| 19 | // "darwin-386" or "linux-amd64-race". |
| 20 | Name string |
| 21 | |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 22 | VMImage string // e.g. "openbsd-amd64-56" |
| 23 | machineType string // optional GCE instance type |
Brad Fitzpatrick | 20d8483 | 2015-01-21 10:03:07 -0800 | [diff] [blame] | 24 | Go14URL string // URL to built Go 1.4 tar.gz |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 25 | buildletURL string // optional override buildlet URL |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 26 | |
David Crawshaw | 66c36dd | 2015-04-23 10:23:22 -0400 | [diff] [blame^] | 27 | IsReverse bool // if true, only use the reverse buildlet pool |
Brad Fitzpatrick | 1c6d916 | 2015-03-20 16:14:52 -0700 | [diff] [blame] | 28 | RegularDisk bool // if true, use spinning disk instead of SSD |
| 29 | |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 30 | env []string // extra environment ("key=value") pairs |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 31 | } |
| 32 | |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 33 | func (c *BuildConfig) Env() []string { return append([]string(nil), c.env...) } |
| 34 | |
Brad Fitzpatrick | f3c0193 | 2015-01-15 16:29:16 -0800 | [diff] [blame] | 35 | func (c *BuildConfig) GOOS() string { return c.Name[:strings.Index(c.Name, "-")] } |
| 36 | |
| 37 | func (c *BuildConfig) GOARCH() string { |
| 38 | arch := c.Name[strings.Index(c.Name, "-")+1:] |
| 39 | i := strings.Index(arch, "-") |
| 40 | if i == -1 { |
| 41 | return arch |
| 42 | } |
| 43 | return arch[:i] |
| 44 | } |
| 45 | |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 46 | // BuildletBinaryURL returns the public URL of this builder's buildlet. |
| 47 | func (c *BuildConfig) BuildletBinaryURL() string { |
| 48 | if c.buildletURL != "" { |
| 49 | return c.buildletURL |
| 50 | } |
| 51 | return "http://storage.googleapis.com/go-builder-data/buildlet." + c.GOOS() + "-" + c.GOARCH() |
| 52 | } |
| 53 | |
Brad Fitzpatrick | f8c2484 | 2015-01-16 09:54:03 -0800 | [diff] [blame] | 54 | // AllScript returns the relative path to the operating system's script to |
| 55 | // do the build and run its standard set of tests. |
| 56 | // Example values are "src/all.bash", "src/all.bat", "src/all.rc". |
| 57 | func (c *BuildConfig) AllScript() string { |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 58 | if strings.HasSuffix(c.Name, "-race") { |
| 59 | if strings.HasPrefix(c.Name, "windows-") { |
| 60 | return "src/race.bat" |
| 61 | } |
| 62 | return "src/race.bash" |
| 63 | } |
Brad Fitzpatrick | f8c2484 | 2015-01-16 09:54:03 -0800 | [diff] [blame] | 64 | if strings.HasPrefix(c.Name, "windows-") { |
| 65 | return "src/all.bat" |
| 66 | } |
| 67 | if strings.HasPrefix(c.Name, "plan9-") { |
| 68 | return "src/all.rc" |
| 69 | } |
Brad Fitzpatrick | 0e84fc7 | 2015-02-18 14:12:22 -0800 | [diff] [blame] | 70 | if strings.HasPrefix(c.Name, "nacl-") { |
| 71 | return "src/nacltest.bash" |
| 72 | } |
Brad Fitzpatrick | f8c2484 | 2015-01-16 09:54:03 -0800 | [diff] [blame] | 73 | return "src/all.bash" |
| 74 | } |
| 75 | |
Andrew Gerrand | f83f3e4 | 2015-02-02 12:05:01 +0000 | [diff] [blame] | 76 | // MakeScript returns the relative path to the operating system's script to |
| 77 | // do the build. |
| 78 | // Example values are "src/make.bash", "src/make.bat", "src/make.rc". |
| 79 | func (c *BuildConfig) MakeScript() string { |
| 80 | if strings.HasPrefix(c.Name, "windows-") { |
| 81 | return "src/make.bat" |
| 82 | } |
| 83 | if strings.HasPrefix(c.Name, "plan9-") { |
| 84 | return "src/make.rc" |
| 85 | } |
| 86 | return "src/make.bash" |
| 87 | } |
| 88 | |
| 89 | // GorootFinal returns the default install location for |
| 90 | // releases for this platform. |
| 91 | func (c *BuildConfig) GorootFinal() string { |
| 92 | if strings.HasPrefix(c.Name, "windows-") { |
| 93 | return "c:\\go" |
| 94 | } |
| 95 | return "/usr/local/go" |
| 96 | } |
| 97 | |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 98 | // MachineType returns the GCE machine type to use for this builder. |
| 99 | func (c *BuildConfig) MachineType() string { |
| 100 | if v := c.machineType; v != "" { |
| 101 | return v |
| 102 | } |
| 103 | return "n1-highcpu-2" |
| 104 | } |
| 105 | |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 106 | func init() { |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 107 | addBuilder(BuildConfig{ |
Bill Thiede | 222a9c0 | 2015-01-21 21:16:54 -0800 | [diff] [blame] | 108 | Name: "freebsd-amd64-gce93", |
| 109 | VMImage: "freebsd-amd64-gce93", |
| 110 | machineType: "n1-highcpu-2", |
| 111 | Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-freebsd-amd64.tar.gz", |
| 112 | }) |
| 113 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 114 | Name: "freebsd-amd64-gce101", |
| 115 | VMImage: "freebsd-amd64-gce101", |
| 116 | machineType: "n1-highcpu-2", |
| 117 | Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-freebsd-amd64.tar.gz", |
| 118 | env: []string{"CC=clang"}, |
| 119 | }) |
| 120 | addBuilder(BuildConfig{ |
| 121 | Name: "freebsd-amd64-race", |
| 122 | VMImage: "freebsd-amd64-gce101", |
| 123 | machineType: "n1-highcpu-4", |
| 124 | Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-freebsd-amd64.tar.gz", |
| 125 | env: []string{"CC=clang"}, |
| 126 | }) |
| 127 | addBuilder(BuildConfig{ |
| 128 | Name: "freebsd-386-gce101", |
| 129 | VMImage: "freebsd-amd64-gce101", |
| 130 | machineType: "n1-highcpu-2", |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 131 | buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.freebsd-amd64", |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 132 | Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-freebsd-amd64.tar.gz", |
Brad Fitzpatrick | 50ba0cb | 2015-01-27 14:22:21 -0800 | [diff] [blame] | 133 | // TODO(bradfitz): setting GOHOSTARCH=386 should work |
| 134 | // to eliminate some unnecessary work (it works on |
| 135 | // Linux), but fails on FreeBSD with: |
| 136 | // ##### ../misc/cgo/testso |
| 137 | // Shared object "libcgosotest.so" not found, required by "main" |
| 138 | // Maybe this is a clang thing? We'll see when we do linux clang too. |
| 139 | env: []string{"GOARCH=386", "CC=clang"}, |
| 140 | }) |
| 141 | addBuilder(BuildConfig{ |
| 142 | Name: "linux-386", |
| 143 | VMImage: "linux-buildlet-std", |
| 144 | buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64", |
| 145 | env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOARCH=386", "GOHOSTARCH=386"}, |
| 146 | }) |
| 147 | addBuilder(BuildConfig{ |
| 148 | Name: "linux-386-387", |
| 149 | VMImage: "linux-buildlet-std", |
| 150 | buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64", |
| 151 | env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOARCH=386", "GOHOSTARCH=386", "GO386=387"}, |
| 152 | }) |
| 153 | addBuilder(BuildConfig{ |
| 154 | Name: "linux-amd64", |
| 155 | VMImage: "linux-buildlet-std", |
| 156 | env: []string{"GOROOT_BOOTSTRAP=/go1.4"}, |
| 157 | }) |
| 158 | addBuilder(BuildConfig{ |
| 159 | Name: "linux-amd64-nocgo", |
| 160 | VMImage: "linux-buildlet-std", |
| 161 | env: []string{ |
| 162 | "GOROOT_BOOTSTRAP=/go1.4", |
| 163 | "CGO_ENABLED=0", |
| 164 | // This USER=root was required for Docker-based builds but probably isn't required |
| 165 | // in the VM anymore, since the buildlet probably already has this in its environment. |
| 166 | // (It was required because without cgo, it couldn't find the username) |
| 167 | "USER=root", |
| 168 | }, |
| 169 | }) |
| 170 | addBuilder(BuildConfig{ |
| 171 | Name: "linux-amd64-noopt", |
| 172 | VMImage: "linux-buildlet-std", |
| 173 | env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GO_GCFLAGS=-N -l"}, |
| 174 | }) |
| 175 | addBuilder(BuildConfig{ |
| 176 | Name: "linux-amd64-race", |
| 177 | VMImage: "linux-buildlet-std", |
| 178 | machineType: "n1-highcpu-4", |
| 179 | env: []string{"GOROOT_BOOTSTRAP=/go1.4"}, |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 180 | }) |
| 181 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | a0a155e | 2015-02-12 19:45:02 -0800 | [diff] [blame] | 182 | Name: "linux-386-clang", |
| 183 | VMImage: "linux-buildlet-clang", |
| 184 | buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64", |
Brad Fitzpatrick | 4d7595c | 2015-02-13 16:32:21 -0800 | [diff] [blame] | 185 | env: []string{"GOROOT_BOOTSTRAP=/go1.4", "CC=/usr/bin/clang", "GOHOSTARCH=386"}, |
Brad Fitzpatrick | a0a155e | 2015-02-12 19:45:02 -0800 | [diff] [blame] | 186 | }) |
| 187 | addBuilder(BuildConfig{ |
| 188 | Name: "linux-amd64-clang", |
| 189 | VMImage: "linux-buildlet-clang", |
| 190 | env: []string{"GOROOT_BOOTSTRAP=/go1.4", "CC=/usr/bin/clang"}, |
| 191 | }) |
| 192 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | f0728e3 | 2015-02-13 19:01:32 -0800 | [diff] [blame] | 193 | Name: "linux-386-sid", |
| 194 | VMImage: "linux-buildlet-sid", |
| 195 | buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64", |
| 196 | env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOHOSTARCH=386"}, |
| 197 | }) |
| 198 | addBuilder(BuildConfig{ |
| 199 | Name: "linux-amd64-sid", |
| 200 | VMImage: "linux-buildlet-sid", |
| 201 | env: []string{"GOROOT_BOOTSTRAP=/go1.4"}, |
| 202 | }) |
| 203 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | dfe8286 | 2015-03-01 09:23:57 -0800 | [diff] [blame] | 204 | Name: "linux-arm-qemu", |
| 205 | VMImage: "linux-buildlet-arm", |
| 206 | env: []string{"GOROOT_BOOTSTRAP=/go1.4", "IN_QEMU=1"}, |
| 207 | }) |
| 208 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 0e84fc7 | 2015-02-18 14:12:22 -0800 | [diff] [blame] | 209 | Name: "nacl-386", |
Brad Fitzpatrick | 38c2c75 | 2015-03-24 18:50:33 -0700 | [diff] [blame] | 210 | VMImage: "linux-buildlet-nacl-v2", |
Brad Fitzpatrick | 0e84fc7 | 2015-02-18 14:12:22 -0800 | [diff] [blame] | 211 | buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64", |
| 212 | env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOOS=nacl", "GOARCH=386", "GOHOSTOS=linux", "GOHOSTARCH=amd64"}, |
| 213 | }) |
| 214 | addBuilder(BuildConfig{ |
| 215 | Name: "nacl-amd64p32", |
Brad Fitzpatrick | 38c2c75 | 2015-03-24 18:50:33 -0700 | [diff] [blame] | 216 | VMImage: "linux-buildlet-nacl-v2", |
Brad Fitzpatrick | 0e84fc7 | 2015-02-18 14:12:22 -0800 | [diff] [blame] | 217 | buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.linux-amd64", |
| 218 | env: []string{"GOROOT_BOOTSTRAP=/go1.4", "GOOS=nacl", "GOARCH=amd64p32", "GOHOSTOS=linux", "GOHOSTARCH=amd64"}, |
| 219 | }) |
| 220 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 221 | Name: "openbsd-amd64-gce56", |
| 222 | VMImage: "openbsd-amd64-56", |
| 223 | machineType: "n1-highcpu-2", |
Brad Fitzpatrick | 20d8483 | 2015-01-21 10:03:07 -0800 | [diff] [blame] | 224 | Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-openbsd-amd64.tar.gz", |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 225 | }) |
| 226 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | f6a4a4a | 2015-01-22 14:11:10 -0800 | [diff] [blame] | 227 | Name: "openbsd-386-gce56", |
| 228 | VMImage: "openbsd-386-56", |
| 229 | machineType: "n1-highcpu-2", |
| 230 | Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-openbsd-386.tar.gz", |
| 231 | }) |
| 232 | addBuilder(BuildConfig{ |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 233 | Name: "plan9-386-gcepartial", |
Brad Fitzpatrick | dfe8286 | 2015-03-01 09:23:57 -0800 | [diff] [blame] | 234 | VMImage: "plan9-386-v2", |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 235 | Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-plan9-386.tar.gz", |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 236 | // It's named "partial" because the buildlet sets |
| 237 | // GOTESTONLY=std to stop after the "go test std" |
| 238 | // tests because it's so slow otherwise. |
Brad Fitzpatrick | 32d0520 | 2015-01-21 15:15:48 -0800 | [diff] [blame] | 239 | env: []string{"GOTESTONLY=std"}, |
| 240 | |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 241 | // We *were* using n1-standard-1 because Plan 9 can only |
| 242 | // reliably use a single CPU. Using 2 or 4 and we see |
| 243 | // test failures. See: |
| 244 | // https://golang.org/issue/8393 |
| 245 | // https://golang.org/issue/9491 |
Brad Fitzpatrick | dfe8286 | 2015-03-01 09:23:57 -0800 | [diff] [blame] | 246 | // n1-standard-1 has 3.6 GB of memory which WAS (see below) |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 247 | // overkill (userspace probably only sees 2GB anyway), |
| 248 | // but it's the cheapest option. And plenty to keep |
| 249 | // our ~250 MB of inputs+outputs in its ramfs. |
| 250 | // |
| 251 | // But the docs says "For the n1 series of machine |
| 252 | // types, a virtual CPU is implemented as a single |
| 253 | // hyperthread on a 2.6GHz Intel Sandy Bridge Xeon or |
| 254 | // Intel Ivy Bridge Xeon (or newer) processor. This |
| 255 | // means that the n1-standard-2 machine type will see |
| 256 | // a whole physical core." |
| 257 | // |
Brad Fitzpatrick | dfe8286 | 2015-03-01 09:23:57 -0800 | [diff] [blame] | 258 | // ... so we used n1-highcpu-2 (1.80 RAM, still |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 259 | // plenty), just so we can get 1 whole core for the |
| 260 | // single-core Plan 9. It will see 2 virtual cores and |
| 261 | // only use 1, but we hope that 1 will be more powerful |
| 262 | // and we'll stop timing out on tests. |
Brad Fitzpatrick | dfe8286 | 2015-03-01 09:23:57 -0800 | [diff] [blame] | 263 | // |
| 264 | // But then with the toolchain conversion to Go and |
| 265 | // using ramfs, it turns out we need more memory |
| 266 | // anyway, so use n1-highcpu-4. |
| 267 | machineType: "n1-highcpu-4", |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 268 | }) |
Brad Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 269 | addBuilder(BuildConfig{ |
| 270 | Name: "windows-amd64-gce", |
Brad Fitzpatrick | 0c0bd36 | 2015-03-22 10:50:04 -0700 | [diff] [blame] | 271 | VMImage: "windows-buildlet-v2", |
Brad Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 272 | machineType: "n1-highcpu-2", |
| 273 | Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-windows-amd64.tar.gz", |
Brad Fitzpatrick | 1c6d916 | 2015-03-20 16:14:52 -0700 | [diff] [blame] | 274 | RegularDisk: true, |
Brad Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 275 | env: []string{"GOARCH=amd64", "GOHOSTARCH=amd64"}, |
| 276 | }) |
| 277 | addBuilder(BuildConfig{ |
| 278 | Name: "windows-amd64-race", |
Brad Fitzpatrick | 0c0bd36 | 2015-03-22 10:50:04 -0700 | [diff] [blame] | 279 | VMImage: "windows-buildlet-v2", |
Brad Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 280 | machineType: "n1-highcpu-4", |
| 281 | Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-windows-amd64.tar.gz", |
Brad Fitzpatrick | 1c6d916 | 2015-03-20 16:14:52 -0700 | [diff] [blame] | 282 | RegularDisk: true, |
Brad Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 283 | env: []string{"GOARCH=amd64", "GOHOSTARCH=amd64"}, |
| 284 | }) |
| 285 | addBuilder(BuildConfig{ |
| 286 | Name: "windows-386-gce", |
Brad Fitzpatrick | 0c0bd36 | 2015-03-22 10:50:04 -0700 | [diff] [blame] | 287 | VMImage: "windows-buildlet-v2", |
Brad Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 288 | machineType: "n1-highcpu-2", |
| 289 | buildletURL: "http://storage.googleapis.com/go-builder-data/buildlet.windows-amd64", |
| 290 | Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-windows-386.tar.gz", |
Brad Fitzpatrick | 1c6d916 | 2015-03-20 16:14:52 -0700 | [diff] [blame] | 291 | RegularDisk: true, |
Brad Fitzpatrick | cc587d4 | 2015-02-06 17:32:15 -0800 | [diff] [blame] | 292 | env: []string{"GOARCH=386", "GOHOSTARCH=386"}, |
| 293 | }) |
David Crawshaw | 66c36dd | 2015-04-23 10:23:22 -0400 | [diff] [blame^] | 294 | addBuilder(BuildConfig{ |
| 295 | Name: "darwin-amd64", |
| 296 | Go14URL: "https://storage.googleapis.com/go-builder-data/go1.4-darwin-amd64.tar.gz", |
| 297 | IsReverse: true, |
| 298 | }) |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | func addBuilder(c BuildConfig) { |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 302 | if c.Name == "" { |
| 303 | panic("empty name") |
| 304 | } |
| 305 | if _, dup := Builders[c.Name]; dup { |
| 306 | panic("dup name") |
| 307 | } |
David Crawshaw | 66c36dd | 2015-04-23 10:23:22 -0400 | [diff] [blame^] | 308 | if c.VMImage == "" && !c.IsReverse { |
Brad Fitzpatrick | 83455d1 | 2015-02-19 16:14:20 -0800 | [diff] [blame] | 309 | panic("empty VMImage") |
Brad Fitzpatrick | 46cc759 | 2015-01-15 12:46:22 -0800 | [diff] [blame] | 310 | } |
| 311 | Builders[c.Name] = c |
| 312 | } |