-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: TestScript/gotoolchain_issue66175 fails on tip locally #67277
Comments
Oh, it seems that this is because I have a I guess this is not a bug in the go command or the test, but my environment. Is it possible to make the go command not look at my PATH? Or make this test resilient for that? Thanks. |
Reopen. It would be good to make the test not depend on things in my PATH. Thanks. |
https://go.dev/doc/toolchain#select includes:
Trying it with a local go1.22.3 toolchain, that behavior is working as expected: $ GOTOOLCHAIN=local go version
go version go1.22.3 darwin/arm64
$ which go1.22 go1.22.0
go1.22 not found
go1.22.0 not found
# Check if it would be willing to use a binary that isn't named "go1.22.0"
# when a go1.22.0 toolchain is requested.
$ printf "#\!/bin/sh\necho 'a script named go1.22, notably without .0'" > ~/bin/go1.22 && chmod u+x ~/bin/go1.22
$ GOTOOLCHAIN=go1.22.0+path go version
go: cannot find "go1.22.0" in PATH
$ printf "#\!/bin/sh\necho 'a script named go1.22.0, notably with .0'" > ~/bin/go1.22.0 && chmod u+x ~/bin/go1.22.0
$ GOTOOLCHAIN=go1.22.0+path go version
a script named go1.22.0, notably with .0 The same at tip: $ GOTOOLCHAIN=local go version
go version devel go1.23-df4f40b9e0 Fri May 10 16:04:54 2024 +0000 darwin/arm64
$ which go1.22 go1.22.0
go1.22 not found
go1.22.0 not found
# Check if it would be willing to use a binary that isn't named "go1.22.0"
# when a go1.22.0 toolchain is requested.
$ printf "#\!/bin/sh\necho 'a script named go1.22, notably without .0'" > ~/bin/go1.22 && chmod u+x ~/bin/go1.22
$ GOTOOLCHAIN=go1.22.0+path go version
go: cannot find "go1.22.0" in PATH So it seems having a binary named |
Change https://go.dev/cl/584258 mentions this issue: |
@gopherbot Please backport to Go 1.21 and Go 1.22. |
Backport issue(s) opened: #67310 (for 1.21), #67311 (for 1.22). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Change https://go.dev/cl/584935 mentions this issue: |
Change https://go.dev/cl/584955 mentions this issue: |
…hain_issue66175 The gotoolchain_issue66175 script test would fail if a binary named go1.21 or go1.22 was present in the system PATH. Clear the path at the beginning of the test to make it independent of the system path. For #67277 Fixes #67311 Change-Id: I6d9133aee5b20ab116e07b659e8ecf3eb8add4ed Reviewed-on: https://go-review.googlesource.com/c/go/+/584258 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Cherry Mui <[email protected]> (cherry picked from commit a0a6026) Reviewed-on: https://go-review.googlesource.com/c/go/+/584955 Auto-Submit: Dmitri Shuralyov <[email protected]>
…hain_issue66175 The gotoolchain_issue66175 script test would fail if a binary named go1.21 or go1.22 was present in the system PATH. Clear the path at the beginning of the test to make it independent of the system path. For #67277 Fixes #67310 Change-Id: I6d9133aee5b20ab116e07b659e8ecf3eb8add4ed Reviewed-on: https://go-review.googlesource.com/c/go/+/584258 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Cherry Mui <[email protected]> (cherry picked from commit a0a6026) Reviewed-on: https://go-review.googlesource.com/c/go/+/584935 Auto-Submit: Dmitri Shuralyov <[email protected]>
Go version
tip.
go version devel go1.23-9eebdca8a9 Thu May 9 20:33:37 2024 +0000 darwin/amd64
Output of
go env
in your module/workspace:What did you do?
Run cmd/go TestScript/gotoolchain_issue66175 locally on my macOS machine.
What did you see happen?
What did you expect to see?
Test passes.
It doesn't seem to fail on the build dashboard. I don't think my machine has weird setup, but that is certainly possible. Let me know if there is anything I can find to help.
Thanks.
cc @matloob @samthanawalla
The text was updated successfully, but these errors were encountered: