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

Cannot find "go" binary installed by asdf-vm on WSL #1886

Closed
logica0419 opened this issue Nov 10, 2021 · 4 comments
Closed

Cannot find "go" binary installed by asdf-vm on WSL #1886

logica0419 opened this issue Nov 10, 2021 · 4 comments
Labels
FrozenDueToAge upstream-vscode Issues that are by problems in VS Code itself. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@logica0419
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.
    • go1.17.3 linux/amd64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • v0.7.3
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.62.1 f4af3cbf5a99787542e2a30fe1fd37cd644cc31f x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.29.0
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
    • unable to locate "go" binary in GOROOT () or PATH

Share the Go related settings you have added/edited

Run Preferences: Open Settings (JSON) command to open your settings.json file.
Share all the settings with the go. or ["go"] or gopls prefixes.

  • "go.lintTool": "golangci-lint",
  • "go.toolsManagement.autoUpdate": true,
  • "go.installDependenciesWhenBuilding": true,
  • "go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
  • "go.useCodeSnippetsOnFunctionSuggest": true,
  • "go.lintOnSave": "workspace",
  • "go.survey.prompt": false,
  • "go.coverOnSingleTest": true,
  • "go.coverOnSingleTestFile": true,
  • "go.coverShowCounts": true,
  • "go.coverOnSave": true,
  • "go.testExplorer.alwaysRunBenchmarks": true

Describe the bug

A clear and concise description of what the bug.
A clear and concise description of what you expected to happen.

After updating VSCode from 1.62.0 to 1.62.1, the Go extension always says when I run VSCode:

Failed to find the "go" binary in either GOROOT() or PATH(/home/(myname)/.vscode-server/bin/f4af3cbf5a99787542e2a30fe1fd37cd644cc31f/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/Common Files/Oracle/Java/javapath:/mnt/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64/compiler:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/(myname)/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/(myname)AppData/Local/GitHubDesktop/bin:/mnt/c/Program Files/Java/jdk-11.0.12/bin:/mnt/c/Users/(myname)/AppData/Local/Programs/Microsoft VS Code/bin). Check PATH, or Install Go and reload the window. If PATH isn't what you expected, see https://github.com/golang/vscode-go/issues/971

despite it didn't when the VSCode version was 1.62.0.
It happened on WSL environment on Windows 11. I installed go with asdf-vm, so that my GOROOT is set to /home/(myname)/.asdf/installs/golang/1.17.3/go and /home/takuto/.asdf/shims exists in $PATH (I checked on my WSL Ubuntu terminal with go env and echo $PATH, but they're properly set). Maybe the Go extension tries to find "go" binary before WSL executes .bashrc (since all the settings I mentioned is written in .bashrc).
It was absolutely caused by the VSCode update (I checked it by reinstalling VSCode 1.62.0 and ensured the Go extension works properly), but it's the Go extension problem. I don't know which repository to post this issue, so I post it here first.

Steps to reproduce the behavior:

  1. Install asdf-vm with Bash & Git referring here
  2. Install golang 1.17.3 with asdf-vm and set version to it
  3. Open VSCode with remote-WSL
  4. You will see Go extension somehow cannot find asdf-installed Go binary

Screenshots or recordings

If applicable, add screenshots or recordings to help explain your problem.

@gopherbot gopherbot added this to the Untriaged milestone Nov 10, 2021
@hyangah
Copy link
Contributor

hyangah commented Nov 10, 2021

Maybe this? microsoft/vscode#136791

@hyangah hyangah added upstream-vscode Issues that are by problems in VS Code itself. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Nov 10, 2021
@logica0419
Copy link
Author

It's exactly that. Thank you so much for finding!

@logica0419
Copy link
Author

What should I do to close this issue? Nothing?

@hyangah
Copy link
Contributor

hyangah commented Nov 12, 2021

Thanks for the update. Let's close this.

@hyangah hyangah closed this as completed Nov 12, 2021
@golang golang locked and limited conversation to collaborators Nov 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge upstream-vscode Issues that are by problems in VS Code itself. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants