diff options
author | Russ Cox <rsc@golang.org> | 2022-08-03 22:50:37 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2022-08-04 14:47:49 +0000 |
commit | ab0a94c6d32f758d9e61e3893e09f0a742347b4a (patch) | |
tree | 3a13d9e8042341b52189d9382ead19758afa3bca | |
parent | 1e3c19f3fee12e5e2b7802a54908a4d4d03960da (diff) | |
download | go-ab0a94c6d32f758d9e61e3893e09f0a742347b4a.tar.gz go-ab0a94c6d32f758d9e61e3893e09f0a742347b4a.zip |
cmd/dist: require Go 1.17 for building Go
This makes builds using earlier Go bootstrap versions fail pretty clearly:
% 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_17_or_later (notgo117.go) in /Users/rsc/go/src/cmd/dist
%
All the builders have Go 1.17 or later for bootstrap now except
for the android corellium builders, which still need updating (#54246).
We are accepting breakage on those for now.
Fixes #44505.
Change-Id: I12a67f42f61dba43a331cee0a150194d3e42c044
Reviewed-on: https://go-review.googlesource.com/c/go/+/420902
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
-rw-r--r-- | src/cmd/dist/notgo117.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cmd/dist/notgo117.go b/src/cmd/dist/notgo117.go new file mode 100644 index 0000000000..eb1c949b00 --- /dev/null +++ b/src/cmd/dist/notgo117.go @@ -0,0 +1,22 @@ +// 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.20 and later requires Go 1.17 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_17_or_later (notgo117.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.17 +// +build !go1.17 + +package building_Go_requires_Go_1_17_or_later |