-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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 get fails when directory command launched from gets deleted #14093
Comments
You start go get in the background, then while it is running cd up one directory and delete the CWD that git (forked from go get) is running in. I understand that go get will be checking out into a different location, but I don't think it is unreasonable for git to assume that it's cwd will remain valid while it's doing a checkout. I don't believe that there is anything to fix in the go tool for the bug you've reported, but I get a feeling that this is a reproduction of a different issue that you're trying to solve. Can you explain more about how you discovered this issue. |
Sure thing. I accidentally cloned a repo to the wrong location instead of using go get and when I realized this, I used |
git is looking for the cwd in order to convert the relative paths to absolute. In the case of |
@rakyll go get forks git in the current working directory. It could equally fork git in Having said that, I'm unconvinced this is a bug or should be fixed. If you don't want git to complain that the working directory is missing, don't delete it behind git's back. |
@davecheney To be more clear, I don't understand why go get is cloning in the current directory. go get is a tool to download packages to a certain destination that is not tied to the cwd. I am not quite convinced the current case shouldn't be improved even though I'd say it is not critical enough to care. |
Go get isn't cloning in the current directory, git is, because the go tool On Tue, Jan 26, 2016 at 1:54 PM, Burcu Dogan notifications@github.com
|
Sorry for the implicit wording, this is what I meant above. I am talking about cd'ing into GOPATH (or setting an env variable if possible) to make git clone in a directory that makes sense. |
Sounds good to me. On Tue, Jan 26, 2016 at 2:15 PM, Burcu Dogan notifications@github.com
|
I don't think it's worth putting a workaround in here; many Unix programs including "go get" become unhappy if their working directory goes away while they are running. "Don't do that." |
Since the directory is not in the
$GOPATH/
tree, I did not expect any errors. It's pretty minor but worth mentioning if others run into it.The text was updated successfully, but these errors were encountered: