Skip to content

Commit 17a7d87

Browse files
committed
cmd/coordinator: fix trybots for the "dl" repo, part 2
This continues the work started in CL 170417, and hopefully finishes it. Fixes golang/go#35581 Updates golang/go#30852 Change-Id: Ie666ead86dccb4de7dfc2ca94c79f4592b2da47a Reviewed-on: https://go-review.googlesource.com/c/build/+/212023 Run-TryBot: Alexander Rakoczy <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Alexander Rakoczy <[email protected]> Reviewed-by: Carlos Amedee <[email protected]>
1 parent f9092bb commit 17a7d87

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

cmd/coordinator/coordinator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2566,7 +2566,7 @@ func (st *buildStatus) runSubrepoTests() (remoteErr, err error) {
25662566

25672567
// Check out the provided sub-repo to the buildlet's workspace.
25682568
// Need to do this first, so we can run go env GOMOD in it.
2569-
err = buildgo.FetchSubrepo(st.ctx, st, st.bc, st.SubName, st.SubRev)
2569+
err = buildgo.FetchSubrepo(st.ctx, st, st.bc, st.SubName, st.SubRev, importPathOfRepo(st.SubName))
25702570
if err != nil {
25712571
return nil, err
25722572
}
@@ -2760,7 +2760,7 @@ func (st *buildStatus) fetchDependenciesToGOPATHWorkspace(goroot, gopath string)
27602760
// fetch checks out the provided sub-repo to the buildlet's workspace.
27612761
fetch := func(repo, rev string) error {
27622762
fetched[repo] = true
2763-
return buildgo.FetchSubrepo(st.ctx, st, st.bc, repo, rev)
2763+
return buildgo.FetchSubrepo(st.ctx, st, st.bc, repo, rev, importPathOfRepo(repo))
27642764
}
27652765

27662766
// findDeps uses 'go list' on the checked out repo to find its

internal/buildgo/benchmarks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func buildXBenchmark(ctx context.Context, sl spanlog.Logger, conf *dashboard.Bui
8686
return nil, err
8787
}
8888
if err := bc.ListDir(ctx, "gopath/src/golang.org/x/benchmarks", buildlet.ListDirOpts{}, func(buildlet.DirEntry) {}); err != nil {
89-
if err := FetchSubrepo(ctx, sl, bc, "benchmarks", rev); err != nil {
89+
if err := FetchSubrepo(ctx, sl, bc, "benchmarks", rev, "golang.org/x/benchmarks"); err != nil {
9090
return nil, err
9191
}
9292
}
@@ -112,7 +112,7 @@ func (gb GoBuilder) EnumerateBenchmarks(ctx context.Context, bc *buildlet.Client
112112

113113
// Fetch x/benchmarks
114114
if benchmarksRev != "" {
115-
if err := FetchSubrepo(ctx, gb.Logger, bc, "benchmarks", benchmarksRev); err != nil {
115+
if err := FetchSubrepo(ctx, gb.Logger, bc, "benchmarks", benchmarksRev, "golang.org/x/benchmarks"); err != nil {
116116
return nil, err
117117
}
118118
}

internal/buildgo/buildgo.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ import (
2525
"golang.org/x/build/internal/sourcecache"
2626
)
2727

28-
const subrepoPrefix = "golang.org/x/"
29-
3028
// BuilderRev is a build configuration type and a revision.
3129
type BuilderRev struct {
3230
Name string // e.g. "linux-amd64-race"
@@ -177,16 +175,17 @@ func (gb GoBuilder) runConcurrentGoBuildStdCmd(ctx context.Context, bc *buildlet
177175

178176
// FetchSubrepo checks out the go.googlesource.com repository
179177
// repo (for example, "net" or "oauth2") at git revision rev,
180-
// and places it into the buildlet's GOPATH workspace.
178+
// and places it into the buildlet's GOPATH workspace at
179+
// $GOPATH/src/<importPath>.
181180
//
182181
// The GOPATH workspace is assumed to be the "gopath" directory
183182
// in the buildlet's work directory.
184-
func FetchSubrepo(ctx context.Context, sl spanlog.Logger, bc *buildlet.Client, repo, rev string) error {
183+
func FetchSubrepo(ctx context.Context, sl spanlog.Logger, bc *buildlet.Client, repo, rev, importPath string) error {
185184
tgz, err := sourcecache.GetSourceTgz(sl, repo, rev)
186185
if err != nil {
187186
return err
188187
}
189-
return bc.PutTar(ctx, tgz, "gopath/src/"+subrepoPrefix+repo)
188+
return bc.PutTar(ctx, tgz, "gopath/src/"+importPath)
190189
}
191190

192191
// VersionTgz returns an io.Reader of a *.tar.gz file containing only

0 commit comments

Comments
 (0)