-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: "go version" fails if CWD is deleted #34499
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
Comments
How realistic is this scenario? I agree that technically this should work, but in practice I assume this helps keep the global simpler, as one can rely on I'm just not convinced that this is worth the effort. For example, do we want to add /cc @bcmills @jayconrod |
I think it would be fine to accept a fix for this, provided that the fix is not too invasive in practice, but I do not plan to fix it myself. |
I was trying to reproduce and investigate, but I cannot. It might be platform/shell specific ###What version of Go are you using ( What did you do?
It works on both zsh and bash for me |
@AndersonQ, note that the original report was on |
The question here is, do we really want to go for a global singleton route? |
Change https://golang.org/cl/268261 mentions this issue: |
If the go command is executed on Linux in a deleted directory, it fails. This behavior is reasonable for commands which depend on the CWD, but it's unexpected for commands like `go version`. This change delays initialization of a global CWD variable. Fixed golang#34499 Change-Id: I7302fb84a3b7f5f149a123d277abd5b9b5bc95b2
If the go command is executed on Linux in a deleted directory, it fails. This behavior is reasonable for commands which depend on the CWD, but it's unexpected for commands like `go version`. This change delays initialization of a global CWD variable. Fixed golang#34499 Change-Id: I7302fb84a3b7f5f149a123d277abd5b9b5bc95b2
If the go command is executed on Linux in a deleted directory, it fails. This behavior is reasonable for commands which depend on the CWD, but it's unexpected for commands like `go version`. This change delays initialization of a global CWD variable. Fixed golang#34499 Change-Id: I7302fb84a3b7f5f149a123d277abd5b9b5bc95b2
If the go command is executed on Linux in a deleted directory, it fails. This behavior is reasonable for commands which depend on the CWD, but it's unexpected for commands like `go version`. This change delays initialization of a global CWD variable. Fixed golang#34499 Change-Id: I7302fb84a3b7f5f149a123d277abd5b9b5bc95b2
If the go command is executed on Linux in a deleted directory, it fails. This behavior is reasonable for commands which depend on the CWD, but it's unexpected for commands like `go version`. This change delays initialization of a global CWD variable. Fixed golang#34499 Change-Id: I7302fb84a3b7f5f149a123d277abd5b9b5bc95b2
Change https://golang.org/cl/317249 mentions this issue: |
They empirically do not seem to support deleting the current working directory. Updates #34499 Change-Id: I705cdf8b545fbb837d5b75d2904a7c2a89276fa5 Reviewed-on: https://go-review.googlesource.com/c/go/+/317249 Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
true
What did you do?
What did you expect to see?
go version
should be unrelated to CWD.What did you see instead?
go version
needs to confirm CWD.The text was updated successfully, but these errors were encountered: