Skip to content

Commit e9ffa6e

Browse files
bump golang (#1)
* package/go: bump to version 1.25.1 For relase notes, see: https://go.dev/doc/devel/release#go1.25.0 Building Go 1.24 and later requires Go 1.22.6 or later for bootstrap. To support this we use our previous Go version 1.23.12 as the version for go-bootstrap-stage4 and have the build for Go 1.25.1 depend on go-bootstrap-stage4. Go version 1.23.12 is the latest go version we can build using go-bootstrap-stage3. The package build for go-bootstrap-stage4 if effectively identical to go-bootstrap-stage3 with only the Go version and stage number changed. Note: go version 1.25.1 release note mention a security fix which is for CVE-2025-47910. This commit is not marked as security bump, because the issue was introduced in version 1.25.0 which was not included in Buildroot. See: https://pkg.go.dev/vuln/GO-2025-3955 Signed-off-by: James Hilliard <[email protected]> Tested-by: Christian Stewart <[email protected]> [Julien: add link to release notes and comment about CVE in commit log. ] Signed-off-by: Julien Olivain <[email protected]> * bump package golang --------- Signed-off-by: James Hilliard <[email protected]> Signed-off-by: Julien Olivain <[email protected]> Co-authored-by: James Hilliard <[email protected]>
1 parent a562f2f commit e9ffa6e

File tree

8 files changed

+148
-15
lines changed

8 files changed

+148
-15
lines changed

package/go/Config.in.host

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
config BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
33
bool
44
default y
5-
depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS || BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS
5+
depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE4_ARCH_SUPPORTS || BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS
66
# See https://go.dev/doc/install/source#environment
77
# See src/go/build/syslist.go for the list of supported architectures
88
depends on (BR2_arm && BR2_TOOLCHAIN_SUPPORTS_PIE) || BR2_aarch64 \
@@ -34,7 +34,7 @@ config BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
3434
config BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS
3535
bool
3636
default y
37-
depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS || BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS
37+
depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE4_ARCH_SUPPORTS || BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS
3838

3939
# CGO linking for the host. Since we use the same compiler for target
4040
# and host, if the target can't do CGO linking, then the host can't.
@@ -57,7 +57,7 @@ if BR2_PACKAGE_HOST_GO
5757

5858
choice
5959
prompt "Go compiler variant"
60-
default BR2_PACKAGE_HOST_GO_SRC if BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS
60+
default BR2_PACKAGE_HOST_GO_SRC if BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE4_ARCH_SUPPORTS
6161
default BR2_PACKAGE_HOST_GO_BIN if BR2_PACKAGE_HOST_GO_BIN_HOST_ARCH_SUPPORTS
6262
help
6363
Select a Go compiler variant.
@@ -66,7 +66,7 @@ choice
6666

6767
config BR2_PACKAGE_HOST_GO_SRC
6868
bool "host go (source)"
69-
depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS
69+
depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE4_ARCH_SUPPORTS
7070
help
7171
This package will build the go compiler for the host.
7272

@@ -90,3 +90,4 @@ source "package/go/go-bin/Config.in.host"
9090
source "package/go/go-bootstrap-stage1/Config.in.host"
9191
source "package/go/go-bootstrap-stage2/Config.in.host"
9292
source "package/go/go-bootstrap-stage3/Config.in.host"
93+
source "package/go/go-bootstrap-stage4/Config.in.host"
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
From 6b05378097c6a386ed9912d2471976dc39504e86 Mon Sep 17 00:00:00 2001
2+
From: Christian Stewart <[email protected]>
3+
Date: Thu, 27 Jul 2023 21:28:47 -0700
4+
Subject: [PATCH] cmd/dist: set buildvcs=false when building go-bootstrap
5+
6+
When building go-bootstrap as part of the make.bash process, the cmd/dist
7+
invokes the bootstrap Go compiler to build the go_bootstrap tool:
8+
9+
${GOROOT_BOOTSTRAP}/bin/go install -tags=math_big_pure_go compiler_bootstrap purego bootstrap/cmd/...
10+
11+
If there is an invalid .git directory in a parent of ${GOROOT_BOOTSTRAP},
12+
make.bash will fail. Reproduction of the issue:
13+
14+
mkdir go-issue-61620
15+
cd ./go-issue-61620
16+
wget https://go.dev/dl/go1.19.11.src.tar.gz
17+
mkdir go-bootstrap
18+
tar -xf go1.19.11.src.tar.gz -C ./go-bootstrap --strip-components=1
19+
cd ./go-bootstrap/src/
20+
bash make.bash
21+
cd ../../
22+
wget https://go.dev/dl/go1.20.6.src.tar.gz
23+
mkdir go
24+
tar -xf go1.20.6.src.tar.gz -C ./go/ --strip-components=1
25+
printf "gitdir: ../../does/not/exist/.git" > ./.git
26+
cd ./go/src/
27+
GOROOT_BOOTSTRAP=$(pwd)/../../go-bootstrap/ bash make.bash
28+
29+
The build fails with the following error:
30+
31+
Building Go toolchain1 using [snip]/go-1.19.10.
32+
error obtaining VCS status: exit status 128
33+
Use -buildvcs=false to disable VCS stamping.
34+
go tool dist: FAILED: [snip]/go-1.19.10/bin/go install -tags=math_big_pure_go \
35+
compiler_bootstrap purego bootstrap/cmd/...: exit status 1
36+
37+
This change unconditionally sets -buildvcs=false when compiling go-bootstrap. We
38+
don't need the revision information in those binaries anyway. Setting this flag
39+
was previously not done as we were unsure if the go-bootstrap compiler would be
40+
new enough to support the buildvcs build flag. Since Go 1.20.x, Go 1.19.x is the
41+
minimum version for go-bootstrap, and supports -buildvcs=false. We can now set
42+
-buildvcs=false without worrying about compatibility.
43+
44+
Related: https://github.com/golang/go/issues/54852
45+
Fixes: https://github.com/golang/go/issues/61620
46+
47+
Upstream: https://github.com/golang/go/pull/61621
48+
49+
Signed-off-by: Christian Stewart <[email protected]>
50+
Signed-off-by: Romain Naour <[email protected]>
51+
---
52+
src/cmd/dist/buildtool.go | 3 +++
53+
1 file changed, 3 insertions(+)
54+
55+
diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go
56+
index a528d7aa76..3b411d6ebb 100644
57+
--- a/src/cmd/dist/buildtool.go
58+
+++ b/src/cmd/dist/buildtool.go
59+
@@ -221,6 +221,9 @@ func bootstrapBuildTools() {
60+
cmd := []string{
61+
pathf("%s/bin/go", goroot_bootstrap),
62+
"install",
63+
+ // Fixes cases where an invalid .git is present in a parent of GOROOT_BOOTSTRAP.
64+
+ // See: https://github.com/golang/go/issues/61620
65+
+ "-buildvcs=false",
66+
"-tags=math_big_pure_go compiler_bootstrap purego",
67+
}
68+
if vflag > 0 {
69+
--
70+
2.41.0
71+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
config BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE4_ARCH_SUPPORTS
2+
bool
3+
default y
4+
depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# From https://go.dev/dl
2+
sha256 e1cce9379a24e895714a412c7ddd157d2614d9edbe83a84449b6e1840b4f1226 go1.23.12.src.tar.gz
3+
sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 LICENSE
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
################################################################################
2+
#
3+
# go-bootstrap-stage4
4+
#
5+
################################################################################
6+
7+
# Use last Go version that go-bootstrap-stage3 can build: v1.23.x
8+
# See https://go.dev/doc/go1.24#bootstrap
9+
GO_BOOTSTRAP_STAGE4_VERSION = 1.23.12
10+
GO_BOOTSTRAP_STAGE4_SITE = https://storage.googleapis.com/golang
11+
GO_BOOTSTRAP_STAGE4_SOURCE = go$(GO_BOOTSTRAP_STAGE4_VERSION).src.tar.gz
12+
13+
GO_BOOTSTRAP_STAGE4_LICENSE = BSD-3-Clause
14+
GO_BOOTSTRAP_STAGE4_LICENSE_FILES = LICENSE
15+
16+
# Use go-bootstrap-stage3 to bootstrap.
17+
HOST_GO_BOOTSTRAP_STAGE4_DEPENDENCIES = host-go-bootstrap-stage3
18+
19+
HOST_GO_BOOTSTRAP_STAGE4_ROOT = $(HOST_DIR)/lib/go-$(GO_BOOTSTRAP_STAGE4_VERSION)
20+
21+
# The go build system is not compatible with ccache, so use
22+
# HOSTCC_NOCCACHE. See https://github.com/golang/go/issues/11685.
23+
HOST_GO_BOOTSTRAP_STAGE4_MAKE_ENV = \
24+
GO111MODULE=off \
25+
GOCACHE=$(HOST_GO_HOST_CACHE) \
26+
GOROOT_BOOTSTRAP=$(HOST_GO_BOOTSTRAP_STAGE3_ROOT) \
27+
GOROOT_FINAL=$(HOST_GO_BOOTSTRAP_STAGE4_ROOT) \
28+
GOROOT="$(@D)" \
29+
GOBIN="$(@D)/bin" \
30+
GOOS=linux \
31+
CC=$(HOSTCC_NOCCACHE) \
32+
CXX=$(HOSTCXX_NOCCACHE) \
33+
CGO_ENABLED=0
34+
35+
define HOST_GO_BOOTSTRAP_STAGE4_BUILD_CMDS
36+
cd $(@D)/src && \
37+
$(HOST_GO_BOOTSTRAP_STAGE4_MAKE_ENV) ./make.bash $(if $(VERBOSE),-v)
38+
endef
39+
40+
define HOST_GO_BOOTSTRAP_STAGE4_INSTALL_CMDS
41+
$(INSTALL) -D -m 0755 $(@D)/bin/go $(HOST_GO_BOOTSTRAP_STAGE4_ROOT)/bin/go
42+
$(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(HOST_GO_BOOTSTRAP_STAGE4_ROOT)/bin/gofmt
43+
44+
cp -a $(@D)/lib $(HOST_GO_BOOTSTRAP_STAGE4_ROOT)/
45+
46+
mkdir -p $(HOST_GO_BOOTSTRAP_STAGE4_ROOT)/pkg
47+
cp -a $(@D)/pkg/include $(HOST_GO_BOOTSTRAP_STAGE4_ROOT)/pkg/
48+
cp -a $(@D)/pkg/tool $(HOST_GO_BOOTSTRAP_STAGE4_ROOT)/pkg/
49+
50+
# The Go sources must be installed to the host/ tree for the Go stdlib.
51+
cp -a $(@D)/src $(HOST_GO_BOOTSTRAP_STAGE4_ROOT)/
52+
endef
53+
54+
$(eval $(host-generic-package))

package/go/go-src/go-src.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ GO_SRC_CPE_ID_PRODUCT = go
1616

1717
HOST_GO_SRC_PROVIDES = host-go
1818
HOST_GO_SRC_DEPENDENCIES = \
19-
host-go-bootstrap-stage3 \
19+
host-go-bootstrap-stage4 \
2020
$(HOST_GO_DEPENDENCIES_CGO)
2121

2222
ifeq ($(BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS),y)
@@ -37,7 +37,7 @@ endif
3737
HOST_GO_SRC_MAKE_ENV = \
3838
GO111MODULE=off \
3939
GOCACHE=$(HOST_GO_HOST_CACHE) \
40-
GOROOT_BOOTSTRAP=$(HOST_GO_BOOTSTRAP_STAGE3_ROOT) \
40+
GOROOT_BOOTSTRAP=$(HOST_GO_BOOTSTRAP_STAGE4_ROOT) \
4141
GOROOT_FINAL=$(HOST_GO_ROOT) \
4242
GOROOT="$(@D)" \
4343
GOBIN="$(@D)/bin" \

package/go/go.hash

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# sha256 checksum from https://go.dev/dl/
2-
sha256 e1cce9379a24e895714a412c7ddd157d2614d9edbe83a84449b6e1840b4f1226 go1.23.12.src.tar.gz
3-
sha256 3b2fd446e26642555d1446a38ccbefb2a30bba3179d3ef132ed64d3c63b0c42a go1.23.12.linux-386.tar.gz
4-
sha256 d3847fef834e9db11bf64e3fb34db9c04db14e068eeb064f49af747010454f90 go1.23.12.linux-amd64.tar.gz
5-
sha256 52ce172f96e21da53b1ae9079808560d49b02ac86cecfa457217597f9bc28ab3 go1.23.12.linux-arm64.tar.gz
6-
sha256 9704eba01401a3793f54fac162164b9c5d8cc6f3cab5cee72684bb72294d9f41 go1.23.12.linux-armv6l.tar.gz
7-
sha256 1a7cc5f7baeaf39125dce5d660a39438e7f0e04d13d3498590d240aae976b565 go1.23.12.linux-ppc64le.tar.gz
8-
sha256 2f43708aa0922d692da0a1fc775475c343907610bec77002de1bbe37601ea338 go1.23.12.linux-s390x.tar.gz
9-
sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 LICENSE
2+
sha256 d010c109cee94d80efe681eab46bdea491ac906bf46583c32e9f0dbb0bd1a594 go1.25.2.src.tar.gz
3+
sha256 d03cdcbc9bd8baf5cf028de390478e9e2b3e4d0afe5a6582dedc19bfe6a263b2 go1.25.2.linux-386.tar.gz
4+
sha256 d7fa7f8fbd16263aa2501d681b11f972a5fd8e811f7b10cb9b26d031a3d7454b go1.25.2.linux-amd64.tar.gz
5+
sha256 65a3e34fb2126f55b34e1edfc709121660e1be2dee6bdf405fc399a63a95a87d go1.25.2.linux-arm64.tar.gz
6+
sha256 eb949be683e82a99e9861dafd7057e31ea40b161eae6c4cd18fdc0e8c4ae6225 go1.25.2.linux-armv6l.tar.gz
7+
sha256 8b0c8d3ee5b1b5c28b6bd63dc4438792012e01d03b4bf7a61d985c87edab7d1f go1.25.2.linux-ppc64le.tar.gz
8+
sha256 9cfe517ba423f59f3738ca5c3d907c103253cffbbcc2987142f79c5de8c1bf93 go1.25.2.linux-s390x.tar.gz
9+
sha256 911f8f5782931320f5b8d1160a76365b83aea6447ee6c04fa6d5591467db9dad LICENSE

package/go/go.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
################################################################################
66

7-
GO_VERSION = 1.23.12
7+
GO_VERSION = 1.25.2
88

99
HOST_GO_GOPATH = $(HOST_DIR)/share/go-path
1010
HOST_GO_HOST_CACHE = $(HOST_DIR)/share/host-go-cache

0 commit comments

Comments
 (0)