Skip to content

Commit ef977b7

Browse files
dmitshurgopherbot
authored andcommitted
internal/relui: drop v6l suffix from non-linux/arm download metadata
For historical reasons, the binary release for the linux/arm port we provide at https://go.dev/dl/ is a bit of a special case. It differs from other ports in that it's built with GOARM overridden to a value of 6, and the filename has a "v6l" suffix after "arm". The download metadata has a field "arch" where that v6l suffix is being included. This special case needs to be handled consistently in various places, which can be easy to get slightly wrong sometimes (e.g., CL 504820, go.dev/issue/62514, etc.). It turns out a GOOS == linux check was missed when porting the metadata publishing logic from releasebot to relui, causing metadata for Go 1.21 onwards to be "armv6l" for arm ports of all OSes, not just Linux. Cease doing that in Go 1.23 (the nearest major release, to minimize potential disruption in minor releases). Spotted this via https://hachyderm.io/@golang/112044405859439427 which happened to select the netbsd/arm port. The fact that this hasn't been reported sooner suggests this isn't a very serious problem fortunately. Change-Id: I732ca7a6db181e81d31b265df48e7a9f47ed2c6c Reviewed-on: https://go-review.googlesource.com/c/build/+/584403 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent 4b28576 commit ef977b7

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

internal/relui/buildrelease_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,14 @@ func testRelease(t *testing.T, prevTag string, major int, wantVersion string, ki
315315
"go/VERSION": versionFile,
316316
"go/tool/something_orother/compile": "",
317317
})
318+
checkTGZ(t, dlURL, files, "netbsd-arm.tar.gz", task.WebsiteFile{
319+
OS: "netbsd",
320+
Arch: "arm" + map[int]string{21: "v6l", 22: "v6l"}[major],
321+
Kind: "archive",
322+
}, map[string]string{
323+
"go/VERSION": versionFile,
324+
"go/tool/something_orother/compile": "",
325+
})
318326
checkTGZ(t, dlURL, files, "darwin-amd64.tar.gz", task.WebsiteFile{
319327
OS: "darwin",
320328
Arch: "amd64",

internal/relui/workflows.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1626,9 +1626,18 @@ func (tasks *BuildReleaseTasks) publishArtifacts(ctx *wf.TaskContext, version st
16261626
if a.Target != nil {
16271627
f.OS = a.Target.GOOS
16281628
f.Arch = a.Target.GOARCH
1629-
if a.Target.GOARCH == "arm" {
1629+
if a.Target.GOOS == "linux" && a.Target.GOARCH == "arm" && slices.Contains(a.Target.ExtraEnv, "GOARM=6") {
16301630
f.Arch = "armv6l"
16311631
}
1632+
if task.CompareGoVersions(version, "go1.23") == -1 { // TODO: Delete this after Go 1.24.0 is out and this becomes dead code.
1633+
// Due to an oversight, we've been inadvertently setting the "arch" field
1634+
// of published download metadata to "armv6l" for all arm ports, not just
1635+
// linux/arm port as intended. Keep doing it for the rest of Go 1.22/1.21
1636+
// minor releases only.
1637+
if a.Target.GOARCH == "arm" {
1638+
f.Arch = "armv6l"
1639+
}
1640+
}
16321641
}
16331642
switch a.Suffix {
16341643
case "src.tar.gz":

internal/task/gover.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
package task
1010

11-
// compareGoVersions returns -1, 0, or +1 depending on whether
11+
// CompareGoVersions returns -1, 0, or +1 depending on whether
1212
// x < y, x == y, or x > y, interpreted as toolchain versions.
1313
// The versions x and y must begin with a "go" prefix: "go1.21" not "1.21".
1414
// Malformed versions compare less than well-formed versions and equal to each other.
1515
// The language version "go1.21" compares less than the release candidate and eventual releases "go1.21rc1" and "go1.21.0".
16-
func compareGoVersions(x, y string) int {
16+
func CompareGoVersions(x, y string) int {
1717
vx := parse(x)
1818
vy := parse(y)
1919

internal/task/updateproxytestrepo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func (t *UpdateProxyTestRepoTasks) UpdateProxyTestRepo(ctx *wf.TaskContext, publ
3838
}
3939
// If the published version is lower than the current go.mod version, don't update.
4040
// If we could parse the go.mod file, assume we should update.
41-
if f.Go != nil && compareGoVersions(published.Version, "go"+f.Go.Version) < 0 {
41+
if f.Go != nil && CompareGoVersions(published.Version, "go"+f.Go.Version) < 0 {
4242
return "no update", nil
4343
}
4444

0 commit comments

Comments
 (0)