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

tool(gopls): fail to install gopls #62004

Closed
damingerdai opened this issue Aug 14, 2023 · 7 comments
Closed

tool(gopls): fail to install gopls #62004

damingerdai opened this issue Aug 14, 2023 · 7 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.

Comments

@damingerdai
Copy link

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

$ go version
go version go1.21.0 linux/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
GO111MODULE='on'
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/daming/.cache/go-build'
GOENV='/home/daming/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/daming/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/daming/go'
GOPRIVATE=''
GOPROXY='https://goproxy.cn,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.0'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
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 -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1451681933=/tmp/go-build -gno-record-gcc-switches'

What did you do?

i failed to install gopls:

 hello-world go install -v golang.org/x/tools/gopls@latest
runtime/internal/sys
# runtime/internal/sys
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:9:7: len8tab redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:76:7: other declaration of len8tab
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:32:6: Len64 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:99:6: other declaration of Len64
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:50:7: m0 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:117:7: other declaration of m0
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:51:7: m1 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:118:7: other declaration of m1
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:52:7: m2 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:119:7: other declaration of m2
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:55:6: OnesCount64 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:122:6: other declaration of OnesCount64
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:86:6: LeadingZeros64 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:153:6: other declaration of LeadingZeros64
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:89:6: LeadingZeros8 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:156:6: other declaration of LeadingZeros8
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:92:6: Len8 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:159:6: other declaration of Len8
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:101:6: Prefetch redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:200:6: other declaration of Prefetch
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:101:6: too many errors
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Aug 14, 2023
@seankhliao
Copy link
Member

looks more likely that you have a corrupt installation of go

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2023
@damingerdai
Copy link
Author

more info:

hello-world go clean --modcache
➜  hello-world go clean -cache
➜  hello-world go install -v golang.org/x/tools/gopls@latest
go: downloading golang.org/x/tools/gopls v0.13.1
go: downloading golang.org/x/tools v0.12.0
go: downloading honnef.co/go/tools v0.4.2
go: downloading github.com/sergi/go-diff v1.1.0
go: downloading golang.org/x/tools v0.11.2-0.20230801165449-23c7f589706c
go: downloading mvdan.cc/gofumpt v0.4.0
go: downloading mvdan.cc/xurls/v2 v2.4.0
go: downloading golang.org/x/mod v0.12.0
go: downloading golang.org/x/sync v0.3.0
go: downloading golang.org/x/text v0.11.0
go: downloading golang.org/x/sys v0.10.0
go: downloading golang.org/x/vuln v0.0.0-20230110180137-6ad3e3d07815
go: downloading github.com/google/go-cmp v0.5.9
go: downloading golang.org/x/exp/typeparams v0.0.0-20221212164502-fae10dda9338
go: downloading github.com/BurntSushi/toml v1.2.1
go: downloading golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
internal/unsafeheader
internal/coverage/rtcov
internal/goarch
internal/goos
internal/itoa
internal/godebugs
internal/race
internal/goexperiment
internal/cpu
runtime/internal/atomic
runtime/internal/syscall
sync/atomic
unicode/utf8
encoding
unicode
math/bits
runtime/internal/math
runtime/internal/sys
unicode/utf16
internal/abi
crypto/internal/alias
# runtime/internal/sys
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:9:7: len8tab redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:76:7: other declaration of len8tab
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:32:6: Len64 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:99:6: other declaration of Len64
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:50:7: m0 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:117:7: other declaration of m0
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:51:7: m1 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:118:7: other declaration of m1
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:52:7: m2 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:119:7: other declaration of m2
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:55:6: OnesCount64 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:122:6: other declaration of OnesCount64
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:86:6: LeadingZeros64 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:153:6: other declaration of LeadingZeros64
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:89:6: LeadingZeros8 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:156:6: other declaration of LeadingZeros8
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:92:6: Len8 redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:159:6: other declaration of Len8
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:101:6: Prefetch redeclared in this block
        /usr/local/go/src/runtime/internal/sys/intrinsics.go:200:6: other declaration of Prefetch
/usr/local/go/src/runtime/internal/sys/intrinsics_common.go:101:6: too many errors
crypto/subtle
crypto/internal/boring/sig
internal/goversion
internal/nettrace
log/internal
internal/platform
container/list
vendor/golang.org/x/crypto/cryptobyte/asn1
internal/bytealg
math
vendor/golang.org/x/crypto/internal/alias
golang.org/x/exp/constraints
github.com/google/go-cmp/cmp/internal/flags
golang.org/x/exp/slices

@damingerdai
Copy link
Author

looks more likely that you have a corrupt installation of go

by cleaning cache mode, i also meet this issue. so i need to reinstall go?

@damingerdai
Copy link
Author

it look like no corrupt installation of go

~ sha256sum go1.21.0.linux-amd64.tar.gz > sha256sum.txt
➜  ~ cat sha256sum.txt
d0398903a16ba2232b389fb31032ddf57cac34efda306a0eebac34f0965a0742  go1.21.0.linux-amd64.tar.gz

@damingerdai
Copy link
Author

it look like another issue by drop to go 1.20.7

~ go version
go version go1.20.7 linux/amd64
➜  ~ go clean -cache
➜  ~ go clean -cache
➜  ~ go clean --modcache
➜  ~ go install -v golang.org/x/tools/gopls@latest
go: downloading golang.org/x/tools v0.12.0
go: downloading golang.org/x/tools/gopls v0.13.1
go: downloading honnef.co/go/tools v0.4.2
go: downloading github.com/sergi/go-diff v1.1.0
go: downloading golang.org/x/tools v0.11.2-0.20230801165449-23c7f589706c
go: downloading mvdan.cc/gofumpt v0.4.0
go: downloading mvdan.cc/xurls/v2 v2.4.0
go: downloading golang.org/x/mod v0.12.0
go: downloading golang.org/x/sync v0.3.0
go: downloading golang.org/x/text v0.11.0
go: downloading github.com/google/go-cmp v0.5.9
go: downloading golang.org/x/exp/typeparams v0.0.0-20221212164502-fae10dda9338
go: downloading golang.org/x/sys v0.10.0
go: downloading golang.org/x/vuln v0.0.0-20230110180137-6ad3e3d07815
go: downloading github.com/BurntSushi/toml v1.2.1
go: downloading golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
internal/goarch
internal/itoa
internal/coverage/rtcov
internal/goexperiment
internal/goos
internal/race
unicode
internal/unsafeheader
runtime/internal/atomic
internal/cpu
sync/atomic
internal/abi
runtime/internal/math
unicode/utf8
runtime/internal/syscall
encoding
runtime/internal/sys
math/bits
unicode/utf16
crypto/internal/alias
crypto/subtle
crypto/internal/boring/sig
# internal/abi
/usr/local/go/src/internal/abi/funcpc.go:22:6: FuncPCABI0 redeclared in this block
        /usr/local/go/src/internal/abi/abi.go:117:6: other declaration of FuncPCABI0
/usr/local/go/src/internal/abi/funcpc.go:31:6: FuncPCABIInternal redeclared in this block
        /usr/local/go/src/internal/abi/abi.go:126:6: other declaration of FuncPCABIInternal
internal/nettrace
internal/goversion
container/list
vendor/golang.org/x/crypto/internal/alias
vendor/golang.org/x/crypto/cryptobyte/asn1
golang.org/x/exp/constraints
github.com/google/go-cmp/cmp/internal/flags
internal/bytealg
math
golang.org/x/exp/slices

@damingerdai
Copy link
Author

i fixed it by remove /usr/local/go .

妈的,好歹分享一下解决思路吧,就说我下的golang的版本问题。。。。

@ChanaLii
Copy link

I encountered the same problem when compiling cri-dockerd, first I installed go-v1.21, then I wanted to roll back the version and install go-v1.20, but I started reinstalling without completely deleting the files of go-v1.21 , causing some go-v1.21 files to remain in the v1.20 directory.

error log:

../go/src/internal/abi/funcpc.go:22:6: FuncPCABI0 redeclared in this block ../go/src/internal/abi/abi.go:117:6: other declaration of FuncPCABI0 ../go/src/internal/abi/funcpc.go:31:6: FuncPCABIInternal redeclared in this block ../go/src/internal/abi/abi.go:126:6: other declaration of FuncPCABIInternal

My solution is:

rm -rf /usr/local/go
tar -C /usr/local -xzf go1.20.5.linux-amd64.tar.gz

# build somthing
go build -o bin/cri-dockerd

image

@golang golang locked and limited conversation to collaborators Aug 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Projects
None yet
Development

No branches or pull requests

4 participants