-
Notifications
You must be signed in to change notification settings - Fork 646
gocode-gomod and godef-gomod fails to install on multi path gopath #1966
Comments
@godblesshugh That issue is unrelated |
sorry didn't read carefully, unrelated indeed. |
same issue +1 |
Thought I'd tell everyone the workaround just incase no one figured it out yet. Set |
installation on mac also fails and setting go.toolsGopath did not help either. Seems the issue for me is on this line: getBinPath(tool) resolves to 'gocode-gomod' which is obviously wrong and throws system error "Error: spawn ENOTDIR" which causes promise to be rejected without handling the rejection and as a result nothing is installed and no error is seen on the ui. the issue seems to be that in case getBinPath(tool) returns just a toolname (e.g. gocode-gomod) then there's no starting slash which would indicate filesystem path and causes OS level error. when I switched that line to cp.execFile('/'+tool, ....) install completed successfully (though this is not a 'production' fix obviously) I was struggling to understand why there would be any need to start a process with a binary that does not exist yet. |
@margusha I tried to repro your case and deleted the
This is by design. So I am unsure why you would get the ENOTDIR error.. What version of node do you have? |
Others, The fix for the multiple GOPATH issue been pushed to master and is available in the latest beta version of this extension |
@margusha |
@ramya-rao-a I was using node 10.9.0 but tried with 6.x, 8.x, 9.x and encountered the same issue. I managed to reproduce both errors in isolation on command line.
outputs and if I add forward slash to the first argument like in following snippet, it will behave differently by giving ENOENT:
the cp.execFile runs correctly if it finds binary file from path. e.g. just went over with debugger and getBinPath('gocode-gomod') returns I guess it is related to node.js itself. if I'm not mistaken, older versions of node.js child_process.spawn did not handle ENOTDIR which could lead to unhandled promise rejection but the error itself should not even happen in this case. Can't reproduce the ENOTDIR on different machine though. something magical is going on. it is too specific issue to spend time on and investigate further but maybe it helps someone else if in the same situation. the other way to get the installation to work is by manually installing gocode and gocode-gomod, just have to take in to account that both install under the same name and one should be named gocode-gomod
I guess my initial whining about the failing install was premature and it is related to something specific to my environment, sorry :) Will try out if your code change makes my computer happy |
@margusha Thanks for the info! I was really curious about why I see only ENOENT and not ENOTDIR Regardless, you are right. We shouldnt be attempting to run |
The fix for this issue is now out in the latest update to the Go extension (0.6.92) |
It works like a charm! installs the tools correctly. thanks :) |
Steps to Reproduce:
C:\folder1;C:\folder2;
Looks like the script is assuming gopath is a single path and blindly passing gopath around.
The text was updated successfully, but these errors were encountered: