Skip to content

Commit

Permalink
cmd/coordinator: don't build pre-Go 1.7 code on Sierra builders
Browse files Browse the repository at this point in the history
Updates golang/go#18751

Change-Id: Iadd7dded079376a9bf9717ce8071604cee95d8ef
Reviewed-on: https://go-review.googlesource.com/35643
Reviewed-by: Kevin Burke <[email protected]>
Reviewed-by: Russ Cox <[email protected]>
  • Loading branch information
bradfitz committed Jan 25, 2017
1 parent 7ddddf1 commit 9d1e515
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 13 deletions.
58 changes: 46 additions & 12 deletions cmd/coordinator/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ func mayBuildRev(rev builderRev) bool {
}
return false
}
if buildConf.IsReverse() {
return reversePool.CanBuild(buildConf.HostType)
if buildConf.IsReverse() && !reversePool.CanBuild(buildConf.HostType) {
return false
}
if buildConf.IsKube() && kubeErr != nil {
return false
Expand Down Expand Up @@ -673,7 +673,7 @@ func findWork(work chan<- builderRev) error {
knownToDashboard[b] = true
}

var goRevisions []string
var goRevisions []string // revisions of repo "go", branch "master" revisions
seenSubrepo := make(map[string]bool)
var setGoRepoHead bool
for _, br := range bs.Revisions {
Expand All @@ -684,12 +684,14 @@ func findWork(work chan<- builderRev) error {
}
awaitSnapshot := false
if br.Repo == "go" {
if !setGoRepoHead && br.Branch == "master" {
// First Go revision on page; update repo head.
setRepoHead(br.Repo, br.Revision)
setGoRepoHead = true
if br.Branch == "master" {
if !setGoRepoHead {
// First Go revision on page; update repo head.
setRepoHead(br.Repo, br.Revision)
setGoRepoHead = true
}
goRevisions = append(goRevisions, br.Revision)
}
goRevisions = append(goRevisions, br.Revision)
} else {
// The dashboard provides only the head revision for
// each sub-repo; store it in subrepoHead for later use.
Expand Down Expand Up @@ -717,6 +719,10 @@ func findWork(work chan<- builderRev) error {
continue
}
builder := bs.Builders[i]
if skipBranchForBuilder(br.Repo, br.Branch, builder) {
continue
}

builderInfo, ok := dashboard.Builders[builder]
if !ok || builderInfo.TryOnly {
// Not managed by the coordinator, or a trybot-only one.
Expand Down Expand Up @@ -759,6 +765,9 @@ func findWork(work chan<- builderRev) error {
if builderInfo.TryOnly || knownToDashboard[b] {
continue
}
if skipBranchForBuilder("go", "master", b) {
continue
}
for _, rev := range goRevisions {
br := builderRev{name: b, rev: rev}
if !isBuilding(br) {
Expand Down Expand Up @@ -808,7 +817,7 @@ func findTryWork() error {
log.Printf("Warning: skipping incomplete %#v", ci)
continue
}
if ci.Project == "build" || ci.Project == "grpc-review" {
if ci.Project == "build" || ci.Project == "grpc-review" || ci.Project == "perf" {
// Skip trybot request in build repo.
// Also skip grpc-review, which is only for reviews for now.
continue
Expand Down Expand Up @@ -846,7 +855,7 @@ func findTryWork() error {
}

type tryKey struct {
Project string // "go", "build", etc
Project string // "go", "net", etc
Branch string // master
ChangeID string // I1a27695838409259d1586a0adfa9f92bccf7ceba
Commit string // ecf3dffc81dc21408fb02159af352651882a8383
Expand Down Expand Up @@ -1088,7 +1097,7 @@ func (ts *trySet) noteBuildComplete(bconf dashboard.BuildConfig, bs *buildStatus
ts.mu.Unlock()

if numFail == 1 && remain > 0 {
if err := gerritClient.SetReview(bs.ctx, ts.ChangeTriple(), ts.Commit, gerrit.ReviewInput{
if err := gerritClient.SetReview(context.Background(), ts.ChangeTriple(), ts.Commit, gerrit.ReviewInput{
Message: fmt.Sprintf(
"Build is still in progress...\n"+
"This change failed on %s:\n"+
Expand All @@ -1111,7 +1120,7 @@ func (ts *trySet) noteBuildComplete(bconf dashboard.BuildConfig, bs *buildStatus
score, msg = -1, fmt.Sprintf("%d of %d TryBots failed:\n%s\nConsult https://build.golang.org/ to see whether they are new failures.",
numFail, len(ts.builds), errMsg)
}
if err := gerritClient.SetReview(bs.ctx, ts.ChangeTriple(), ts.Commit, gerrit.ReviewInput{
if err := gerritClient.SetReview(context.Background(), ts.ChangeTriple(), ts.Commit, gerrit.ReviewInput{
Message: msg,
Labels: map[string]int{
"TryBot-Result": score,
Expand Down Expand Up @@ -1139,6 +1148,7 @@ func (br builderRev) skipBuild() bool {
"exp", // always broken, depends on mobile which is broken
"mobile", // always broken (gl, etc). doesn't compile.
"term", // no code yet in repo: "warning: "golang.org/x/term/..." matched no packages"
"perf", // has external deps
"oauth2": // has external deps
return true
}
Expand Down Expand Up @@ -3206,3 +3216,27 @@ func randHex(n int) string {
}
return fmt.Sprintf("%x", buf)[:n]
}

func skipBranchForBuilder(repo, branch, builder string) bool {
if strings.HasPrefix(builder, "darwin-") {
switch builder {
case "darwin-amd64-10_8", "darwin-amd64-10_10", "darwin-amd64-10_11",
"darwin-386-10_8", "darwin-386-10_10", "darwin-386-10_11":
// OS X before Sierra can build any branch.
// (We've never had a 10.9 builder.)
default:
// Sierra or after, however, requires the 1.7 branch:
switch branch {
case "release-branch.go1.6",
"release-branch.go1.5",
"release-branch.go1.4",
"release-branch.go1.3",
"release-branch.go1.2",
"release-branch.go1.1",
"release-branch.go1":
return true
}
}
}
return false
}
6 changes: 5 additions & 1 deletion dashboard/builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,14 +479,18 @@ func (c *BuildConfig) BuildSubrepos() bool {
case "darwin-amd64-10_8",
"darwin-amd64-10_10",
"darwin-amd64-10_11",
"darwin-amd64-10_12",
"darwin-386-10_11",
"freebsd-386-gce101", "freebsd-amd64-gce101",
"linux-386", "linux-amd64", "linux-amd64-nocgo",
"openbsd-386-60", "openbsd-amd64-60",
"plan9-386",
"windows-386-gce", "windows-amd64-gce":
return true
case "darwin-amd64-10_12":
// Don't build subrepos on Sierra until
// https://github.com/golang/go/issues/18751#issuecomment-274955794
// is addressed.
return false
default:
return false
}
Expand Down

0 comments on commit 9d1e515

Please sign in to comment.