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
Labels
FrozenDueToAge OS-Darwin WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@tjamaranhao
Copy link

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

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 x/build issues (builders, bots, dashboards) label Nov 28, 2019
@agnivade agnivade added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed Builders x/build issues (builders, bots, dashboards) labels Nov 28, 2019
@tjamaranhao
Copy link
Author

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
Contributor

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

@dmitshur dmitshur added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Dec 17, 2019
@tjamaranhao
Copy link
Author

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
Contributor

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.

@golang golang locked and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge OS-Darwin WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants