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

Windows 10, VS Code: HIE server crashes - spaces in path not handled properly? #84

Closed
mpilgrem opened this issue May 23, 2018 · 4 comments

Comments

@mpilgrem
Copy link
Contributor

As noted in haskell/haskell-ide-engine#565, HIE/Haskell Language Server (HLS) does not work with VS Code if hie.exe is on the PATH but on a path with a space in it. It fails on startup with the following 'notification' message ('HelloWorld' is the name of the test Haskell project, created with stack new HelloWorld):

The Haskell HIE (HelloWorld) server crashed 5 times in the last 3 minutes. The server will not be
restarted.

and messages in 'OUTPUT' ('Haskell HIE (HelloWorld)') like:

[Info  - 20:04:10] Connection to server got closed. Server will restart.
Pilgrem\AppData\Roaming\local\bin\hie.exe] was unexpected at this time.
[Error - 20:04:10] Connection to server got closed. Server will not be restarted.

hie.exe is located at:

>where hie
C:\Users\Mike Pilgrem\AppData\Roaming\local\bin\hie.exe

and the 'output' above seems to reference only the part of the path after the space.

If hie.exe is moved to a location with no spaces in the path, everything then works as expected - which is an easy work-around but not the desired behaviour.

For reference:

  • hie.exe --version is Version 0.2.0.0, Git revision 753deb91f9b9b39f14722315277d9fd587716bde (1341 commits) x86_64 ghc-8.2.2
  • code --version is 1.23.1, d0182c3417d225529c6d5ad24b7572815d0de9ac, x64
  • Haskell Language Server is version 0.0.16
@Rhywun
Copy link

Rhywun commented Jul 13, 2018

I'm getting the same errors out of nowhere - one minute HIE was working, the next it refuses to start after five or six times quitting and relaunching VSCode. This happens frequently but usually the problem goes away within 10 minutes or so. Not this time. I found a log file hie-wrapper.log but it doesn't show anything useful (i.e. any errors). Is there any other log file I can check? Or any other troubleshooting I can try?

PS. I am not on Windows nor using a path with spaces.

hie v. 0.2.0.0
code v. 1.25.1
plugin v. 0.0.20

Also, resolver is lts-12.0
GHCi, version 8.4.3

@alanz
Copy link
Collaborator

alanz commented Jul 13, 2018

The new 0.0.20 vscode release uses the hie-wrapper executable, supplied by hie itself.

@Rhywun
Copy link

Rhywun commented Jul 13, 2018

OK, I remade hie (to version 0.2.1.0) and now I have an hie-wrapper executable.
Getting different errors now, this x5:

2018-07-13 07:41:44.98462 [ThreadId 4] - run entered for hie-wrapper(hie-wrapper) Version 0.2.1.0, Git revision 1e09a1a94c9624510de43ddebb71b688632d7f42 (1569 commits) x86_64 ghc-8.4.3
2018-07-13 07:41:44.986105 [ThreadId 4] - Current directory:/Users/...
2018-07-13 07:41:44.986965 [ThreadId 4] - Using plain GHC version
/bin/sh: ghc: command not found
hie-wrapper: readCreateProcess: ghc --version (exit 127): failed
[Error - 07:41:44] Connection to server got closed. Server will not be restarted.

Which makes sense since I don't have a ghc executable installed. Only stack.

Update: brew install ghc fixes this issue but it seems like HIE shouldn't depend on a local installation of GHC or am I mistaken? I'm not working in a project, if it matters. Just plain .hs files.

@jneira
Copy link
Member

jneira commented Jan 9, 2020

@Rhywun hie should start without ghc in path using stack (since haskell/haskell-ide-engine#1496)
@mpilgrem the issue about spaces in path is being tracked in hie itself: haskell/haskell-ide-engine#1356

@jneira jneira closed this as completed Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants