-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: fix two-step toolchain upgrade through go install, GOTOOLCHAIN
If we do one upgrade because of a go install target's go.mod file, we still might need a second upgrade to implement the GOTOOLCHAIN minimum. Instead of allowing a two-step switch (which we were cutting off anyway), skip the first step and go straight to the GOTOOLCHAIN min upgrade. Fixes golang#69051. Change-Id: I16f060f473574d8b8f84c55fae2fd0cdabc8aa19 Reviewed-on: https://go-review.googlesource.com/c/go/+/637496 Reviewed-by: Michael Matloob <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
- Loading branch information
Showing
2 changed files
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,6 +197,17 @@ go mod edit -go=1.501 -toolchain=none | |
go version | ||
stdout go1.501 | ||
|
||
# avoid two-step switch, first from install target requirement, then from GOTOOLCHAIN min | ||
# instead, just jump directly to GOTOOLCHAIN min | ||
env TESTGO_VERSION=go1.2.3 | ||
env GODEBUG=toolchaintrace=1 | ||
env GOTOOLCHAIN=go1.23.0+auto | ||
! go install rsc.io/fortune/[email protected] | ||
! stderr 'switching to go1.22.9' | ||
stderr 'using go1.23.0' | ||
env GODEBUG= | ||
env GOTOOLCHAIN=auto | ||
|
||
# go install m@v and go run m@v should ignore go.mod and use m@v | ||
env TESTGO_VERSION=go1.2.3 | ||
go mod edit -go=1.999 -toolchain=go1.998 | ||
|