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 -i doesn't report failure to delete executable files that are in use on Windows #4208
Labels
Milestone
Comments
No, it silently succeeds. Here's a little snippet: C:\Users\matt>go clean -i -x bitbucket.org/anacrolix/dms/dms-gtk-gui cd d:\gopath\src\bitbucket.org\anacrolix\dms\dms-gtk-gui rm -f dms-gtk-gui dms-gtk-gui.exe dms-gtk-gui.test dms-gtk-gui.test.exe main mai n.exe rm -f d:\gopath\bin\dms-gtk-gui.exe C:\Users\matt>go install -v -ldflags -Hwindowsgui bitbucket.org/anacrolix/dms/dm s-gtk-gui The file is still there (I'm running the executable it's trying to delete). Later, it doesn't bother to install because the file is still present. |
I see what your problem is. But I do not know what to do. Like minux says, we ignore errors from os.Remove. I suspect, the reasoning is that too many false positives. Also we can't do much about them anyway. But I can see its effect on windows - linux would remove the file regardless whether you are running it or not, but windows is picky in that situation. I think, the best we could do here is warn you about the problem. Perhaps we could check os.Remove error for os.IsNotExist. We should skip the once that match os.IsNotExist, but display the others. I am not certain, it will look. So leaving it for others to decide. Alex Labels changed: added os-windows. Status changed to Thinking. |
https://golang.org/cl/6635064/ Owner changed to @minux. Status changed to Started. |
This issue was closed by revision bf7d229. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: