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: permission denied on macOS, with go install
command when I set GOOS=linux
#20571
Comments
If I set back GOOS to darwin with export GOOS=darwin command, then it works again, it uses the GOPATH variable as deployment destination, again. |
See the section on "go build vs go install" in the blog post. https://dave.cheney.net/2015/08/22/cross-compilation-with-go-1-5
… On 4 Jun 2017, at 17:18, Gergely Szécsényi ***@***.***> wrote:
If I set back GOOS to darwin with export GOOS=darwin command, then it works again, it uses the GOPATH variable as deployment destination, again.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I'm seeing this same issue but with exporting GOOS=windows on Linux and running go get, which in turn calls go install. I have GOPATH set to a local directory but go install appears to be ignoring it. My workaround is to just run go get before changing GOOS in my build scripts. Probably obvious but my CI job is building Windows and Linux binaries on a Linux build machine. |
@matthewcummings can you please open a new issue including all the required information in the template. Please also include the output of adding the -x flag to go get/install which will show us the commands the Go tool executed. If this turns out to be a duplicate then we’ll merge the issues. Thanks. |
@gszecsenyi - Please use |
go install
command when I set GOOS=linux
Closing for now given this (very good) explanation from @davecheney’s post. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go1.8.3
What operating system and processor architecture are you using (
go env
)?darwin/amd64
What did you do?
export GOOS=linux
go install
The error message is:
go install runtime/internal/sys: mkdir /usr/local/go/pkg/linux_amd64: permission denied
I also have this issue. On OSX, go1.8.3 darwin/amd64. If I set GOOS=linux, then it fails, because it want to create the pkg directory on GOROOT and not on GOPATH.
This is the error message:
go install runtime/internal/sys: mkdir /usr/local/go/pkg/linux_amd64: permission denied
GOPATH is "/Users/xxx/Documents/GitHub/developments/go/"
The text was updated successfully, but these errors were encountered: