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/build: different old install path does not remove the distribution for mac installer #35883

Closed
tjamaranhao opened this issue Nov 27, 2019 · 5 comments

Comments

@tjamaranhao
Copy link

@tjamaranhao tjamaranhao commented Nov 27, 2019

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

$ go version
go version go1.11.5 darwin/amd64
$ /usr/local/go/bin/go version
go version go1.13.4 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/tjamaranhao/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/tjamaranhao/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.5/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.5/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

/usr/local/go/bin/go env Output
$ /usr/local/go/bin/go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/tjamaranhao/Library/Caches/go-build"
GOENV="/Users/tjamaranhao/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/tjamaranhao/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

I downloaded go 1.11.5 months ago and had it installed on my machine.

Then now, I'm taking a Go training and decided to upgrade my go to the most recent version 1.13.4.

Downloaded the installation file for Mac
Executed the package
It popped up a msg saying it identified a previous version and was going o uninstall it
Moved on and finished the installation.

Then when I ran go version, it returned it was still on version 1.11.5.
Then I ran where go command and it returned:
$ where go
/usr/local/bin/go
/usr/local/go/bin/go

That's when I realized it change the installation path. Now I have both versions on my computer

What did you expect to see?

I expected the installer to uninstall 1.11.5 and leave only 1.13.4

What did you see instead?

The main installation remain pointing to 1.11.5, so I'll need to manually uninstall it now.

@agnivade
Copy link
Contributor

@agnivade agnivade commented Nov 28, 2019

It doesn't look like your previous installation was done by the standard installer. So I guess it detected a go binary in the PATH but it failed to remove it because it was installed in a different location. I would recommend to always use the same installer.

/cc @dmitshur in case the removal message can be improved.

@agnivade agnivade changed the title Different installation path on 1.13.4. Did not uninstall previous version 1.11.5 x/build: different old install path does not remove the distribution for mac installer Nov 28, 2019
@gopherbot gopherbot added this to the Unreleased milestone Nov 28, 2019
@gopherbot gopherbot added the Builders label Nov 28, 2019
@tjamaranhao
Copy link
Author

@tjamaranhao tjamaranhao commented Dec 17, 2019

It doesn't look like your previous installation was done by the standard installer. So I guess it detected a go binary in the PATH but it failed to remove it because it was installed in a different location. I would recommend to always use the same installer.

/cc @dmitshur in case the removal message can be improved.

Downloaded both versions from golang.org.

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Dec 17, 2019

Can you run go env GOROOT and /usr/local/go/bin/go env GOROOT and paste their output?

From the go env output in the original issue:

GOROOT="/usr/local/Cellar/go/1.11.5/libexec"

It looks like Go 1.11.5 was installed via Homebrew, while Go 1.13.4 was installed with the macOS installer from golang.org/dl. The installer does remove previous versions of Go installed via the same means, but it can't take such action for versions of Go installed via other means (such as from Homebrew).

@tjamaranhao
Copy link
Author

@tjamaranhao tjamaranhao commented Dec 17, 2019

Thx for the prompt response. But in fact I ended up removing 1.11 from my computer.... sorry about that.. I could swear both came from golang installer.... but honestly I don't remember if I installed it from homebrew or from golang since that was months ago....

But if the issue is not reproduceable using both installers, then you may close this issue... in the end... that was a dated version

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Dec 17, 2019

No problem and thanks for reporting this.

I believe the macOS installer correctly removes previous versions of Go that were installed using the same installer, so there's no issue there.

I don't think it's in scope for the macOS installer to be aware of other types of installers. If we continue to see problems related to that, we can reconsider this based on that data.

I'll close this since we can't reproduce this particular instance, and I'm not seeing actionable steps to take for now.

@dmitshur dmitshur closed this Dec 17, 2019
@dmitshur dmitshur added the OS-Darwin label Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.