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

Clarify unsupported Go versions in README and error messages #3409

Closed
williandandrade opened this issue May 27, 2024 · 3 comments
Closed

Clarify unsupported Go versions in README and error messages #3409

williandandrade opened this issue May 27, 2024 · 3 comments
Milestone

Comments

@williandandrade
Copy link

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
    • go version go1.18 darwin/arm64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • N/A
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.89.1
    • dc96b837cf6bb4af9cd736aa3af08cf8279f7685
    • arm64
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.41.4
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
# Tools Configuration


## Environment

GOBIN: undefined
toolsGopath: 
gopath: /Users/wa/.asdf/installs/golang/1.18/packages
GOROOT: /Users/wa/.asdf/installs/golang/1.18/go
PATH: /Users/wa/.asdf/installs/golang/1.18/go/bin:/Users/wa/google-cloud-sdk/bin:/Users/wa/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/Users/wa/google-cloud-sdk/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/go/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/wa/Library/Application Support/JetBrains/Toolbox/scripts:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/opt/homebrew/sbin
PATH (vscode launched with): /Users/wa/google-cloud-sdk/bin:/Users/wa/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/Users/wa/google-cloud-sdk/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/go/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/wa/Library/Application Support/JetBrains/Toolbox/scripts:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/opt/homebrew/sbin

## Tools

	go:	/Users/wa/.asdf/installs/golang/1.18/go/bin/go: go version go1.18 darwin/arm64

	gopls:	not installed
	gotests:	/Users/wa/.asdf/installs/golang/1.18/go/bin/gotests	(version: v1.6.0 built with go: go1.18)
	gomodifytags:	/Users/wa/.asdf/installs/golang/1.18/go/bin/gomodifytags	(version: v1.16.0 built with go: go1.18)
	impl:	/Users/wa/.asdf/installs/golang/1.18/go/bin/impl	(version: v1.1.0 built with go: go1.18)
	goplay:	/Users/wa/.asdf/installs/golang/1.18/go/bin/goplay	(version: v1.0.0 built with go: go1.18)
	dlv:	/Users/wa/.asdf/installs/golang/1.18/go/bin/dlv	(version: v1.22.1 built with go: go1.18)
	staticcheck:	/Users/wa/.asdf/installs/golang/1.18/packages/bin/staticcheck	(version: v0.3.3 built with go: go1.18)

## Go env

Workspace Folder (go): /Users/wa/projects/go

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

Describe the bug

Can't use the extension with Go 1.18 because gopls@latest have a dependency to atomic.Int32.

2024-05-27 12:56:41.704 [info] Tools environment: GOPATH=/Users/wa/.asdf/installs/golang/1.18/go
2024-05-27 12:56:41.704 [info] Installing 1 tool at /Users/wa/.asdf/installs/golang/1.18/go/bin
2024-05-27 12:56:41.704 [info]   gopls
2024-05-27 12:56:41.704 [info] 
2024-05-27 12:56:42.418 [info] Installing golang.org/x/tools/gopls@latest FAILED
2024-05-27 12:56:42.418 [info] {
 "code": 2,
 "killed": false,
 "signal": null,
 "cmd": "/Users/wa/.asdf/installs/golang/1.18/go/bin/go install -v golang.org/x/tools/gopls@latest",
 "stdout": "",
 "stderr": "golang.org/x/tools/gopls/internal/cache\n# golang.org/x/tools/gopls/internal/cache\n../../.asdf/installs/golang/1.18/go/pkg/mod/golang.org/x/tools/gopls@v0.15.3/internal/cache/analysis.go:389:23: undefined: atomic.Int64\n../../.asdf/installs/golang/1.18/go/pkg/mod/golang.org/x/tools/gopls@v0.15.3/internal/cache/analysis.go:525:25: undefined: atomic.Int32\n../../.asdf/installs/golang/1.18/go/pkg/mod/golang.org/x/tools/gopls@v0.15.3/internal/cache/analysis.go:526:25: undefined: atomic.Int32\n"
}
2024-05-27 12:56:42.421 [info] 
2024-05-27 12:56:42.421 [info] 1 tools failed to install.

2024-05-27 12:56:42.421 [info] gopls: failed to install gopls(golang.org/x/tools/gopls@latest): Error: Command failed: /Users/wa/.asdf/installs/golang/1.18/go/bin/go install -v golang.org/x/tools/gopls@latest
golang.org/x/tools/gopls/internal/cache
# golang.org/x/tools/gopls/internal/cache
../../.asdf/installs/golang/1.18/go/pkg/mod/golang.org/x/tools/gopls@v0.15.3/internal/cache/analysis.go:389:23: undefined: atomic.Int64
../../.asdf/installs/golang/1.18/go/pkg/mod/golang.org/x/tools/gopls@v0.15.3/internal/cache/analysis.go:525:25: undefined: atomic.Int32
../../.asdf/installs/golang/1.18/go/pkg/mod/golang.org/x/tools/gopls@v0.15.3/internal/cache/analysis.go:526:25: undefined: atomic.Int32

Steps to reproduce the behavior:

  1. Install go@1.18 from scratch
  2. Install the extension in VSCode
  3. Try to install the tools by opening some go file or go.mod
@gopherbot gopherbot added this to the Untriaged milestone May 27, 2024
@williandandrade
Copy link
Author

related to: #3412

@hyangah
Copy link
Contributor

hyangah commented May 28, 2024

Use go.toolsManagement.go setting to tell the extension to use a newer version of go when building tools. https://github.com/golang/vscode-go/wiki/settings#gotoolsmanagementgo
Or, manually install the right version of gopls and tools suitable for go 1.18.

Will update README that users need go1.19+ if they want the extension to handle tools installation.

@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/588757 mentions this issue: extension/src: require go1.19+ for tools installation

@hyangah hyangah modified the milestones: Untriaged, v0.42.0 May 28, 2024
@hyangah hyangah changed the title Error installing golang tools using go@1.18 Clarify unsupported Go versions in README and error messages May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants