cmd/updatestd: skip repos without internal-branch.go1.n-vendor branch In our previous process, we used to preemptively create an internal-branch.go1.n-vendor branch for every vendored golang.org/x repo that's a direct dependency of either the std or cmd module. But now we create those branches on demand, only when they're needed. So, stop treating a missing branch as an error to report, even if it is a direct dependency of std or cmd. For golang/go#36905. Change-Id: Id5d2b3b34b286ae7d01b1b9e48c6d98d7c72df07 Reviewed-on: https://go-review.googlesource.com/c/build/+/643517 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/cmd/updatestd/updatestd.go b/cmd/updatestd/updatestd.go index 8bdeadd..b525533 100644 --- a/cmd/updatestd/updatestd.go +++ b/cmd/updatestd/updatestd.go
@@ -41,7 +41,7 @@ flag.PrintDefaults() } goroot := flag.String("goroot", "", "path to a working copy of https://go.googlesource.com/go (required)") - branch := flag.String("branch", "", "branch to target, such as master or release-branch.go1.Y (required)") + branch := flag.String("branch", "", "branch to target, such as master or internal-branch.go1.Y-vendor (required)") flag.Parse() if flag.NArg() != 0 || *goroot == "" || *branch == "" { flag.Usage() @@ -172,11 +172,8 @@ gerritProj := m.Path[len("golang.org/x/"):] hash, ok := w.ProjectHashes[gerritProj] if !ok { - if m.Indirect { - log.Printf("skipping %s because branch %s doesn't exist and it's indirect\n", m.Path, w.Branch) - continue - } - return fmt.Errorf("no hash for Gerrit project %q", gerritProj) + log.Printf("skipping %s because branch %s doesn't exist\n", m.Path, w.Branch) + continue } goGet = append(goGet, m.Path+"@"+hash) } @@ -222,9 +219,8 @@ } type module struct { - Path string // Module path. - Main bool // Is this the main module? - Indirect bool // Is this module only an indirect dependency of main module? + Path string // Module path. + Main bool // Is this the main module? } // gorootVersion reads the GOROOT/src/internal/goversion/goversion.go
diff --git a/cmd/updatestd/updatestd_test.go b/cmd/updatestd/updatestd_test.go index c89ac73..a9e5891 100644 --- a/cmd/updatestd/updatestd_test.go +++ b/cmd/updatestd/updatestd_test.go
@@ -24,9 +24,8 @@ // Check that buildList(".") returns sensible results. main, deps := buildList(".") if want := (module{ - Path: "golang.org/x/build", - Main: true, - Indirect: false, + Path: "golang.org/x/build", + Main: true, }); main != want { t.Errorf("got main = %+v, want %+v", main, want) }