cmd/go: TestScript/env_changed fails when modifying go.env for Go distributions #67793
Labels
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
okay-after-rc1
Used by release team to mark a release-blocker issue as okay to resolve either before or after rc1
release-blocker
Milestone
Go version
go version devel go1.23-eaa7d9ff86 Mon Jun 3 14:56:37 2024 +0000 linux/amd64
Output of
go env
in your module/workspace:What did you do?
go.env
to change the last line toGOTOOLCHAIN=local
.bin/go test cmd/go -run=Script/^env_changed$
What did you see happen?
The test seems to assume that the default
go.env
is being used, and "changes" the value toGOTOOLCHAIN=local
. However, this isn't a change in my case, so the test fails.https://github.com/golang/go/blob/eaa7d9ff86b35c72cc35bd7c14b349fa414c392f/src/cmd/go/testdata/script/env_changed.txt
What did you expect to see?
https://go.dev/doc/toolchain suggests that it should be possible for repackaged Go toolchains to change this value, so I expected tests to pass.
I'm not quite familiar enough with TestScript to submit a CL off the top of my head that will make the test conditionally skip based on what
go.env
already contains, but this is the kind of fix I might expect.It seems like a better fix would be to have the script use GOTOOLCHAIN
local
if go.env saysauto
, and useauto
if go.env sayslocal
, but this might be too complicated.The workaround for Go repackagers is simple--patch a
skip
into this test script when there's ago.env
modification. IMO this shouldn't be necessary, though.The text was updated successfully, but these errors were encountered: