Dmitri Shuralyov would like Michael Knyszek to review this change.
internal/relui: fix Go version in "Mail x/tools stdlib CL" during RCs
In CL 694976 I overlooked that the Go version needed to perform stdlib
generation in the "Mail x/tools stdlib CL" task and the Go version that
GenerateAutoSubmitChange selects when running its git-generate script
aligned during major releases, but the same doesn't work out for RCs.
So, get the script to use the exact version being released during RCs.
Use the golang.org/dl commands for this because regenerating the stdlib
packages uses the GOROOT/api files that are present there.
diff --git a/internal/task/version.go b/internal/task/version.go
index 4e0009c..353cf98 100644
--- a/internal/task/version.go
+++ b/internal/task/version.go
@@ -217,6 +217,15 @@
}
func (t *VersionTasks) CreateUpdateStdlibIndexCL(ctx *workflow.TaskContext, reviewers []string, version string) (string, error) {
+ script := "go generate ./internal/stdlib"
+ if strings.Contains(version, "rc") {
+ // For release candidate versions, we can't leave go version
+ // selection to GenerateAutoSubmitChange. It uses the latest
+ // stable Go release, which is ok when this task runs during
+ // major releases, but not when it runs during RCs.
+ script = fmt.Sprintf(`go run golang.org/dl/%s@latest download
+go run golang.org/dl/%[1]s@latest generate ./internal/stdlib`, version)
+ }
return t.CloudBuild.GenerateAutoSubmitChange(ctx, gerrit.ChangeInput{
Project: "tools",
Subject: fmt.Sprintf(`internal/stdlib: update stdlib index for %s
@@ -224,8 +233,8 @@
For golang/go#38706.
[git-generate]
-go generate ./internal/stdlib
-`, strings.NewReplacer("go", "Go ", "rc", " Release Candidate ").Replace(version)),
+%s
+`, strings.NewReplacer("go", "Go ", "rc", " Release Candidate ").Replace(version), script),
Branch: "master",
}, reviewers)
}
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +2 |
go run golang.org/dl/%[1]s@latest generate ./internal/stdlib`, version)clever!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
Thanks.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
internal/relui: fix Go version in "Mail x/tools stdlib CL" during RCs
In CL 694976 I overlooked that the Go version needed to perform stdlib
generation in the "Mail x/tools stdlib CL" task and the Go version that
GenerateAutoSubmitChange selects when running its git-generate script
aligned during major releases, but the same doesn't work out for RCs.
So, get the script to use the exact version being released during RCs.
Use the golang.org/dl commands for this because regenerating the stdlib
packages uses the GOROOT/api files that are present there.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |