golang / vscode-go

Go extension for Visual Studio Code

Home Page:https://marketplace.visualstudio.com/items?itemName=golang.Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot install go version due to missing binpath

AndreasBergmeier6176 opened this issue · comments

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

Version Information
* Run `code -v` or `code-insiders -v` to get version of VS Code or VS Code Insiders.
1.89.0
b58957e67ee1e712cebf466b995adf4c5307b2bd
x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.41.4

Describe the bug

When I select the version to install (1.21.10), I get:

Could not install ${goOption.binpath}

Sadly from the error message I cannot debug what is wrong or how to fix it

Thanks for the report. There was a bug in error printing that we need to fix.
About the root cause - can you open the "Go" output channel and see what's printed there?

Screenshot 2024-05-16 at 4 42 51 PM

There should be a log message that looks like Error installing golang.org/dl/go1.x.x: ....

Change https://go.dev/cl/586255 mentions this issue: extension/src/goEnvironmentStatus: fix error string

There is insufficient information here to identify the problem. Could you describe more fully the sequence of steps you tried, and exactly what happened?

Thanks for the report. There was a bug in error printing that we need to fix. About the root cause - can you open the "Go" output channel and see what's printed there?

Screenshot 2024-05-16 at 4 42 51 PM

There should be a log message that looks like Error installing golang.org/dl/go1.x.x: ....

It says:

2024-05-23 08:28:53.258 [error] Error installing golang.org/dl/go1.22.3: failed to install go1.22.3(golang.org/dl/go1.22.3@latest): Error: Command failed: /usr/bin/go install -v golang.org/dl/go1.22.3@latest
golang.org/dl/internal/version
# golang.org/dl/internal/version
../../../../go/pkg/mod/golang.org/dl@v0.0.0-20240507154152-429173cd35bf/internal/version/version.go:537:38: undefined: signalsToIgnore

@AndreasBergmeier6176 Thanks! Have you tried
go install golang.org/dl/go1.22.3@latest from your terminal?

Do you mind what operating system you are using? The signalsToIgnore is defined in
https://github.com/golang/dl/blob/master/internal/version/signal_unix.go and signal_notunix.go.
From the build tag, I see this handles only unix, js, wasip1, plan9, windows.

Have you tried
go install golang.org/dl/go1.22.3@latest from your terminal?

Gives the same error message

Do you mind what operating system you are using?

Ubuntu 22.04.4
go version go1.18.1 linux/amd64

Thanks.
Looks like recently golang.org/dl/go* changed to require supported go versions for installation.
Unfortunately ubuntu 22.04.4 LTS is still using go1.18, which is already out of the range supported by the Go project https://go.dev/doc/devel/release#policy.

Some options:

  • If you don't want to change the system default go, download a newer go version and configure the "go.toolsManagement.go": "<path_to_the_newer_go_binary>" setting.
  • Install a new version of go in your system and use it as the system default go version (https://go.dev/wiki/Ubuntu or https://go.dev/doc/install#install), or
  • Upgrade to Ubuntu 24.04... (which has go 1.22. After go1.22, the go toolchain auto updates so this type of issues shouldn't happen)

In this case maybe the sensible way would be for this extension to download 1.22 and execute e.g. go install golang.org/dl/go1.22.3@latest using that downloaded version?