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

cannot install delve - could not import internal/goarch #59295

Closed
FoxAndFoxElectrics opened this issue Mar 28, 2023 · 3 comments
Closed

cannot install delve - could not import internal/goarch #59295

FoxAndFoxElectrics opened this issue Mar 28, 2023 · 3 comments

Comments

@FoxAndFoxElectrics
Copy link

FoxAndFoxElectrics commented Mar 28, 2023

I raised this on the delve help forum
go-delve/delve#3317
and they redirected me here

Hi all, probably doing something stupid, but this is what I tried:

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

go version
go version go1.20.2 windows/amd64

Does this issue reproduce with the latest release?

Yes

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

New build i9 13900K Windows 10: 10.0.19045
32GB RAM, tons of hard drive space.
This is a new PC and hasn't had GO installed on it before.

go env Output
go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\conta\AppData\Local\go-build
set GOENV=C:\Users\conta\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\conta\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\conta\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.20.2
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
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 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\conta\AppData\Local\Temp\go-build2941949347=/tmp/go-build -gno-record-gcc-switches

What did you do?

Ran the installer go1.20.2.windows-amd64
Checked version:

go version
go version go1.20.2 windows/amd64

Tried to install delve

go clean -modcache
go install github.com/go-delve/delve/cmd/dlv@latest

What did you expect to see?

Delve install OK

What did you see instead?

could not import internal/goarch (EOF) and various others...

go: downloading github.com/go-delve/delve v1.20.1
go: downloading github.com/sirupsen/logrus v1.6.0
go: downloading github.com/spf13/cobra v1.1.3
go: downloading github.com/google/go-dap v0.6.0
go: downloading github.com/mattn/go-isatty v0.0.3
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/cosiner/argv v0.1.0
go: downloading github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d
go: downloading github.com/mattn/go-colorable v0.0.9
go: downloading github.com/derekparker/trie v0.0.0-20200317170641-1fdf38b7b0e9
go: downloading golang.org/x/sys v0.0.0-20220908164124-27713097b956
go: downloading golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4
go: downloading github.com/hashicorp/golang-lru v0.5.4
go: downloading go.starlark.net v0.0.0-20220816155156-cfacd8902214
go: downloading github.com/cilium/ebpf v0.7.0
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
go: downloading github.com/inconshreveable/mousetrap v1.0.0
go: downloading github.com/mattn/go-runewidth v0.0.13
go: downloading github.com/konsorten/go-windows-terminal-sequences v1.0.3
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: downloading github.com/rivo/uniseg v0.2.0
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
# runtime/internal/math
C:\Program Files\Go\src\runtime\internal\math\math.go:7:8: could not import internal/goarch (EOF)
# runtime/internal/sys
C:\Program Files\Go\src\runtime\internal\sys\consts.go:8:2: could not import internal/goarch (EOF)
C:\Program Files\Go\src\runtime\internal\sys\consts.go:9:2: could not import internal/goos (EOF)
# github.com/shurcooL/sanitized_anchor_name
go\pkg\mod\github.com\shurcoo!l\sanitized_anchor_name@v1.0.0\main.go:10:8: could not import unicode (EOF)
# github.com/rivo/uniseg
go\pkg\mod\github.com\rivo\uniseg@v0.2.0\grapheme.go:3:8: could not import unicode/utf8 (EOF)
# internal/abi
C:\Program Files\Go\src\internal\abi\abi.go:8:2: could not import internal/goarch (EOF)
# internal/bytealg
C:\Program Files\Go\src\internal\bytealg\bytealg.go:8:2: could not import internal/cpu (EOF)
# math
C:\Program Files\Go\src\math\exp_amd64.go:9:8: could not import internal/cpu (EOF)
C:\Program Files\Go\src\math\fma.go:7:8: could not import math/bits (EOF)
@FoxAndFoxElectrics FoxAndFoxElectrics changed the title affected/package: cannot install delve - latest, on clean PC Mar 28, 2023
@FoxAndFoxElectrics FoxAndFoxElectrics changed the title cannot install delve - latest, on clean PC cannot install delve - latest, on clean PC - could not import internal/goarch Mar 28, 2023
@FoxAndFoxElectrics FoxAndFoxElectrics changed the title cannot install delve - latest, on clean PC - could not import internal/goarch cannot install delve - could not import internal/goarch Mar 28, 2023
@seankhliao
Copy link
Member

looks like a corrupt installation of go

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2023
@omarcosr
Copy link

Same problem here, did you find a solution?

@FoxAndFoxElectrics
Copy link
Author

I'm so sorry I didn't make a note of the solution. I suspect it was a question of re-installing Golang, but a version that was (fully) supported by VSCode. Currently I am using 1.18.5 so my suggestion would be to try that. It's a pain as VSCode tries to update to latest. Though of course it may be something else that has been fixed/broken in the intervening 10 months. Good luck!

@golang golang locked and limited conversation to collaborators Jan 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants