-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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 -i returning error if "net/http" is imported and clang set in CC and CXX #25138
Comments
It would be nice to fix this, though at the moment I don't see how. |
Note that there isn't much reason to use |
I have the same problem on Raspbian. I use LiteIDE. To eliminate the problem I had to modify the file: |
The author of Lite IDE helped me to solve the problem on Raspberry Pi 3: |
I have the same problem, even with CC="gcc" and CXX="g++"
|
This error reproduces itself on macOS High Sierra 10.14 with XCode command-line tools installed.
|
This is similar to #27285. Since |
We should make this change, but not during the freeze. It'll have to slip another release. |
As of Go 1.20, standard-library packages no longer have an install target, and |
What did you do?
I updated my Go installation from 1.8 to 1.10.1. I used the officially provided archive (go1.10.1.linux-amd64.tar.gz) for Linux x86-64 from https://golang.org/dl/.
When I try to use the "net/http" package in a file
go build -i
prints the following errorgo build runtime/cgo: open /usr/local/go/pkg/linux_amd64/runtime/cgo.a: permission denied
. If I just rungo build
without-i
or if I downgrade to Go 1.9.5 and run the command the error does not appear and everything builds without errors.The following code can be used to reproduce the issue:
Code on The Go Playground
I further investigated this issue and tried to reproduce it on the Linux machines of two friends. We discovered that the issue only occurs if the following environment variable values are set:
CC="clang"
andCXX="clang++"
. If those variables are set toCC="gcc"
andCXX="g++"
the command runs as expected without errors.What did you expect to see?
No error and a compiled binary.
What did you see instead?
The following error message and no binary.
go build runtime/cgo: open /usr/local/go/pkg/linux_amd64/runtime/cgo.a: permission denied
System details
The text was updated successfully, but these errors were encountered: