-
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 build fails with permission error inside a temporary directory on Windows #42224
Comments
Thank you for raising this issue. Anti virus software often causes problems on windows systems. Would you be able to temporarily disable your AV software and see if that makes a difference? |
thank you for your reply,I can't close it,I wonder if modifying his build directory can be solved |
As a workaround can you try using |
the same mistake,whether to change the directory of |
Can you please post the entire output you see. Do not use a screenshot.
This seems unrelated. Please open a new issue so it can be addressed independently. Thank you |
12:55 [xyz@docker go-mongo ] (develop) go build main.go
open C:\Users\zyx~1\AppData\Local\Temp\go-build060591562\b001\exe\a.out.exe: The process cannot access the file because it is being used by another process.
|
CC @jayconrod, @matloob, @bcmills. |
The problem is that if GOTMPDIR is not set, golang will sometimes build in that generic \Temp directory that is dangerous to allow as a generic exception to Kaspersky. Assuming you've already added your GOPATH as an exception in Kaspersky (for example, "C:\Users<user>\go"...what worked for me was to
And the issue goes away. But note that I already added "C:\Users<user>\go" as an exception to Kaspersky. |
This is the same issue as #29093, and is still reproduced (1.20). |
As far as I can tell the solution here is to set @elazarg, if you are correctly setting |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go run main.go
What did you expect to see?
What did you see instead?
open C:\Users\zyx~1\AppData\Local\Temp\go-build933307734\b001\exe\a.out.exe: The process cannot access the file because it is being used by another process.
The text was updated successfully, but these errors were encountered: