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

"Unexpected response from haskell process" when loading in new session #882

Closed
cmears opened this issue Sep 17, 2015 · 2 comments
Closed

Comments

@cmears
Copy link
Contributor

cmears commented Sep 17, 2015

Sometimes when you press C-c C-l to start a new session and immediately load a file, I get "Unexpected response from haskell process." I think this is due to a race condition.

When the new session starts, it issues a few commands to set the prompt, set verbosity and change directory. If the empty response to these commands comes late, they appear to haskell-mode to be in response to the load command, which doesn't match the expected output.

That is, you get this timeline:

send "cd"
send "load"
receive empty response (from the cd)
receive response "compiling, loading modules, etc." (from the load)

It doesn't always happen, (un)fortunately. You can see it in action in the log below -- the last few lines are the interesting bit. I've tried fiddling around with a few things but I don't know the right way to fix it.

("Starting inferior stack GHCi process using stack" "haskell" nil "stack" "ghci" "--ghc-options=-ferror-spans")

-> :set prompt "\4"

-> Prelude.putStrLn ""

-> :set -v1

<- Run from outside a project, using implicit global config

   Using resolver: lts-2.15 from global config file: /home/chris/.stack/global/stack.yaml



<- Configuring GHCi with the following packages: 



<- GHCi, version 7.8.4: http://www.haskell.org/ghc/  :? for help



<- Loading package ghc-prim ... 

<- linking ... done.

   Loading package integer-gmp ... linking ... done.

   Loading package base ... linking ... done.



<- Prelude

<- > �

-> :cd /home/chris/elisp/others/haskell-mode/

<- 



<- ��

-> :load "/home/chris/elisp/others/haskell-mode/Test.hs"

<- �

<- [1 of 1] Compiling Test             ( /home/chris/elisp/others/haskell-mode/Test.hs, /home/chris/.stack/global/.stack-work/odir/Test.ghcio )
@gracjan
Copy link
Contributor

gracjan commented Sep 17, 2015 via email

@cmears
Copy link
Contributor Author

cmears commented Sep 17, 2015

I investigated this some more and found that it should only be a problem at session start -- otherwise, all commands are run in the strict request-response order. See pull request #887 for a fix.

@gracjan gracjan closed this as completed Sep 18, 2015
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

2 participants