-
-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Unable to build simple Go program that makes use of C bindings #25959
Comments
I think this has to do with how Go handles GOROOT. It expects to be able to write to $GOROOT even though it's a read-only path. Could you try the buildCommand in go-ethereum: https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/altcoins/go-ethereum.nix#L18-L21 |
Uses clang as a workaround for NixOS#25959.
Aw, I was wondering how to get rid of that warning. The warning is gone, but it doesn't seem to have helped:
I originally ran into this issue when I tried to upgrade that linked Nix expression. Version 1.4.7 of go-ethereum compiles just fine, but 1.6.1 doesn't, because now one of the dependencies makes use of some kind of C bindings. While playing around with it I also switched over to using But that's just a workaround and I would assume that other Go packages will at some point also run into this problem when they just use |
I ran into this problem adding seccomp support to the docker package. It's caused by the -O2 optimization flag which is being added by the fortify hardening flag. A possible fix would be to add hardeningDisable = [ "fortify" ]; to the buildGoPackage. |
I can't no longer reproduce this on my system so I guess the issue is fixed?
I created a PR to get rid of the workarounds: #72093 |
it seems that the issue NixOS#25959 is not present anymore
I can confirm that I also cannot reproduce this anymore on my system. I am closing this - thanks! |
it seems that the issue NixOS#25959 is not present anymore (cherry picked from commit afd38ea)
Issue description
Using go + stdenv.cc I am unable to build a simple Go program that makes use of C bindings. The program is a testcase from the Go compiler repository ( https://raw.githubusercontent.com/golang/go/master/misc/cgo/errors/issue14669.go ) . The build fails with an error message like this:
Steps to reproduce
Another example is geth, the go ethereum client, in version 1.6.1:
Switching to clang instead seems to be a workaround for the problem:
This last command builds successfully.
Technical details
The text was updated successfully, but these errors were encountered: