golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.95k stars 17.53k forks source link

x/tools/gopls: install gopls failed because of redeclared block in src/runtime go1.23.1 #69542

Closed FameOverflow closed 1 hour ago

FameOverflow commented 1 hour ago

gopls version

gopls: The term 'gopls' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

go env

set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Ray\AppData\Local\go-build
set GOENV=C:\Users\Ray\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Dev\GoPath\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Dev\GoPath
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=C:\Dev\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Dev\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.23.1
set GODEBUG=
set GOTELEMETRY=local
set GOTELEMETRYDIR=C:\Users\Ray\AppData\Roaming\go\telemetry
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\Ray\AppData\Local\Temp\go-build933662656=/tmp/go-build -gno-record-gcc-switches

What did you do?

go install -v golang.org/x/tools/gopls@latest

What did you see happen?

gopls: failed to install gopls(golang.org/x/tools/gopls@latest): Error: Command failed: C:\Dev\Go\bin\go.exe install -v golang.org/x/tools/gopls@latest runtime

runtime

C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:53:2: mallocHeaderSize redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:71:2: other declaration of mallocHeaderSize C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:54:2: minSizeForMallocHeader redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:101:2: other declaration of minSizeForMallocHeader C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:60:6: heapBitsInSpan redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:112:6: other declaration of heapBitsInSpan C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:243:6: bulkBarrierPreWrite redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:418:6: other declaration of bulkBarrierPreWrite C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:316:6: bulkBarrierPreWriteSrcOnly redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:504:6: other declaration of bulkBarrierPreWriteSrcOnly C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:695:6: heapSetType redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:705:6: other declaration of heapSetType C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:704:6: getgcmask redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:1750:6: other declaration of getgcmask C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:798:6: userArenaHeapBitsSetType redeclared in this block C:\Dev\Go\src\runtime\arena.go:553:6: other declaration of userArenaHeapBitsSetType C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:891:6: typePointers redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:122:6: other declaration of typePointers C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:936:6: heapBitsSlice redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:587:6: other declaration of heapBitsSlice C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:936:6: too many errors

What did you expect to see?

go install complete

Editor and settings

No response

Logs

2024-09-20 08:38:17.371 [info] gopls: failed to install gopls(golang.org/x/tools/gopls@latest): Error: Command failed: C:\Dev\Go\bin\go.exe install -v golang.org/x/tools/gopls@latest runtime

runtime

C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:53:2: mallocHeaderSize redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:71:2: other declaration of mallocHeaderSize C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:54:2: minSizeForMallocHeader redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:101:2: other declaration of minSizeForMallocHeader C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:60:6: heapBitsInSpan redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:112:6: other declaration of heapBitsInSpan C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:243:6: bulkBarrierPreWrite redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:418:6: other declaration of bulkBarrierPreWrite C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:316:6: bulkBarrierPreWriteSrcOnly redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:504:6: other declaration of bulkBarrierPreWriteSrcOnly C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:695:6: heapSetType redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:705:6: other declaration of heapSetType C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:704:6: getgcmask redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:1750:6: other declaration of getgcmask C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:798:6: userArenaHeapBitsSetType redeclared in this block C:\Dev\Go\src\runtime\arena.go:553:6: other declaration of userArenaHeapBitsSetType C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:891:6: typePointers redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:122:6: other declaration of typePointers C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:936:6: heapBitsSlice redeclared in this block C:\Dev\Go\src\runtime\mbitmap.go:587:6: other declaration of heapBitsSlice C:\Dev\Go\src\runtime\mbitmap_noallocheaders.go:936:6: too many errors

gabyhelp commented 1 hour ago

Related Issues and Documentation

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

FameOverflow commented 1 hour ago

Reuninstall through msi doesn't work.It need to remove files yourself. I solved it by remove go/src and run go installation repair.