-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: subprocess (linker, cgo command) does not use the value of GOTMPDIR variable #59636
Comments
If we want to be fully consistent, I wonder whether cmd/go should set |
Agreed with @ianlancetaylor that cmd/go is probably a better place to do the setting. One consequence is that it will also affect external commands invoked by Go tools (e.g. the C compiler, C linker, Updated the issue title to cmd/go tentatively. |
Just to add a datapoint, right now Windows Defender with default settings is interfering with Go builds and reporting this as a trojan:
|
What version of Go are you using (
go version
)?1.20.3.
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?Windows 10,
Intel x86-64.
What did you do?
My environment variable
GOTMPDIR
is set to a custom place.When I am trying to build something I look at the compiler's output using the
-x
argument.It looks like, the compiler is using the
GOTMPDIR
at the frist stage of executable file building, at the compile stage, but at the second stage it uses the default system path instead of theGOTMPDIR
variable.What did you expect to see?
I expect to use the
GOTMPDIR
variable value for all build stages in Go.What did you see instead?
It looks like, the compiler is using the
GOTMPDIR
at the frist stage of executable file building, at the compile stage, but at the second stage it uses the default system path instead of theGOTMPDIR
variable.Here we can see that path in first stage is:
But in the linking stage it is suddenly changed to the default path:
The text was updated successfully, but these errors were encountered: