vscode-go icon indicating copy to clipboard operation
vscode-go copied to clipboard

Cannot install go version due to missing binpath

Open AndreasBergmeier6176 opened this issue 1 year ago • 8 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

AndreasBergmeier6176 avatar May 13 '24 14:05 AndreasBergmeier6176

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: ....

hyangah avatar May 16 '24 20:05 hyangah

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

gopherbot avatar May 16 '24 20:05 gopherbot

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

adonovan avatar May 17 '24 21:05 adonovan

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/[email protected]/internal/version/version.go:537:38: undefined: signalsToIgnore

AndreasBergmeier6176 avatar May 23 '24 06:05 AndreasBergmeier6176

@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.

hyangah avatar May 23 '24 16:05 hyangah

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

AndreasBergmeier6176 avatar May 24 '24 05:05 AndreasBergmeier6176

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)

hyangah avatar May 24 '24 15:05 hyangah

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?

AndreasBergmeier6176 avatar May 27 '24 05:05 AndreasBergmeier6176