-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'go/release-branch.go1.21' into update-g…
…o1.21.5
- Loading branch information
Showing
21 changed files
with
405 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
go1.21.4 | ||
time 2023-11-01T20:46:39Z | ||
go1.21.5 | ||
time 2023-11-29T21:21:46Z |
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
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
107 changes: 107 additions & 0 deletions
107
src/cmd/go/testdata/script/mod_download_exec_toolchain.txt
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 |
---|---|---|
@@ -0,0 +1,107 @@ | ||
env TESTGO_VERSION=go1.21 | ||
env TESTGO_VERSION_SWITCH=switch | ||
|
||
# First, test 'go mod download' outside of a module. | ||
# | ||
# There is no go.mod file into which we can record the selected toolchain, | ||
# so unfortunately these version switches won't be as reproducible as other | ||
# go commands, but that's still preferable to failing entirely or downloading | ||
# a module zip that we don't understand. | ||
|
||
# GOTOOLCHAIN=auto should run the newer toolchain | ||
env GOTOOLCHAIN=auto | ||
go mod download rsc.io/needgo121@latest rsc.io/needgo122@latest rsc.io/needgo123@latest rsc.io/needall@latest | ||
stderr '^go: rsc.io/needall@v0.0.1 requires go >= 1.23; switching to go1.23.9$' | ||
! stderr '\(running' | ||
|
||
# GOTOOLCHAIN=min+auto should run the newer toolchain | ||
env GOTOOLCHAIN=go1.21+auto | ||
go mod download rsc.io/needgo121@latest rsc.io/needgo122@latest rsc.io/needgo123@latest rsc.io/needall@latest | ||
stderr '^go: rsc.io/needall@v0.0.1 requires go >= 1.23; switching to go1.23.9$' | ||
! stderr '\(running' | ||
|
||
# GOTOOLCHAIN=go1.21 should NOT run the newer toolchain | ||
env GOTOOLCHAIN=go1.21 | ||
! go mod download rsc.io/needgo121@latest rsc.io/needgo122@latest rsc.io/needgo123@latest rsc.io/needall@latest | ||
! stderr switching | ||
stderr 'rsc.io/needgo122@v0.0.1 requires go >= 1.22' | ||
stderr 'rsc.io/needgo123@v0.0.1 requires go >= 1.23' | ||
stderr 'rsc.io/needall@v0.0.1 requires go >= 1.23' | ||
stderr 'requires go >= 1.23' | ||
! stderr 'requires go >= 1.21' # that's us! | ||
|
||
|
||
# JSON output should be emitted exactly once, | ||
# and non-JSON output should go to stderr instead of stdout. | ||
env GOTOOLCHAIN=auto | ||
go mod download -json rsc.io/needgo121@latest rsc.io/needgo122@latest rsc.io/needgo123@latest rsc.io/needall@latest | ||
stderr '^go: rsc.io/needall@v0.0.1 requires go >= 1.23; switching to go1.23.9$' | ||
! stderr '\(running' | ||
stdout -count=1 '"Path": "rsc.io/needgo121",' | ||
stdout -count=1 '"Path": "rsc.io/needgo122",' | ||
stdout -count=1 '"Path": "rsc.io/needgo123",' | ||
stdout -count=1 '"Path": "rsc.io/needall",' | ||
|
||
# GOTOOLCHAIN=go1.21 should write the errors in the JSON Error fields, not to stderr. | ||
env GOTOOLCHAIN=go1.21 | ||
! go mod download -json rsc.io/needgo121@latest rsc.io/needgo122@latest rsc.io/needgo123@latest rsc.io/needall@latest | ||
! stderr switching | ||
stdout -count=1 '"Error": "rsc.io/needgo122@v0.0.1 requires go .*= 1.22 \(running go 1.21; GOTOOLCHAIN=go1.21\)"' | ||
stdout -count=1 '"Error": "rsc.io/needgo123@v0.0.1 requires go .*= 1.23 \(running go 1.21; GOTOOLCHAIN=go1.21\)"' | ||
stdout -count=1 '"Error": "rsc.io/needall@v0.0.1 requires go .*= 1.23 \(running go 1.21; GOTOOLCHAIN=go1.21\)"' | ||
! stdout '"Error": "rsc.io/needgo121' # We can handle this one. | ||
! stderr . | ||
|
||
|
||
# Within a module, 'go mod download' of explicit versions should upgrade if | ||
# needed to perform the download, but should not change the main module's | ||
# toolchain version (because the downloaded modules are still not required by | ||
# the main module). | ||
|
||
cd example | ||
cp go.mod go.mod.orig | ||
|
||
env GOTOOLCHAIN=auto | ||
go mod download rsc.io/needgo121@latest rsc.io/needgo122@latest rsc.io/needgo123@latest rsc.io/needall@latest | ||
stderr '^go: rsc.io/needall@v0.0.1 requires go >= 1.23; switching to go1.23.9$' | ||
! stderr '\(running' | ||
cmp go.mod go.mod.orig | ||
|
||
|
||
# However, 'go mod download' without arguments should fix up the | ||
# 'go' and 'toolchain' lines to be consistent with the existing | ||
# requirements in the module graph. | ||
|
||
go mod edit -require=rsc.io/needall@v0.0.1 | ||
cp go.mod go.mod.121 | ||
|
||
# If an upgrade is needed, GOTOOLCHAIN=go1.21 should cause | ||
# the command to fail without changing go.mod. | ||
|
||
env GOTOOLCHAIN=go1.21 | ||
! go mod download | ||
stderr 'rsc.io/needall@v0.0.1 requires go >= 1.23' | ||
! stderr switching | ||
cmp go.mod go.mod.121 | ||
|
||
# If an upgrade is needed, GOTOOLCHAIN=auto should perform | ||
# the upgrade and record the resulting toolchain version. | ||
|
||
env GOTOOLCHAIN=auto | ||
go mod download | ||
stderr '^go: module rsc.io/needall@v0.0.1 requires go >= 1.23; switching to go1.23.9$' | ||
cmp go.mod go.mod.final | ||
|
||
|
||
-- example/go.mod -- | ||
module example | ||
|
||
go 1.21 | ||
-- example/go.mod.final -- | ||
module example | ||
|
||
go 1.23 | ||
|
||
toolchain go1.23.9 | ||
|
||
require rsc.io/needall v0.0.1 |
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
Oops, something went wrong.