Skip to content

Commit 90d5e7c

Browse files
committed
cmd/release, dashboard: implement builder plan for Go 1.16
See https://golang.org/issues/40561#issuecomment-731482962 for the plan description and rationale. Add new builder definitions that are needed for the plan. Don't rely on generic builder name like "linux-amd64" to avoid a repeat of golang.org/issue/31293; use a specific builder name instead. Remove support and test cases for Go 1.13, it's unsupported per release policy. For golang/go#40561. Change-Id: I070744e15be9f1932d649a27ee7e4599e467553f Reviewed-on: https://go-review.googlesource.com/c/build/+/276034 Trust: Dmitri Shuralyov <[email protected]> Run-TryBot: Dmitri Shuralyov <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Carlos Amedee <[email protected]>
1 parent 0949104 commit 90d5e7c

File tree

3 files changed

+102
-28
lines changed

3 files changed

+102
-28
lines changed

cmd/release/release.go

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,29 +151,30 @@ var builds = []*Build{
151151
Builder: "linux-amd64",
152152
},
153153
{
154+
GoQuery: ">= go1.16beta1",
154155
OS: "linux",
155156
Arch: "386",
156-
Builder: "linux-386",
157+
Builder: "linux-386-stretch",
157158
},
158159
{
160+
GoQuery: ">= go1.16beta1",
159161
OS: "linux",
160162
Arch: "arm",
161-
Builder: "linux-arm",
162-
Goarm: 6, // for compatibility with all Raspberry Pi models.
163-
// The tests take too long for the release packaging.
164-
// Much of the time the whole buildlet times out.
165-
SkipTests: true,
163+
Builder: "linux-arm-aws",
164+
Goarm: 6, // For compatibility with all Raspberry Pi models.
166165
},
167166
{
167+
GoQuery: ">= go1.16beta1",
168168
OS: "linux",
169169
Arch: "amd64",
170170
Race: true,
171-
Builder: "linux-amd64-jessie", // using Jessie for at least [Go 1.11, Go 1.13] due to golang.org/issue/31293
171+
Builder: "linux-amd64-stretch", // Using Stretch as of Go 1.16 because Jessie LTS has ended (golang.org/issue/40561#issuecomment-731482962).
172172
},
173173
{
174+
GoQuery: ">= go1.16beta1",
174175
OS: "linux",
175176
Arch: "arm64",
176-
Builder: "linux-arm64-packet",
177+
Builder: "linux-arm64-aws",
177178
},
178179
{
179180
GoQuery: ">= go1.15rc2", // See #40563.
@@ -223,6 +224,35 @@ var builds = []*Build{
223224
},
224225

225226
// Older builds.
227+
{
228+
GoQuery: "< go1.16beta1",
229+
OS: "linux",
230+
Arch: "386",
231+
Builder: "linux-386-jessie",
232+
},
233+
{
234+
GoQuery: "< go1.16beta1",
235+
OS: "linux",
236+
Arch: "arm",
237+
Builder: "linux-arm",
238+
Goarm: 6, // For compatibility with all Raspberry Pi models.
239+
// The tests take too long for the release packaging.
240+
// Much of the time the whole buildlet times out.
241+
SkipTests: true,
242+
},
243+
{
244+
GoQuery: "< go1.16beta1",
245+
OS: "linux",
246+
Arch: "amd64",
247+
Race: true,
248+
Builder: "linux-amd64-jessie", // Using Jessie for Go 1.11 through Go 1.15 inclusive due to golang.org/issue/31293.
249+
},
250+
{
251+
GoQuery: "< go1.16beta1",
252+
OS: "linux",
253+
Arch: "arm64",
254+
Builder: "linux-arm64-packet",
255+
},
226256
{
227257
GoQuery: "< go1.15",
228258
OS: "freebsd",
@@ -960,9 +990,9 @@ func minSupportedMacOSVersion(goVer string) string {
960990
// TODO(amedee,dmitshur,golang.org/issue/40558): Use a version package to compare versions of Go.
961991

962992
// The minimum supported version of macOS with each version of go:
963-
// go1.13 - macOS 10.11
964993
// go1.14 - macOS 10.11
965994
// go1.15 - macOS 10.12
995+
// go1.16 - macOS 10.12
966996
minMacVersion := "10.12"
967997
if match("< go1.15", goVer) {
968998
minMacVersion = "10.11"
@@ -979,14 +1009,18 @@ func match(query, goVer string) bool {
9791009
switch query {
9801010
case "": // A special case to make the zero Build.GoQuery value useful.
9811011
return true
1012+
case ">= go1.16beta1":
1013+
return !strings.HasPrefix(goVer, "go1.15") && !strings.HasPrefix(goVer, "go1.14")
1014+
case "< go1.16beta1":
1015+
return strings.HasPrefix(goVer, "go1.15") || strings.HasPrefix(goVer, "go1.14")
9821016
case ">= go1.15rc2":
9831017
// By the time this code is added, Go 1.15 RC 1 has already been released and
9841018
// won't be modified, that's why we only care about matching RC 2 and onwards.
9851019
// (We could've just done ">= go1.15", but that could be misleading in future.)
9861020
return goVer != "go1.15rc1" && !strings.HasPrefix(goVer, "go1.15beta") &&
987-
!strings.HasPrefix(goVer, "go1.14") && !strings.HasPrefix(goVer, "go1.13")
1021+
!strings.HasPrefix(goVer, "go1.14")
9881022
case "< go1.15":
989-
return strings.HasPrefix(goVer, "go1.14") || strings.HasPrefix(goVer, "go1.13")
1023+
return strings.HasPrefix(goVer, "go1.14")
9901024
default:
9911025
panic(fmt.Errorf("match: query %q is not supported", query))
9921026
}

cmd/release/release_test.go

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,20 @@ func TestTestOnlyBuildsDontSkipTests(t *testing.T) {
4242

4343
func TestMinSupportedMacOSVersion(t *testing.T) {
4444
testCases := []struct {
45-
desc string
4645
goVer string
4746
wantMacOS string
4847
}{
49-
{"minor_release_13", "go1.13", "10.11"},
50-
{"minor_release_14", "go1.14", "10.11"},
51-
{"rc_release_13", "go1.13rc1", "10.11"},
52-
{"beta_release_13", "go1.13beta1", "10.11"},
53-
{"minor_release_15", "go1.15", "10.12"},
54-
{"patch_release_15", "go1.15.1", "10.12"},
48+
{"go1.14", "10.11"},
49+
{"go1.14.14", "10.11"},
50+
{"go1.15", "10.12"},
51+
{"go1.15.7", "10.12"},
52+
{"go1.16beta1", "10.12"},
53+
{"go1.16rc1", "10.12"},
54+
{"go1.16", "10.12"},
55+
{"go1.16.1", "10.12"},
5556
}
5657
for _, tc := range testCases {
57-
t.Run(tc.desc, func(t *testing.T) {
58+
t.Run(tc.goVer, func(t *testing.T) {
5859
got := minSupportedMacOSVersion(tc.goVer)
5960
if got != tc.wantMacOS {
6061
t.Errorf("got %s; want %s", got, tc.wantMacOS)
@@ -63,7 +64,7 @@ func TestMinSupportedMacOSVersion(t *testing.T) {
6364
}
6465
}
6566

66-
func TestFreeBSDBuilder(t *testing.T) {
67+
func TestBuilderSelectionPerGoVersion(t *testing.T) {
6768
matchBuilds := func(target, goVer string) (matched []*Build) {
6869
for _, b := range builds {
6970
if b.String() != target || !match(b.GoQuery, goVer) {
@@ -79,27 +80,36 @@ func TestFreeBSDBuilder(t *testing.T) {
7980
target string
8081
wantBuilder string
8182
}{
82-
// Go 1.14.x and 1.13.x still use the FreeBSD 11.1 builder.
83-
{"go1.13.55", "freebsd-amd64", "freebsd-amd64-11_1"},
84-
{"go1.13.55", "freebsd-386", "freebsd-386-11_1"},
83+
// Go 1.15.x and 1.14.x still use the Jessie builders.
84+
{"go1.14.55", "linux-amd64", "linux-amd64-jessie"},
85+
{"go1.15.55", "linux-386", "linux-386-jessie"},
86+
// Go 1.16 starts to use the the Stretch builders.
87+
{"go1.16", "linux-amd64", "linux-amd64-stretch"},
88+
{"go1.16", "linux-386", "linux-386-stretch"},
89+
90+
// Go 1.15.x and 1.14.x still use the Packet and Scaleway builders.
91+
{"go1.14.55", "linux-arm64", "linux-arm64-packet"},
92+
{"go1.15.55", "linux-armv6l", "linux-arm"},
93+
// Go 1.16 starts to use the the AWS builders.
94+
{"go1.16", "linux-arm64", "linux-arm64-aws"},
95+
{"go1.16", "linux-armv6l", "linux-arm-aws"},
96+
97+
// Go 1.14.x still use the FreeBSD 11.1 builder.
8598
{"go1.14.55", "freebsd-amd64", "freebsd-amd64-11_1"},
8699
{"go1.14.55", "freebsd-386", "freebsd-386-11_1"},
87-
88100
// Go 1.15 RC 2+ starts to use the the FreeBSD 11.2 builder.
89101
{"go1.15rc2", "freebsd-amd64", "freebsd-amd64-11_2"},
90102
{"go1.15rc2", "freebsd-386", "freebsd-386-11_2"},
91103
{"go1.15", "freebsd-amd64", "freebsd-amd64-11_2"},
92104
{"go1.15", "freebsd-386", "freebsd-386-11_2"},
93105
{"go1.15.1", "freebsd-amd64", "freebsd-amd64-11_2"},
94106
{"go1.15.1", "freebsd-386", "freebsd-386-11_2"},
95-
96-
// May change further during the 1.16 dev cycle,
97-
// but expect same builder as 1.15 for now.
107+
// Go 1.16 continues to use the the FreeBSD 11.2 builder.
98108
{"go1.16", "freebsd-amd64", "freebsd-amd64-11_2"},
99109
{"go1.16", "freebsd-386", "freebsd-386-11_2"},
100110
}
101111
for _, tc := range testCases {
102-
t.Run(tc.goVer, func(t *testing.T) {
112+
t.Run(tc.target+"@"+tc.goVer, func(t *testing.T) {
103113
builds := matchBuilds(tc.target, tc.goVer)
104114
if len(builds) != 1 {
105115
t.Fatalf("got %d matching builds; want 1", len(builds))

dashboard/builders.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,6 +1789,15 @@ func init() {
17891789
"GO_DISABLE_OUTBOUND_NETWORK=1",
17901790
},
17911791
})
1792+
addBuilder(BuildConfig{
1793+
Name: "linux-amd64-stretch",
1794+
HostType: "host-linux-stretch",
1795+
Notes: "Debian Stretch. Same as the normal 'linux-amd64' builder at this time, but with -stretch suffix. Used for release builds.",
1796+
buildsRepo: disabledBuilder, // Disabled because the "linux-amd64" builder does identical work.
1797+
env: []string{
1798+
"GO_DISABLE_OUTBOUND_NETWORK=1",
1799+
},
1800+
})
17921801
addBuilder(BuildConfig{
17931802
Name: "linux-amd64-buster",
17941803
HostType: "host-linux-buster",
@@ -1797,6 +1806,27 @@ func init() {
17971806
"GO_DISABLE_OUTBOUND_NETWORK=1",
17981807
},
17991808
})
1809+
addBuilder(BuildConfig{
1810+
Name: "linux-386-jessie",
1811+
HostType: "host-linux-jessie",
1812+
Notes: "Debian Jessie, 32-bit builder. Same as the normal 'linux-386' builder at this time, but with -jessie suffix. Used for release builds.",
1813+
buildsRepo: disabledBuilder, // Disabled because the "linux-386" builder does identical work.
1814+
env: []string{
1815+
"GOARCH=386",
1816+
"GOHOSTARCH=386",
1817+
"GO_DISABLE_OUTBOUND_NETWORK=1",
1818+
},
1819+
})
1820+
addBuilder(BuildConfig{
1821+
Name: "linux-386-stretch",
1822+
HostType: "host-linux-stretch",
1823+
Notes: "Debian Stretch, 32-bit builder.",
1824+
env: []string{
1825+
"GOARCH=386",
1826+
"GOHOSTARCH=386",
1827+
"GO_DISABLE_OUTBOUND_NETWORK=1",
1828+
},
1829+
})
18001830
addBuilder(BuildConfig{
18011831
Name: "linux-amd64-longtest",
18021832
HostType: "host-linux-stretch-morecpu",

0 commit comments

Comments
 (0)