Closed hyangah closed 8 months ago
I think most tools VS Code Go depends on don't need CGO.
(@derekparker @aarzilli Is it ok to use dlv compiled with CGO_ENABLED=0
?)
From my mac,
$ go list -f '{{if .CgoFiles}}{{.ImportPath}}{{end}}' -deps ./cmd/dlv
runtime/cgo
net
I think disabling CGO will be ok.
It should be fine everywhere except freebsd.
Change https://go.dev/cl/549245 mentions this issue: src/goEnv: disable Cgo when building tools
According to @findleyr, gopls's CGO dependency was real (fastwalk). The dependency is removed from the dev branch so once gopls v0.15 is released next year, this problem will go away. Delve and other tools don't have CGO dependency, so the go command won't rely on the CGO and we don't need to worry about it.
I will abandon the cl.
Cgo is unnecessary to build gopls (and probably some of other tools). Disable cgo (
CGO_ENABLED=0
), to avoid crashes (https://github.com/golang/vscode-go/issues/3085, https://github.com/golang/vscode-go/issues/3039, https://github.com/golang/go/issues/63997) caused by misconfigured C toolchain.