Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Tools build ("Successfully"), but don't appear in the tools directory when GOBIN is set #2122

Closed
foodini opened this issue Nov 13, 2018 · 4 comments

Comments

@foodini
Copy link

foodini commented Nov 13, 2018

Installing 17 tools at /Users/ronb/gotools/bin
  gocode
  gopkgs
  go-outline
  go-symbols
  guru
  gorename
  dlv
  gocode-gomod
  godef
  godef-gomod
  goreturns
  golint
  gotests
  gomodifytags
  impl
  fillstruct
  goplay

Installing github.com/mdempsky/gocode SUCCEEDED
Installing github.com/uudashr/gopkgs/cmd/gopkgs SUCCEEDED
Installing github.com/ramya-rao-a/go-outline SUCCEEDED
Installing github.com/acroca/go-symbols SUCCEEDED
Installing golang.org/x/tools/cmd/guru SUCCEEDED
Installing golang.org/x/tools/cmd/gorename SUCCEEDED
Installing github.com/derekparker/delve/cmd/dlv SUCCEEDED
Installing github.com/stamblerre/gocode SUCCEEDED
Installing github.com/rogpeppe/godef SUCCEEDED
Installing github.com/ianthehat/godef SUCCEEDED
Installing github.com/sqs/goreturns SUCCEEDED
Installing golang.org/x/lint/golint SUCCEEDED
Installing github.com/cweill/gotests/... SUCCEEDED
Installing github.com/fatih/gomodifytags SUCCEEDED
Installing github.com/josharian/impl SUCCEEDED
Installing github.com/davidrjenni/reftools/cmd/fillstruct SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay SUCCEEDED

All tools successfully installed. You're ready to Go :).

But, when I look at the contents of /Users/ronb/gotools/bin:

-rwxr-xr-x  1 ronb  staff  11513100 Nov 13 13:07 gocode-gomod
-rwxr-xr-x  1 ronb  staff   8072176 Nov 13 13:07 godef-gomod

So, of course, anything that depends upon tools fails and tells me I need to install them.

This is VSCode 1.29.0 on High Sierra 10.13.6.

@foodini
Copy link
Author

foodini commented Nov 13, 2018

I found the issue. I had a GOBIN set, which pointed elsewhere. Despite what the Go: Install/Update Tools says, it was installing to GOBIN instead.

@ramya-rao-a
Copy link
Contributor

Thats a great find @foodini!

We should still make some changes to avoid the confusion. Here is what I propose:

  • If go.toolsGopath setting is set, then the process that installs the tools should unset the GOBIN env variable, so that the tools get installed in the right place
  • GOBIN should be added to the list of places where the extension looks for the tools.

PRs are most welcome.
Code Pointers:

@ramya-rao-a ramya-rao-a changed the title Tools build ("Successfully"), but don't appear in the tools directory. Tools build ("Successfully"), but don't appear in the tools directory when GOBIN is set Nov 21, 2018
@wvh
Copy link

wvh commented Jan 7, 2020

I'm trying vscode for the first time, and I had the same problem. I've got GOBIN set to ~/.local/gobin, so Go installs all compiled binaries in that path by default. Vscode installs the binaries successfully there too, but when reloading or restarting the editor, it complains it can't find the binaries it just installed: Analysis Tools Missing. I'm not sure vscode-go even uses GOBIN anywhere in the code, so it looks in the wrong place for the installed binaries.

I've solved the problem by manually setting go.toolsGopath.

Ideally, vscode would respect the GOBIN environment variable when one is set by the user, to avoid a mismatch between Go's and vscode's idea of where the binaries are stored.

@ramya-rao-a
Copy link
Contributor

This issue has been resolved in the latest version (0.13.0) of this extension

Thanks for the PR @marcel-basel and Thanks for reporting @foodini !

Happy Coding!

@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants