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/cmd/gomobile: gomobile int fails with status 2 #11672

Closed
ghost opened this issue Jul 11, 2015 · 7 comments
Closed

x/mobile/cmd/gomobile: gomobile int fails with status 2 #11672

ghost opened this issue Jul 11, 2015 · 7 comments

Comments

@ghost
Copy link

ghost commented Jul 11, 2015

Its not finding the go root dir, even though its set in the environment variables.

i am using the latest go mobile repo.

gedw99-MacBook-Pro:gomobile apple$ gomobile init
gomobile: go install std for android/arm failed: exit status 2
go: cannot find GOROOT directory: /usr/local/go

go version go1.5beta1 darwin/amd64

gedw99-MacBook-Pro:gomobile apple$ go env
GOARCH="amd64"
GOBIN="/Users/apple/Workspace/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/apple/Workspace"
GORACE=""
GOROOT="/Users/apple/go"
GOTOOLDIR="/Users/apple/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT=""
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"

@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Jul 11, 2015
@ianlancetaylor ianlancetaylor changed the title gomobile int fails with status 2 x/mobile/cmd/gomobile: gomobile int fails with status 2 Jul 11, 2015
@ianlancetaylor
Copy link
Contributor

CC @crawshaw

@crawshaw
Copy link
Member

The gomobile tool is, for historical reasons, ignoring any custom GOROOT setting. Explicitly setting the GOROOT variable is strongly discouraged, so I haven't seen this before. At this point it is safe to pass it through, so I'll send a CL to do that.

However, I am a little bit surprised by the behavior of the Go 1.5 beta. Downloading the darwin/amd64 version and putting it anywhere other than /usr/local/go does not go well:

$ export PATH=$PATH:$HOME/go1.5beta/bin
$ go env
go: cannot find GOROOT directory: /usr/local/go

It's not clear to me if this should work.

@ghost
Copy link
Author

ghost commented Jul 11, 2015

i have 1.4 and 1.5, depending on what i am hacking on.
I just modify my bash profile, and point to the go folder i need.

so thats why i do it this way.

to me, its weird that gomobile does not respect the env variables. i mean thats the point of them and the whole go conventions all working together

@ghost
Copy link
Author

ghost commented Jul 11, 2015

bash profile for my user...... might help

GoLang 1.4.2 Paths setup

#export GOROOT=/usr/local/go1.4
#export PATH=$PATH:$GOROOT/bin
#export GOPATH=$HOME/Workspace
#export GOROOT_BOOTSTRAP=$GOROOT

GoLang 1.5 Paths setup

export GOROOT_BOOTSTRAP=$HOME/go1.4

export GOROOT=$HOME/go
export GOPATH=$HOME/Workspace
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOROOT/bin:$GOBIN

@crawshaw
Copy link
Member

There were once good reasons for ignoring the user's setting of GOROOT, but those no longer apply. I'll send a CL soon.

@ghost
Copy link
Author

ghost commented Jul 11, 2015

thanks

@crawshaw crawshaw self-assigned this Jul 11, 2015
@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Jul 13, 2016
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
Now that we no longer modify the user's $GOROOT and run make.bash,
the need for isolating the environment is gone. Pass through
whatever users want, overriding only those necesssary for corss
compilation.

While here, remove some dead code.

Fixes golang/go#11672.

Change-Id: Iaf867913eaa1311519a4d5a7a8169228ebf21346
Reviewed-on: https://go-review.googlesource.com/12128
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
Now that we no longer modify the user's $GOROOT and run make.bash,
the need for isolating the environment is gone. Pass through
whatever users want, overriding only those necesssary for corss
compilation.

While here, remove some dead code.

Fixes golang/go#11672.

Change-Id: Iaf867913eaa1311519a4d5a7a8169228ebf21346
Reviewed-on: https://go-review.googlesource.com/12128
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
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

3 participants