asdf-community / asdf-golang

Go plugin for the asdf version manager
https://github.com/asdf-vm/asdf
MIT License
545 stars 92 forks source link

go installed binaries not working for go v1.20 #104

Closed Starefossen closed 1 year ago

Starefossen commented 1 year ago

Describe the bug

I am unable to get any of my go install binaries ($HOME/go/bin) to work with asdf-golang starting from version v1.20. I am probably doing something wrong, but it have worked perfectly with version prior to v1.20 and I am unable to figure this one out myself...

To Reproduce Steps to reproduce the behavior:

$ asdf plugin update --all
$ asdf install golang 1.20.4
$ asdf global golang 1.20.4

$ go get golang.org/x/tools/gopls@latest
$ stat $HOME/go/bin/gopls
16777230 57318951 -rwxr-xr-x 1 $USER staff 0 25765874 "May 14 11:05:15 2023" "May 14 10:58:20 2023" "May 14 10:58:20 2023" "May 14 10:58:19 2023" 4096 52288 0 $HOME/go/bin/gopls

$ asdf reshim
$ gopls version
No preset version installed for command gopls
Please install a version by running one of the following:

$ asdf install golang 1.20.4
$ asdf global golang 1.19.3
$ asdf reshim

$ gopls version
gopls version
golang.org/x/tools/gopls v0.11.0
    golang.org/x/tools/gopls@v0.11.0 h1:/nvKHdTtePQmrv9XN3gIUN9MOdUrKzO/dcqgbG6x8EY=

Expected behavior

go install binaries should work with go v1.20 and reshim.

Additional context

GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="$HOME/Library/Caches/go-build"
GOENV="$HOME/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="$HOME/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="$HOME/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="$HOME/.asdf/installs/golang/1.20.4/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="$HOME/.asdf/installs/golang/1.20.4/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20.4"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rn/qhsvm_qj7dq5brrmnflj5m5c0000gn/T/go-build773786195=/tmp/go-build -gno-record-gcc-switches -fno-common"
Starefossen commented 1 year ago

Apparently rm -rf $HOME/.asdf/shims/* and asdf reshim solved the problem 🤷🏻