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

cmd/go: go get removes installed binary if current working directory is $GOPATH/bin #32766

Closed
fhs opened this issue Jun 25, 2019 · 2 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@fhs
Copy link
Contributor

fhs commented Jun 25, 2019

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

$ go version
go version devel +df901bce5e Tue Jun 25 01:48:46 2019 +0000 linux/amd64

Does this issue reproduce with the latest release?

No (tested using go1.12.6)

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/fhs/.cache/go-build"
GOENV="/home/fhs/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/fhs/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/big/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/big/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build151242700=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ echo $GOBIN

$ echo $GOPATH
/home/fhs/go
$ cd $GOPATH/bin
$ ls -l $GOPATH/bin/stringer
-rwxr-xr-x 1 fhs fhs 6850911 Jun 25 03:25 /home/fhs/go/bin/stringer
$ go get golang.org/x/tools/cmd/stringer
go: finding golang.org/x/tools/cmd/stringer latest
go: finding golang.org/x/tools latest
$

What did you expect to see?

$ ls -l $GOPATH/bin/stringer
-rwxr-xr-x 1 fhs fhs 6850911 Jun 25 03:32 /home/fhs/go/bin/stringer

What did you see instead?

$ ls -l $GOPATH/bin/stringer
ls: cannot access '/home/fhs/go/bin/stringer': No such file or directory
@FiloSottile FiloSottile added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Jun 25, 2019
@FiloSottile FiloSottile added this to the Go1.13 milestone Jun 25, 2019
@FiloSottile
Copy link
Contributor

/cc @bcmills @jayconrod

@jayconrod jayconrod self-assigned this Jun 25, 2019
@jayconrod jayconrod added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 25, 2019
@gopherbot
Copy link

Change https://golang.org/cl/183846 mentions this issue: cmd/go: 'go get' should not delete binaries when run from $GOBIN

@golang golang locked and limited conversation to collaborators Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants