Skip to content
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: go clean can make go unusable #62718

Closed
fasmat opened this issue Sep 19, 2023 · 3 comments
Closed

cmd/go: go clean can make go unusable #62718

fasmat opened this issue Sep 19, 2023 · 3 comments

Comments

@fasmat
Copy link

fasmat commented Sep 19, 2023

What version of Go are you using (go version)?

I was using 1.21.0 with toolchain 1.21.1

$ go version
bash: /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.1.linux-arm64/bin/go: No such file or directory

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
bash: /go/pkg/mod/golang.org/toolchain@v0.0.1-go1.21.1.linux-arm64/bin/go: No such file or directory

What did you do?

I was using go 1.21.0 and updated to 1.21.1 using the new go get go@1.21.1 option to do so. Afterwards I ran go clean -cache -modcache. Now any go command returns the error above complaining about the missing toolcain.

What did you expect to see?

Not sure, probably go using 1.21.0 if the installed toolchain was removed.

What did you see instead?

The go command broke.

@fasmat
Copy link
Author

fasmat commented Sep 19, 2023

Closing my shell and opening a new one seems to have fixed the issue:

$ go version
go: downloading go1.21.1 (linux/arm64)
go version go1.21.1 linux/arm64

But it is reproducible by running go clean -cache -modcache to trigger the error mentioned above and only closing and reopening a shell seems to allow go to fix the issue itself.

@seankhliao
Copy link
Member

sounds like your shell is caching something it shouldn't be

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2023
@dolmen
Copy link
Contributor

dolmen commented Nov 10, 2023

This issue lacks information:

  • is go env launched from a tree with a go.mod? What is the content of that go.mod?
  • output of which go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants