/ go Public
cmd/go: improve handling of tmpdir being noexec #52941
The path to resolution is known, but the work has not been done.
What version of Go are you using (
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
What did you do?
go teston a system with
What did you expect to see?
Tests run, or some helpful suggestion on how to fix the problem.
What did you see instead?
fork/exec /tmp/go-build/...: .permission denied
In #8451 the new
GOTMPDIRwas added, allowing a user to configure their system to fix this situation. Unfortunately the Go command does not provide that context or recommendation to me as a user if it runs into this situation.
On systems using systemd a reasonable choice could be to instead default to
XDG_RUNTIME_DIR(with fallbacks to (
TMPDIR), which has the added benefit of being tied to the user session (instead of being a system-wide thing) and getting cleaned up somewhat regularly. Checking if that environment variable is defined ought to be enough, as it's set by pam-systemd (or was explicitly set by the user).
Regardless of potential changes to the default behaviour, I think it would be helpful to users if the go command could output the suggestion to configure
GOTPMDIRin case it hits the permission denied case when launching the test binary.
The text was updated successfully, but these errors were encountered: