Skip to content

Commit a4cb37d

Browse files
dmitshurgopherbot
authored andcommitted
cmd/dist: require Go 1.22.6 as minimum bootstrap toolchain
This is a minimal change to start to require the new minimum bootstrap. Taking advantage of the newer bootstap to simplify and improve code is left to be done in separate CLs. For #64751. Change-Id: I1d4f883fae3026354a199174d51e79a36cd2dc53 Reviewed-on: https://go-review.googlesource.com/c/go/+/606156 LUCI-TryBot-Result: Go LUCI <[email protected]> Run-TryBot: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 4e1cc09 commit a4cb37d

File tree

6 files changed

+20
-15
lines changed

6 files changed

+20
-15
lines changed

doc/next/5-toolchain.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@
44

55
## Linker {#linker}
66

7+
## Bootstrap {#bootstrap}
78

9+
<!-- go.dev/issue/64751 -->
10+
As mentioned in the [Go 1.22 release notes](/doc/go1.22#bootstrap), Go 1.24 now requires
11+
Go 1.22.6 or later for bootstrap.
12+
We expect that Go 1.26 will require a point release of Go 1.24 or later for bootstrap.

src/cmd/dist/README

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ As of Go 1.5, dist and other parts of the compiler toolchain are written
44
in Go, making bootstrapping a little more involved than in the past.
55
The approach is to build the current release of Go with an earlier one.
66

7-
The process to install Go 1.x, for x ≥ 22, is:
7+
The process to install Go 1.x, for x ≥ 24, is:
88

9-
1. Build cmd/dist with Go 1.20.6.
10-
2. Using dist, build Go 1.x compiler toolchain with Go 1.20.6.
9+
1. Build cmd/dist with Go 1.22.6.
10+
2. Using dist, build Go 1.x compiler toolchain with Go 1.22.6.
1111
3. Using dist, rebuild Go 1.x compiler toolchain with itself.
1212
4. Using dist, build Go 1.x cmd/go (as go_bootstrap) with Go 1.x compiler toolchain.
1313
5. Using go_bootstrap, build the remaining Go 1.x standard library and commands.
1414

15-
Because of backward compatibility, although the steps above say Go 1.20.6,
16-
in practice any release ≥ Go 1.20.6 but < Go 1.x will work as the bootstrap base.
15+
Because of backward compatibility, although the steps above say Go 1.22.6,
16+
in practice any release ≥ Go 1.22.6 but < Go 1.x will work as the bootstrap base.
1717
Releases ≥ Go 1.x are very likely to work as well.
1818

1919
See https://go.dev/s/go15bootstrap for more details about the original bootstrap

src/cmd/dist/notgo120.go renamed to src/cmd/dist/notgo122.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// Go 1.22 and later requires Go 1.20 as the bootstrap toolchain.
5+
// Go 1.24 and later requires Go 1.22.6 as the bootstrap toolchain.
66
// If cmd/dist is built using an earlier Go version, this file will be
77
// included in the build and cause an error like:
88
//
99
// % GOROOT_BOOTSTRAP=$HOME/sdk/go1.16 ./make.bash
1010
// Building Go cmd/dist using /Users/rsc/sdk/go1.16. (go1.16 darwin/amd64)
11-
// found packages main (build.go) and building_Go_requires_Go_1_20_6_or_later (notgo120.go) in /Users/rsc/go/src/cmd/dist
11+
// found packages main (build.go) and building_Go_requires_Go_1_22_6_or_later (notgo122.go) in /Users/rsc/go/src/cmd/dist
1212
// %
1313
//
1414
// which is the best we can do under the circumstances.
1515
//
1616
// See go.dev/issue/44505 for more background on
1717
// why Go moved on from Go 1.4 for bootstrap.
1818

19-
//go:build !go1.20
19+
//go:build !go1.22
2020

21-
package building_Go_requires_Go_1_20_6_or_later
21+
package building_Go_requires_Go_1_22_6_or_later

src/make.bash

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@
6464
# timing information to this file. Useful for profiling where the
6565
# time goes when these scripts run.
6666
#
67-
# GOROOT_BOOTSTRAP: A working Go tree >= Go 1.20.6 for bootstrap.
67+
# GOROOT_BOOTSTRAP: A working Go tree >= Go 1.22.6 for bootstrap.
6868
# If $GOROOT_BOOTSTRAP/bin/go is missing, $(go env GOROOT) is
69-
# tried for all "go" in $PATH. By default, one of $HOME/go1.20.6,
70-
# $HOME/sdk/go1.20.6, or $HOME/go1.4, whichever exists, in that order.
69+
# tried for all "go" in $PATH. By default, one of $HOME/go1.22.6,
70+
# $HOME/sdk/go1.22.6, or $HOME/go1.4, whichever exists, in that order.
7171
# We still check $HOME/go1.4 to allow for build scripts that still hard-code
7272
# that name even though they put newer Go toolchains there.
7373

74-
bootgo=1.20.6
74+
bootgo=1.22.6
7575

7676
set -e
7777

src/make.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ for /f "tokens=*" %%g in ('where go 2^>nul') do (
8585
)
8686
)
8787

88-
set bootgo=1.20.6
88+
set bootgo=1.22.6
8989
if "x%GOROOT_BOOTSTRAP%"=="x" if exist "%HOMEDRIVE%%HOMEPATH%\go%bootgo%" set GOROOT_BOOTSTRAP=%HOMEDRIVE%%HOMEPATH%\go%bootgo%
9090
if "x%GOROOT_BOOTSTRAP%"=="x" if exist "%HOMEDRIVE%%HOMEPATH%\sdk\go%bootgo%" set GOROOT_BOOTSTRAP=%HOMEDRIVE%%HOMEPATH%\sdk\go%bootgo%
9191
if "x%GOROOT_BOOTSTRAP%"=="x" set GOROOT_BOOTSTRAP=%HOMEDRIVE%%HOMEPATH%\Go1.4

src/make.rc

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn bootstrapenv {
4848
GOROOT=$GOROOT_BOOTSTRAP GO111MODULE=off GOENV=off GOOS=() GOARCH=() GOEXPERIMENT=() GOFLAGS=() $*
4949
}
5050
51-
bootgo = 1.20.6
51+
bootgo = 1.22.6
5252
GOROOT = `{cd .. && pwd}
5353
goroot_bootstrap_set = 'true'
5454
if(! ~ $#GOROOT_BOOTSTRAP 1){

0 commit comments

Comments
 (0)