Skip to content
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

Go 1.5 on OSX fails to build unable to locate sysctl #9437

Closed
miah opened this issue Aug 25, 2015 · 3 comments
Closed

Go 1.5 on OSX fails to build unable to locate sysctl #9437

miah opened this issue Aug 25, 2015 · 3 comments
Labels
6.topic: darwin Running or building packages on Darwin

Comments

@miah
Copy link

miah commented Aug 25, 2015

go tool dist: FAILED: sysctl machdep.cpu.extfeatures: exec: "sysctl": executable file not found in $PATH
builder for ‘/nix/store/jqgqfv3i61c5pi2f2vxar41k80fajmad-go-1.5.drv’ failed with exit code 1
error: build of ‘/nix/store/jqgqfv3i61c5pi2f2vxar41k80fajmad-go-1.5.drv’ failed

Log: https://gist.github.com/miah/67765a0452c09921c1b7

sysctl is of course included with osx, and located in /usr/sbin.

@vcunat vcunat added the 6.topic: darwin Running or building packages on Darwin label Aug 25, 2015
@arnehormann
Copy link

To maybe save whoever fixes this some time:

It worked for me after changing the install phase in ~/.nix-defexpr/channels/nixpkgs/pkgs/development/compilers/go/1.5.nix.

I first added /usr/sbin to the path and ran into another bug.

That's why I also changed all.bash to make.bash. That's in no way a proper fix, but I didn't see another way; the bug is apparently related to CGO and Go issue 11994.
I just didn't see where I can best add the official workaround (-ldflags=-s) during the tests - probably somewhere in https://github.com/golang/go/blob/master/src/cmd/dist/test.go#L589.

Here's the relevant part of the file after changes:

    export PATH="$GOBIN:$PATH:/usr/sbin"
    cd ./src
    echo Building
    ./make.bash

I guess it's not the proper way, but I restored the original version of 1.5.nix afterwards.
Using nix-build -A on a fresh clone of nixpks just unleashed a bunch of compilation issues starting with stuff in zlib I didn't want to deal with, so I fumbled through this the way I did.

@Profpatsch
Copy link
Member

probably long fixed. @zimbatm

@zimbatm
Copy link
Member

zimbatm commented Jul 23, 2016

I don't have a mac anymore. Let's close this and see if it gets re-opened.

@zimbatm zimbatm closed this as completed Jul 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

5 participants