From 6abfe7b0deaeb62d9f8d4bf09475efec68db9a1b Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Fri, 8 Aug 2025 20:20:47 -0400 Subject: cmd/dist: require Go 1.24.6 as minimum bootstrap toolchain This is a minimal change to start to require the new minimum bootstrap. Taking advantage of the newer bootstrap to simplify and improve code is left to be done in separate CLs. For #69315. Change-Id: I4bef752b2adb67e969d585d97e680d26afefc6f4 Reviewed-on: https://go-review.googlesource.com/c/go/+/694535 LUCI-TryBot-Result: Go LUCI Auto-Submit: Dmitri Shuralyov Reviewed-by: David Chase Reviewed-by: Dmitri Shuralyov --- src/cmd/dist/README | 15 +++++++-------- src/cmd/dist/buildtool.go | 2 +- src/cmd/dist/notgo122.go | 21 --------------------- src/cmd/dist/notgo124.go | 21 +++++++++++++++++++++ 4 files changed, 29 insertions(+), 30 deletions(-) delete mode 100644 src/cmd/dist/notgo122.go create mode 100644 src/cmd/dist/notgo124.go (limited to 'src/cmd') diff --git a/src/cmd/dist/README b/src/cmd/dist/README index 78a6d42d0a..d600520040 100644 --- a/src/cmd/dist/README +++ b/src/cmd/dist/README @@ -4,18 +4,17 @@ As of Go 1.5, dist and other parts of the compiler toolchain are written in Go, making bootstrapping a little more involved than in the past. The approach is to build the current release of Go with an earlier one. -The process to install Go 1.x, for x ≥ 24, is: +The process to install Go 1.x, for x ≥ 26, is: -1. Build cmd/dist with Go 1.22.6. -2. Using dist, build Go 1.x compiler toolchain with Go 1.22.6. +1. Build cmd/dist with Go 1.24.6. +2. Using dist, build Go 1.x compiler toolchain with Go 1.24.6. 3. Using dist, rebuild Go 1.x compiler toolchain with itself. 4. Using dist, build Go 1.x cmd/go (as go_bootstrap) with Go 1.x compiler toolchain. 5. Using go_bootstrap, build the remaining Go 1.x standard library and commands. -Because of backward compatibility, although the steps above say Go 1.22.6, -in practice any release ≥ Go 1.22.6 but < Go 1.x will work as the bootstrap base. +Because of backward compatibility, although the steps above say Go 1.24.6, +in practice any release ≥ Go 1.24.6 but < Go 1.x will work as the bootstrap base. Releases ≥ Go 1.x are very likely to work as well. -See https://go.dev/s/go15bootstrap for more details about the original bootstrap -and https://go.dev/issue/54265 for details about later bootstrap version bumps. - +See go.dev/s/go15bootstrap for more details about the original bootstrap +and go.dev/issue/54265 for details about later bootstrap version bumps. diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go index 013b769b90..b7e5891981 100644 --- a/src/cmd/dist/buildtool.go +++ b/src/cmd/dist/buildtool.go @@ -121,7 +121,7 @@ var ignoreSuffixes = []string{ "~", } -const minBootstrap = "go1.22.6" +const minBootstrap = "go1.24.6" var tryDirs = []string{ "sdk/" + minBootstrap, diff --git a/src/cmd/dist/notgo122.go b/src/cmd/dist/notgo122.go deleted file mode 100644 index 229a26e757..0000000000 --- a/src/cmd/dist/notgo122.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2022 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Go 1.24 and later requires Go 1.22.6 as the bootstrap toolchain. -// If cmd/dist is built using an earlier Go version, this file will be -// included in the build and cause an error like: -// -// % GOROOT_BOOTSTRAP=$HOME/sdk/go1.16 ./make.bash -// Building Go cmd/dist using /Users/rsc/sdk/go1.16. (go1.16 darwin/amd64) -// found packages main (build.go) and building_Go_requires_Go_1_22_6_or_later (notgo122.go) in /Users/rsc/go/src/cmd/dist -// % -// -// which is the best we can do under the circumstances. -// -// See go.dev/issue/44505 for more background on -// why Go moved on from Go 1.4 for bootstrap. - -//go:build !go1.22 - -package building_Go_requires_Go_1_22_6_or_later diff --git a/src/cmd/dist/notgo124.go b/src/cmd/dist/notgo124.go new file mode 100644 index 0000000000..dc6ef4d8bd --- /dev/null +++ b/src/cmd/dist/notgo124.go @@ -0,0 +1,21 @@ +// Copyright 2022 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Go 1.26 and later requires Go 1.24.6 as the minimum bootstrap toolchain. +// If cmd/dist is built using an earlier Go version, this file will be +// included in the build and cause an error like: +// +// % GOROOT_BOOTSTRAP=$HOME/sdk/go1.16 ./make.bash +// Building Go cmd/dist using /Users/rsc/sdk/go1.16. (go1.16 darwin/amd64) +// found packages main (build.go) and building_Go_requires_Go_1_24_6_or_later (notgo124.go) in /Users/rsc/go/src/cmd/dist +// % +// +// which is the best we can do under the circumstances. +// +// See go.dev/issue/44505 and go.dev/issue/54265 for more +// background on why Go moved on from Go 1.4 for bootstrap. + +//go:build !go1.24 + +package building_Go_requires_Go_1_24_6_or_later -- cgit v1.3