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
x/mobile: gomobile shouldn't suggest sudoing #9854
Comments
GOPATH/bin shouldn't matter for the init subcommand, but GOPATH is necessary. Perhaps we could recommend sudo -E? Though we should adjust the ownership of GOPATH/pkg/gomobile back to SUDO_USER when we are done. |
-E doesn't seem to preserve PATH env. sudo -E PATH=$PATH gomobile init But more generally, if users has no permission for sudo, should the tool suggest manage their own goroot? |
General rule is not to require sudo if sudo can be omitted. I don't see a reason we should run gomobile init as the root user. |
If you install go with apt-get, your GOROOT is only writable to root. I don't want users to install another copy of Go, as it will lead to confusion. |
We should probably check that bootstrapping works with the go packages On 13 February 2015 at 08:16, David Crawshaw notifications@github.com
|
what popular distros should we check? btw I checked the instruction ins https://wiki.ubuntu.com/Go 2015-02-12 18:44 GMT-05:00 Andrew Gerrand notifications@github.com:
__ |
Or we should motivate them to fix their distributions. |
I think it would be great to avoid having add-on repositories write to GOROOT on Linux. Just If there is an actual requirement to add more things to GOROOT/pkg/tool, then perhaps adding the convention of GOPATH/pkg/tool (for each GOPATH element of course) starts looking attractive... |
I would suggest Ubuntu, Debian, and possibly CentOS/Redhat as candidates.
The latter will probably be a real PITA.
|
We write to the GOROOT to bootstrap and make go tools targeting arm7 Android. Additional stuff (Android NDK tooling) is being written to GOPATH. |
I think we are in better shape now. The gomobile tool only suggests running an mv command as the super user if it is necessary. There is still the question of do distributions ship with functional GOROOTs or not, but the tool now requires Go 1.5, so it will not be relevant for a while. |
Using
|
I still getting gomobile: toolchain partially installed , run gomobile init |
The gomobile tool no longer suggests sudoing as of https://golang.org/cl/11711. The simplified logic pushed all decisions about how to handle an unwritable GOROOT onto the go tool. @tonyconstantinides I believe your issue is unrelated to this one. Please try using go get -u to make sure you have the latest gomobile tool, rm -rf on $GOPATH/pkg/gomobile, and then another gomobile init. If you see the same error message, please file a new issue along with the revision of the x/mobile repository you are using. |
If the GOROOT directory is not writable, a sudo won't help because the user's GOPATH/bin and Go tool won't be in the root's PATH. We may suggest changing ownership/permissions temporarily.
The text was updated successfully, but these errors were encountered: