Skip to content

Commit 7f65e2b

Browse files
committed
internal/task: tidy x/exp and x/telemetry nested modules too
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]>
1 parent e159a6f commit 7f65e2b

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

internal/task/tagx.go

+11-5
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,17 @@ func (x *TagXReposTasks) UpdateGoMod(ctx *wf.TaskContext, repo TagRepo, deps []T
430430
return nil, fmt.Errorf("Command failed: %v", remoteErr)
431431
}
432432

433-
// Tidy the root module. For tools, also tidy gopls so that its replaced
434-
// version still works.
435-
dirs := []string{""}
436-
if repo.Name == "tools" {
437-
dirs = append(dirs, "gopls")
433+
// Tidy the root module.
434+
// Also tidy nested modules with a replace directive.
435+
dirs := []string{"."}
436+
switch repo.Name {
437+
case "exp":
438+
dirs = append(dirs, "slog/benchmarks/zap_benchmarks") // A local replace directive as of 2023-09-05.
439+
dirs = append(dirs, "slog/benchmarks/zerolog_benchmarks") // A local replace directive as of 2023-09-05.
440+
case "telemetry":
441+
dirs = append(dirs, "godev") // A local replace directive as of 2023-09-05.
442+
case "tools":
443+
dirs = append(dirs, "gopls") // A local replace directive as of 2023-09-05.
438444
}
439445
var fetchCmd []string
440446
for _, dir := range dirs {

0 commit comments

Comments
 (0)