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

x/mobile: gomobile shouldn't suggest sudoing #9854

Closed
rakyll opened this issue Feb 12, 2015 · 14 comments

Comments

Projects
None yet
9 participants
@rakyll
Copy link
Member

commented Feb 12, 2015

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.

@rakyll rakyll added the repo-mobile label Feb 12, 2015

@crawshaw

This comment has been minimized.

Copy link
Contributor

commented Feb 12, 2015

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.

@hyangah

This comment has been minimized.

Copy link
Contributor

commented Feb 12, 2015

-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?

@rakyll

This comment has been minimized.

Copy link
Member Author

commented Feb 12, 2015

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.

@crawshaw

This comment has been minimized.

Copy link
Contributor

commented Feb 12, 2015

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.

@adg

This comment has been minimized.

Copy link
Contributor

commented Feb 12, 2015

We should probably check that bootstrapping works with the go packages
provided by popular distros before going down this road.
The distros like to strip stuff out and break things. :-(

On 13 February 2015 at 08:16, David Crawshaw notifications@github.com
wrote:

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.


Reply to this email directly or view it on GitHub
#9854 (comment).

@hyangah

This comment has been minimized.

Copy link
Contributor

commented Feb 13, 2015

what popular distros should we check?

btw I checked the instruction ins https://wiki.ubuntu.com/Go
and it gave me go1.2.1.

2015-02-12 18:44 GMT-05:00 Andrew Gerrand notifications@github.com:

We should probably check that bootstrapping works with the go packages
provided by popular distros before going down this road.
The distros like to strip stuff out and break things. :-(

On 13 February 2015 at 08:16, David Crawshaw notifications@github.com
wrote:

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.


Reply to this email directly or view it on GitHub
#9854 (comment).


Reply to this email directly or view it on GitHub
#9854 (comment).

__

@rakyll

This comment has been minimized.

Copy link
Member Author

commented Feb 13, 2015

We should probably check that bootstrapping works with the go packages

Or we should motivate them to fix their distributions.

@nightlyone

This comment has been minimized.

Copy link
Contributor

commented Feb 13, 2015

I think it would be great to avoid having add-on repositories write to GOROOT on Linux. Just vet needs to be there for historic reasons, others could have been in the GOPATH instead.
Godoc could be in GOPATH, too.

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

@adg

This comment has been minimized.

Copy link
Contributor

commented Feb 16, 2015

@rakyll

This comment has been minimized.

Copy link
Member Author

commented Feb 19, 2015

@nightlyone,

We write to the GOROOT to bootstrap and make go tools targeting arm7 Android. Additional stuff (Android NDK tooling) is being written to GOPATH.

@crawshaw

This comment has been minimized.

Copy link
Contributor

commented Feb 19, 2015

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.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc changed the title mobile: gomobile shouldn't suggest sudoing x/mobile: gomobile shouldn't suggest sudoing Apr 14, 2015

@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015

@rsc rsc removed the repo-mobile label Apr 14, 2015

@EtienneBruines

This comment has been minimized.

Copy link

commented Jun 9, 2015

Using version devel +aff7a57 Tue Jun 9 08:21:21 2015 it does indeed suggest a mv command, but that doesn't help:

  • the init process is stopped and does not resume;
    • it's not finished either - running gomobile install still says android toolchain partially installed
  • the same message/suggestion is given when the init is restarted manually - thus not advancing.
@tonyconstantinides

This comment has been minimized.

Copy link

commented Jul 10, 2015

I still getting gomobile: toolchain partially installed , run gomobile init
even after I have run gomobile. It thinks it needs to build for ios even though I only interested in Android while building on El Capitan on my Macbook pro. The Android setup occurred but it now thinks it needs to setup IOS as well for some reason.
This is happening on Go Beta 1.5 so looks like it was never fixed

@crawshaw

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2015

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.

@crawshaw crawshaw closed this Jul 10, 2015

@golang golang locked and limited conversation to collaborators Jul 11, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.