-
Notifications
You must be signed in to change notification settings - Fork 769
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
Reevaluate the need for tools reinstallations when GOROOT is changed #294
Comments
Change https://golang.org/cl/244758 mentions this issue: |
It uses runtime.GOROOT() to clean file names. If the version of Go used to build the godef tool is different from the version of Go we are currently using is different, it will not know the right place for standard libraries without GOROOT env var. Updates #294 Updates #146 Change-Id: I4b93023634d4f20b4e9802f756e168e41c1055f0 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/244758 Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
It uses runtime.GOROOT() to clean file names. If the version of Go used to build the godef tool is different from the version of Go we are currently using is different, it will not know the right place for standard libraries without GOROOT env var. Updates golang#294 Updates golang#146 Change-Id: I4b93023634d4f20b4e9802f756e168e41c1055f0
A user reported |
Change https://golang.org/cl/254137 mentions this issue: |
gopkgs uses build.Default.GOROOT so `GOROOT` env var should be set to use `gopkgs` compiled with a different version of Go. Updates #294 Change-Id: I746baed9fcf692a6c9248cdfd17f8ca3fef19426 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/254137 Reviewed-by: Rebecca Stambler <rstambler@golang.org>
The mentioned code that tracks GOROOT change was deleted. Instead, the extension currently checks |
This extension keeps track of the
GOROOT
used last time inctx.globalState.get('toolsGoInfo')
.If use of a different GOROOT is detected when activated, it prompts users to recompile/reinstall Go tools with a message like:
Your current goroot (${currentGoroot}) is different than before (${prevGoroot}), a few Go tools may need recompiling
The code is here
vscode-go/src/goMain.ts
Lines 94 to 127 in 89c61d9
This was a heuristic to deal with old tools that used the
GOROOT
embedded during the tool's compile time (See microsoft/vscode-go#1286 for example) in old days. Newer tools shouldn't depend on the value ofGOROOT
used in the tool's compile time, so recompiling shouldn't be necessary as long as the tool is up-to-date.Examine tools this extension depends on and check whether they use hard-coded build time
GOROOT
.Once we know no tools require recompilation any more, remove this popup and the heuristic.
Inspection status (check if investigated && not require recompilation)
cc @stamblerre @mcjcloud @FiloSottile
The text was updated successfully, but these errors were encountered: