Skip to content

cmd/go: TestScript/gotoolchain_path fails if golang.org/dl/go1.21.1 is installed in the user's $PATH #62709

@bcmills

Description

@bcmills
~$ gotip version
go version devel go1.22-ee788dba Sat Sep 9 01:48:44 2023 +0000 linux/amd64

~$ gotip test cmd/go -run=TestScript/gotoolchain_path
vcs-test.golang.org rerouted to http://127.0.0.1:44505
https://vcs-test.golang.org rerouted to https://127.0.0.1:45531
go test proxy running at GOPROXY=http://127.0.0.1:44641/mod
--- FAIL: TestScript (0.19s)
    --- FAIL: TestScript/gotoolchain_path (0.38s)
        script_test.go:132: 2023-09-18T20:24:15Z
        script_test.go:134: $WORK=/tmp/cmd-go-test-1726110853/tmpdir535136021/gotoolchain_path2675966255
        script_test.go:156:
            # This test only checks that basic PATH lookups work.
            # The full test of toolchain version selection is in gotoolchain.txt. (0.000s)
            # Compile a fake toolchain to put in the path under various names. (0.241s)
            # GOTOOLCHAIN=go1.50.0 (0.010s)
            # GOTOOLCHAIN=path with toolchain line (0.017s)
            # GOTOOLCHAIN=path with go line (0.010s)
            # GOTOOLCHAIN=auto with toolchain line (0.013s)
            # GOTOOLCHAIN=auto with go line (0.012s)
            # NewerToolchain should find Go 1.50.0. (0.060s)
            > env GOTOOLCHAIN=local
            > go mod edit -toolchain=none -go=1.22
            > grep 'go 1.22$' go.mod
            matched: go 1.22
            > ! grep toolchain go.mod
            > env GOTOOLCHAIN=path
            > ! go run rsc.io/[email protected]
            [stderr]
            go: downloading rsc.io/fortune v0.0.1
            go: rsc.io/[email protected] requires go >= 1.21rc999; switching to go1.21.1
            go1.21.1: not downloaded. Run 'go1.21.1 download' to install to /no-home/sdk/go1.21.1
            [exit status 1]
            > stderr 'running go1.50.0 from PATH'
        script_test.go:156: FAIL: testdata/script/gotoolchain_path.txt:67: stderr 'running go1.50.0 from PATH': no match for `(?m)running go1.50.0 from PATH` in stderr
FAIL
FAIL    cmd/go  0.618s
FAIL

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeGoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.TestingAn issue that has been verified to require only test changes, not just a test failure.release-blocker

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions