-
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: build sets PWD to relative path #46832
Comments
go build
sets PWD=.
(relative path instead of absolute) and breaks at least ccache.
Looked into this a bit. I was able to reproduce the failure on a Debian machine. Adding a panic on non-absolute paths to |
Change https://golang.org/cl/378396 mentions this issue: |
This issue is currently labeled as early-in-cycle for Go 1.19. |
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?
This is a forward of downstream ccache/ccache#860 bug where
ccache
was confused byPWD=.
set bygo build
. In ccache/ccache#860 (comment) Joel Rosdahl notes thatPWD
should be an absolute path.ccache
is fixed since but I think it's worth fixinggo build
not to produce relative paths.Executable single-file example:
Here is a directly executable example to illustrate the problem extracted from
docker
project:What did you expect to see?
Expected the test to build successfully.
What did you see instead?
The
ccache
detects relative path inPWD
and crashes:The text was updated successfully, but these errors were encountered: