-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Reinstall binaries when a GOROOT change is detected #901
Comments
Hi @FiloSottile Thanks for the feedback. This seems like a very niche problem you have. I don't know how many people compile Go on daily basis, I assume it might be very very low? I'm always open for new features and improving the user experience for vim-go. If this is something we can incorporate in an easy way and don't require a lot of maintenance in the future, I'm more than happy to add it.
How do you think to do it? I've read your blog post, and seems like you go over all binaries by using a custom Go application you wrote (gorebuild). Is it possible to detect the change without using this application? We already have the |
Thanks for the response! I'm afraid I didn't explain my case well, this happens every time a new version of Go is published for all Homebrew users, and it's incredibly hard to diagnose. Empirical evidence: http://www.reddit.com/r/golang/comments/4nss0v/stale_goroot_and_gorebuild/d46ytkd About how to do it, does vim-go have permanent storage? Or maybe detecting a special error message? Or just also install a tool that just prints the GOROOT, and execute it to check if it's consistent with the environment before running tools. Sent from a small keyboard |
Ok now I get what you mean, thanks for the clarification 👍
There is no global storage unfortunately. We only read the settings, if any, from vimrc and that's it. We already have a helper method to get The issue though here is, how do we get the embedded GOROOT from the binary itself without using any external tool, such as I'm not keen to be honest, as the requirements to implement this is also high (depending on a third party app). I'm open to suggestions, maybe there is an easy way to detect the embedded GOROOT. If you have a simple solution to this, I'm all ears. |
I think I just hit this problem too - I tried to use
(My go version is now 1.6.2) I tried running |
@ashb in your case, can you call It's great that setting GOROOT is fixing it. Maybe I can initially set GOROOT as you did when vim-go is loaded and override the env inside the binaries. The only concern is that, we also would override the value if the user has set GOROOT already. But I can check if GOROOT has been set, and only override it if it's not set by the user already. How would that work ? |
The main thing that was confusing to me as a user was that the tools sort just mysteriously stopped working. It would be nice if there was some way of detecting this and just telling the user "You need to :GoUpdateBinaries" -- but I'm immediately sure how we might be able to do that. |
Add new function to return cached version of Go environment variables. With that set GOROOT everytime we execute gocode. This will prevent gocode using the internal embedded GOROOT and will use the GOROOT from the latest installed Go version. Fixes #901
Can you please try the PR: #954 ? We're using a cached version of |
Add new function to return cached version of Go environment variables. With that set GOROOT everytime we execute gocode. This will prevent gocode using the internal embedded GOROOT and will use the GOROOT from the latest installed Go version. Fixes #901
Add new function to return cached version of Go environment variables. With that set GOROOT everytime we execute gocode. This will prevent gocode using the internal embedded GOROOT and will use the GOROOT from the latest installed Go version. Fixes #901
When GOROOT changes, for example if you simply upgrade Go with Homebrew, all binaries compiled with the old compiler will end up with a stale GOROOT. This is confusingly breaks tools like gocode.
Maybe vim-go could (suggest to?) rerun InstallBinaries when a GOROOT change is detected.
See also: https://blog.filippo.io/stale-goroot-and-gorebuild/
The text was updated successfully, but these errors were encountered: