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

Do not set GOROOT #150

Open
myitcv opened this issue Jun 4, 2018 · 1 comment
Open

Do not set GOROOT #150

myitcv opened this issue Jun 4, 2018 · 1 comment

Comments

@myitcv
Copy link

myitcv commented Jun 4, 2018

I can't find the issue/CL to confirm exactly when this happened, but gimme should not need to set GOROOT; the Go tools can work it out for themselves.

Indeed, setting it potentially, as it did in my case, messes with custom Go builds (noting our discussion in #143).

Take the following example:

https://travis-ci.org/myitcv/vgoimporter/builds/387668416

The sequence is:

  • Config uses 1.x to choose latest version of 1 series (noting discussion in 1.x doesn't select latest 1 major series version #149)
  • env | grep GOROOT confirms that an explicit value is set: GOROOT=/home/travis/.gimme/versions/go1.10.1.linux.amd64
  • go env confirms GOROOT="/home/travis/.gimme/versions/go1.10.1.linux.amd64"
  • unset GOROOT
  • go env still confirms GOROOT="/home/travis/.gimme/versions/go1.10.1.linux.amd64"
  • Install Go tip into $HOME/gotip
  • go version confirms go version devel +06b326054d Sat Jun 2 18:00:44 2018 +0000 linux/amd64
  • go env confirms GOROOT="/home/travis/gotip"

If I don't unset GOROOT above, GOROOT is then the wrong value for my custom Go installation.

Clearly the workaround is simple, but given then now-accepted behaviour of the go tool is that it can work out GOROOT for itself, setting GOROOT doesn't feel like the right thing to be doing (not least because it requires working around).

Thanks

@myitcv
Copy link
Author

myitcv commented Jun 4, 2018

@mvdan helped to track down the fact that this change happened in Go 1.9:

https://golang.org/doc/go1.9#goroot

But also notes therefore that for versions before 1.9 (not that they are supported any longer) should explicitly set GOROOT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant