Skip to content

Commit 6f3593c

Browse files
dmitshurgopherbot
authored andcommitted
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 <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Cherry Mui <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 65faf70 commit 6f3593c

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

cmd/updatestd/updatestd.go

+5-9
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func main() {
4141
flag.PrintDefaults()
4242
}
4343
goroot := flag.String("goroot", "", "path to a working copy of https://go.googlesource.com/go (required)")
44-
branch := flag.String("branch", "", "branch to target, such as master or release-branch.go1.Y (required)")
44+
branch := flag.String("branch", "", "branch to target, such as master or internal-branch.go1.Y-vendor (required)")
4545
flag.Parse()
4646
if flag.NArg() != 0 || *goroot == "" || *branch == "" {
4747
flag.Usage()
@@ -172,11 +172,8 @@ func (w Work) UpdateModule(dir string) error {
172172
gerritProj := m.Path[len("golang.org/x/"):]
173173
hash, ok := w.ProjectHashes[gerritProj]
174174
if !ok {
175-
if m.Indirect {
176-
log.Printf("skipping %s because branch %s doesn't exist and it's indirect\n", m.Path, w.Branch)
177-
continue
178-
}
179-
return fmt.Errorf("no hash for Gerrit project %q", gerritProj)
175+
log.Printf("skipping %s because branch %s doesn't exist\n", m.Path, w.Branch)
176+
continue
180177
}
181178
goGet = append(goGet, m.Path+"@"+hash)
182179
}
@@ -222,9 +219,8 @@ func buildList(dir string) (main module, deps []module) {
222219
}
223220

224221
type module struct {
225-
Path string // Module path.
226-
Main bool // Is this the main module?
227-
Indirect bool // Is this module only an indirect dependency of main module?
222+
Path string // Module path.
223+
Main bool // Is this the main module?
228224
}
229225

230226
// gorootVersion reads the GOROOT/src/internal/goversion/goversion.go

cmd/updatestd/updatestd_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ func TestBuildList(t *testing.T) {
2424
// Check that buildList(".") returns sensible results.
2525
main, deps := buildList(".")
2626
if want := (module{
27-
Path: "golang.org/x/build",
28-
Main: true,
29-
Indirect: false,
27+
Path: "golang.org/x/build",
28+
Main: true,
3029
}); main != want {
3130
t.Errorf("got main = %+v, want %+v", main, want)
3231
}

0 commit comments

Comments
 (0)