Skip to content

Commit

Permalink
internal/task: tidy x/exp and x/telemetry nested modules too
Browse files Browse the repository at this point in the history
Nested modules with replace directives need to be tidied too,
else they end up in an inconsistent state and their builds fail.

Though it's tempting to automate the discovery of such modules,
it would take some code and these situations are fairly rare.
So for now add the missing ones to the hard-coded list manually;
we can change our minds about it later if we want.

For golang/go#56530.

Change-Id: Ic622d3f0080abc17410060c77978a3917f0be0b7
Reviewed-on: https://go-review.googlesource.com/c/build/+/525657
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Heschi Kreinick <[email protected]>
  • Loading branch information
dmitshur committed Sep 5, 2023
1 parent e159a6f commit 7f65e2b
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions internal/task/tagx.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,17 @@ func (x *TagXReposTasks) UpdateGoMod(ctx *wf.TaskContext, repo TagRepo, deps []T
return nil, fmt.Errorf("Command failed: %v", remoteErr)
}

// Tidy the root module. For tools, also tidy gopls so that its replaced
// version still works.
dirs := []string{""}
if repo.Name == "tools" {
dirs = append(dirs, "gopls")
// Tidy the root module.
// Also tidy nested modules with a replace directive.
dirs := []string{"."}
switch repo.Name {
case "exp":
dirs = append(dirs, "slog/benchmarks/zap_benchmarks") // A local replace directive as of 2023-09-05.
dirs = append(dirs, "slog/benchmarks/zerolog_benchmarks") // A local replace directive as of 2023-09-05.
case "telemetry":
dirs = append(dirs, "godev") // A local replace directive as of 2023-09-05.
case "tools":
dirs = append(dirs, "gopls") // A local replace directive as of 2023-09-05.
}
var fetchCmd []string
for _, dir := range dirs {
Expand Down

0 comments on commit 7f65e2b

Please sign in to comment.