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

Default GOPATH not being detected #2637

Closed
jayschwa opened this issue Jul 7, 2019 · 7 comments

Comments

@jayschwa
Copy link

@jayschwa jayschwa commented Jul 7, 2019

Possible regression related to #1879 with VSCode v1.36.0 and Go extension v0.11.2.

When I open a Go project with no explicit GOPATH set, I get the following notifications:

vscode-go

Clicking on the "Install All" button produces the following error:

Cannot install Go tools. Set either go.gopath or go.toolsGopath in settings.

Run from VSCode's integrated terminal:

$ go version
go version go1.12.6 linux/amd64
$ echo $GOPATH

$ go env GOPATH
/home/jayschwa/go

"Go: Current GOPATH" from the command palette returns "undefined is the current GOPATH."

@ramya-rao-a

This comment has been minimized.

Copy link
Member

@ramya-rao-a ramya-rao-a commented Jul 7, 2019

Thanks for reporting @jayschwa

I have a bad feeling that this is a regression.. Can you please try out a couple of older versions of the Go extension to see if the GOPATH was being determined correctly before?

You can find the older versions at https://github.com/microsoft/vscode-go/releases
Download the vsix file and then run the command Extensions: Install from VSIX...

@jayschwa

This comment has been minimized.

Copy link
Author

@jayschwa jayschwa commented Jul 8, 2019

v0.9.0 did not work either. Same behavior.

@ramya-rao-a

This comment has been minimized.

Copy link
Member

@ramya-rao-a ramya-rao-a commented Jul 10, 2019

May be there is a race condition somewhere...
Do you mind setting up a local dev set up for the extension and debugging the extension?

@jayschwa

This comment has been minimized.

Copy link
Author

@jayschwa jayschwa commented Jul 10, 2019

Added: Nevermind, the function is using the arguments object to parse things out before calling spawn. Still digging...

My debugging session is showing something strange. The implementation of cp.execFile that gets called has most of its args commented out. The only thing being passed through is the path to the Go executable.
vscode_wtf

@jayschwa

This comment has been minimized.

Copy link
Author

@jayschwa jayschwa commented Jul 10, 2019

The values in the cp.execFile callback: err is null and both stdout and stderr are "".

@jayschwa

This comment has been minimized.

Copy link
Author

@jayschwa jayschwa commented Jul 10, 2019

If I change the sub-command in the execFile to be nonsense, err is populated. It seems like Go is being called, but stdout and stderr aren't being copied correctly.

@jayschwa

This comment has been minimized.

Copy link
Author

@jayschwa jayschwa commented Jul 10, 2019

Found upstream issue microsoft/vscode#75581. Closing this one. Thanks.

@jayschwa jayschwa closed this Jul 10, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.