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 #3412

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

Clarify unsupported Go versions in README and error messages #3412

williandandrade opened this issue May 27, 2024 · 5 comments
Assignees
Labels
gopls gopls related issues
Milestone

Comments

@williandandrade
Copy link

gopls version

n/a

go env

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/packages/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-build654916903=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Due to an onboarding on a project I fresh installed go@1.18 in my environment using asdf and tried to setup the VSCode's extension to start coding.

What did you see happen?

Error when installing gopls@latest.

What did you expect to see?

All the tools installed properly.

Editor and settings

No response

Logs

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
 
@williandandrade williandandrade added the gopls gopls related issues label May 27, 2024
@williandandrade williandandrade changed the title x/tools/gopls: installing tools in VSCode and Go 1.18 x/tools/gopls: failed to install gopls@latest with VSCode extension and Go 1.18 May 27, 2024
@fzipp
Copy link

fzipp commented May 27, 2024

The Go project only supports the last two major releases, currently 1.22 and 1.21: https://go.dev/doc/devel/release#policy

gopls@latest requires at least Go 1.19: https://cs.opensource.google/go/x/tools/+/master:gopls/go.mod;l=3
The atomic.Int{32|64} types were added in Go 1.19: https://pkg.go.dev/sync/atomic#Int64

@findleyr
Copy link
Contributor

Yes, please reinstall with a supported version of Go. Soon, gopls will require at least Go 1.21 (+forward compatibility) to build: golang/go#65917.

I believe the extension should not have tried to install gopls@latest, since it should be knowledgeable of the last supported version. CC @hyangah in case there is a VS Code bug here.

@hyangah
Copy link
Contributor

hyangah commented May 28, 2024

According to https://github.com/golang/tools/tree/master/gopls#supported-go-versions
gopls@v0.14.2 is the last version that can be built with go1.18.

VS Code still claims to support tools installation with go1.18, but that's incorrect.
Please manually install gopls. I will update the README page and the error message.

go install golang.org/x/tools/gopls@v0.14.2

@findleyr
Copy link
Contributor

Thanks @hyangah. Transferring to the VS Code issue tracker.

@findleyr findleyr transferred this issue from golang/go May 28, 2024
@findleyr findleyr changed the title x/tools/gopls: failed to install gopls@latest with VSCode extension and Go 1.18 Clarify unsupported Go versions in README and error messages May 28, 2024
@findleyr findleyr added this to the v0.43.0 milestone May 28, 2024
@hyangah
Copy link
Contributor

hyangah commented May 28, 2024

Duplicate of #3409

@hyangah hyangah marked this as a duplicate of #3409 May 28, 2024
@hyangah hyangah closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls gopls related issues
Projects
None yet
Development

No branches or pull requests

4 participants