Navigation Menu

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

cmd/dist: The OSX build breaks if /usr/sbin is not in the path #13425

Closed
williamh opened this issue Nov 29, 2015 · 7 comments
Closed

cmd/dist: The OSX build breaks if /usr/sbin is not in the path #13425

williamh opened this issue Nov 29, 2015 · 7 comments

Comments

@williamh
Copy link

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

@davecheney
Copy link
Contributor

Is it common to not have /usr/sbin in the path ? Can you give some more background on how your discovered this issue.

@mikioh mikioh changed the title The OSX build breaks if /usr/sbin is not in the path cmd/dist: The OSX build breaks if /usr/sbin is not in the path Nov 30, 2015
@minux
Copy link
Member

minux commented Nov 30, 2015

It might be fine for Gentoo/Alt to carry that patch,
I don't think we should handcode the path to sysctl
in cmd/dist. For one, there is no guarantee that
future OS X won't move sysctl to /sbin or even
/usr/bin.

Actually, I think a better solution for Gentoo/Alt
is to just define GOHOSTARCH before running
make.bash. Portage knows very well what arch
the host is on, so auto-detection in cmd/dist is
unnecessary.
(That is, I think we can make cmd/dist skip the
sysctl run if $GOHOSTARCH is defined.)

@grobian
Copy link

grobian commented Nov 30, 2015

That would be awesome, that way we could also build a different arch than sysctl would report.

@williamh
Copy link
Author

williamh commented Dec 2, 2015

@minux:
I agree with this suggestion; it would be good to skip the autodetection completely if $GOHOSTARCH is defined, and this would be a very simple fix to the ebuilds on Gentoo as well.
Does anyone have any updates on when this can be done?

Thanks much for your time. :-)

@rsc
Copy link
Contributor

rsc commented Dec 28, 2015

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.

@rsc rsc added this to the Go1.6Maybe milestone Dec 28, 2015
@grobian
Copy link

grobian commented Dec 28, 2015

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).

@gopherbot
Copy link

CL https://golang.org/cl/18313 mentions this issue.

@rsc rsc closed this as completed in 6866f5e Jan 6, 2016
@golang golang locked and limited conversation to collaborators Jan 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants