dashboard: add linux-amd64-staticlockranking builder

This is a new linux/amd64 GCE builder for the purpose of
testing the GOEXPERIMENT=staticlockranking configuration
which is landing to master branch soon.

It runs only on the main Go repository master branch and
release branches 1.15 and newer. No golang.org/x repos.
Not included in trybots by default, but can be requested
via SlowBots by saying TRY=linux-amd64-staticlockranking.

Also expand documentation of BuildConfig.buildsRepo field
to make it more clear how to use it. A common mistake for
custom buildsRepo functions that are added is to create a
custom policy with a minor adjustment and forgetting to
preserve the rest of the default build repo policy.

Fixes golang/go#37937

Change-Id: Ic56f82e9ede30cb6fe8f6cc7d0282d6a0a12c1b8
Reviewed-on: https://go-review.googlesource.com/c/build/+/224078
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Dmitri Shuralyov 2020-03-19 10:34:11 -04:00
Родитель 1e42a94bc4
Коммит 77c96bbb96
2 изменённых файлов: 33 добавлений и 2 удалений

Просмотреть файл

@ -765,7 +765,19 @@ type BuildConfig struct {
// buildsRepo optionally specifies whether this
// builder does builds (of any type) for the given repo ("go",
// "net", etc) and its branch ("master", "release-branch.go1.12").
// If nil, a default policy is used. (see buildsRepoAtAll for details)
//
// If nil, the default policy defaultBuildsRepoPolicy is used.
// (See buildsRepoAtAll for details.)
//
// To implement a minor change to the default policy, create a
// function that re-uses defaultBuildsRepoPolicy. For example:
//
// buildsRepo: func(repo, branch, goBranch string) bool {
// b := defaultBuildsRepoPolicy(repo, branch, goBranch)
// // ... modify b from the default value as needed ...
// return b
// }
//
// goBranch is the branch of "go" to build against. If repo == "go",
// goBranch == branch.
buildsRepo func(repo, branch, goBranch string) bool
@ -1586,6 +1598,21 @@ func init() {
"f65abf6ddc8d1f3d403a9195fd74eaffa022b07f", // adds dclstack
},
})
addBuilder(BuildConfig{
Name: "linux-amd64-staticlockranking",
HostType: "host-linux-stretch",
Notes: "builder with GOEXPERIMENT=staticlockranking, see golang.org/issue/37937",
buildsRepo: func(repo, branch, goBranch string) bool {
return repo == "go" && atLeastGo1(goBranch, 15)
},
env: []string{
"GO_DISABLE_OUTBOUND_NETWORK=1",
"GOEXPERIMENT=staticlockranking",
},
GoDeps: []string{
"02057906f7272a4787b8a0b5b7cafff8ad3024f0", // A master commit from 2020/03/19, just before CL 222925 and CL 207619 have landed.
},
})
addBuilder(BuildConfig{
Name: "linux-amd64-racecompile",
HostType: "host-linux-jessie",
@ -2392,7 +2419,6 @@ func init() {
return atLeastGo1(branch, 12) && atLeastGo1(goBranch, 12) && defaultBuildsRepoPolicy(repo, branch, goBranch)
},
})
}
// addBuilder adds c to the Builders map after doing some sanity

Просмотреть файл

@ -557,6 +557,11 @@ func TestBuilderConfig(t *testing.T) {
{b("dragonfly-amd64-5_6", "go"), onlyPost},
{b("dragonfly-amd64-5_6", "net"), onlyPost},
{b("dragonfly-amd64-5_6@go1.13", "net"), onlyPost},
{b("linux-amd64-staticlockranking", "go"), onlyPost},
{b("linux-amd64-staticlockranking@go1.15", "go"), onlyPost},
{b("linux-amd64-staticlockranking@go1.14", "go"), none},
{b("linux-amd64-staticlockranking", "net"), none},
}
for _, tt := range tests {
t.Run(tt.br.testName, func(t *testing.T) {