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/dist: The OSX build breaks if /usr/sbin is not in the path #13425
Comments
Is it common to not have /usr/sbin in the path ? Can you give some more background on how your discovered this issue. |
It might be fine for Gentoo/Alt to carry that patch, Actually, I think a better solution for Gentoo/Alt |
That would be awesome, that way we could also build a different arch than sysctl would report. |
@minux: Thanks much for your time. :-) |
Why are we talking about Gentoo? I thought that was Linux. The only mention of sysctl in cmd/dist is when running on OS X. At this point I think it would be fine to just stop calling sysctl and assume default GOHOSTARCH=amd64 on OS X. |
This is Gentoo Prefix, where we run a Gentoo Portage (the package manager of Gentoo) on OSX, Solaris, AIX and more to provide tools in some place like $HOME/gentoo (not to mess with the OS in /usr/bin or something). |
CL https://golang.org/cl/18313 mentions this issue. |
On Darwin, it appears that the method of determining whether default GOHOSTARCH setting should be amd64 relies on sysctl. There are use cases where sysctl is not in the users' path. In situations like this, the OSx build of go will break.
For an example, see https://bugs.gentoo.org/show_bug.cgi?id=558368.
The suggested patch for that bug is to hard code the path to /usr/sbin/sysctl in the command.
Before I do that, I'm wondering if you are interested in doing so upstream, or if there is a better way to do this autodetection on OSx?
Thanks much,
William
The text was updated successfully, but these errors were encountered: