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/review/git-codereview: cannot install with go 1.6 #14816

Closed
nadiasvertex opened this issue Mar 14, 2016 · 4 comments
Closed

x/review/git-codereview: cannot install with go 1.6 #14816

nadiasvertex opened this issue Mar 14, 2016 · 4 comments

Comments

@nadiasvertex
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?

go 1.6

  1. What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/christopher/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

  1. What did you do?

Run:

go get -u golang.org/x/review/git-codereview

  1. What did you expect to see?

Nothing. That is, I expected the package to install without error.

  1. What did you see instead?
package golang.org/x/review/git-codereview
        imports bytes
        imports errors
        imports runtime
        imports runtime/internal/sys: cannot find package "runtime/internal/sys" in any of:
        /usr/local/go/src/runtime/internal/sys (from $GOROOT)
        /tmp/go/src/runtime/internal/sys (from $GOPATH)

Installing with go 1.5.3 works fine on the same machine.

@minux
Copy link
Member

minux commented Mar 14, 2016 via email

@ianlancetaylor
Copy link
Contributor

Can you build any Go program at all?

@nadiasvertex
Copy link
Contributor Author

This was indeed the problem. $GOPATH was set to $HOME/go, but $GOROOT was not set. There was also an old installation in /usr/local/go instead of in $HOME/go. Interestingly, $HOME/go/bin was in the path ahead of /usr/local/go/bin. I'm not sure why it was picking up the old installation.

I was having problems building some things, but not others. I should have checked the environment variables, but this setup worked perfectly fine in 1.5; also the nature of the error message lead me to believe that GOROOT was set.

Thanks!

@dzlab
Copy link

dzlab commented May 6, 2016

I've get into this same problem after upgrade to 1.6.2, I can't build any program:

package github.com/dzlab/collector
    imports flag
    imports errors
    imports runtime
    imports runtime/internal/sys: cannot find package "runtime/internal/sys" in any of:
    /usr/local/go/src/runtime/internal/sys (from $GOROOT)
    /Users/dzlab/Workspace/GO/src/runtime/internal/sys (from $GOPATH)

I'm exporting go env variables in the bash profile:

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

I had an old installation on /usr/local/go removing it fixed the problem for me!

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

5 participants