haskell-mode
haskell-mode copied to clipboard
Interactive mode cannot work for stack ghci
HI, appreciate you guys notice this issue, My working environment is: WIndows 10 64 bit, emacs 24.5.1
My problem is that when I start interactive mode in eamcs, it would say:
"The Haskell process `haskell` has died."
And the process log shows:
("Starting inferior stack GHCi process using stack" "haskell" nil "stack" "ghci" "--ghc-options=-ferror-spans")
-> Prelude.putStrLn ""
:set -v1
:set +c
-> :set prompt "\4"
-> :set prompt2 "λ| "
<- Run from outside a project, using implicit global project config
<- Error parsing targets: The specified targets matched no packages.
Perhaps you need to run 'stack init'?
Warning: build failed, but optimistically launching GHCi anyway
<- Configuring GHCi with the following packages:
GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help
<- Ok, modules loaded: none.
Prelude>
Prelude> Prelude> unknown option: 'c'
Prelude> Leaving GHCi.
Event: "finished"
Process reset.
May I ask how to solve it? Thanks!
Looks like something wrong with working directory on Windows.
Hmm… I overviewed haskell-interactive.el and did not found a piece of code where project's root folder lookup occur.
Thanks for your reply, It works well on my ubuntu machine. But still cannot work for windows...... Is it possible the stack problem?
@zhouqiji I can't be certain, sorry for delay @gracjan can tell how interactive mode determines the project directory (I see no clue in sources)?
It tries to find *.cabal by going up the directories.
Do you know how it gets current directory (from where to start)?
@geraldus: I do not think that current working directory is managed somehow differently under unix versus windows.
I'm working on a testing environment for Windows so if somebody wants to write a test case for this particular issue and make sure it works on Unix then we will be able to also check same scenario on Windows.
@zhouqiji I tried this out on a Windows 7 box and I got it fixed by:
- Following step 3 in https://www.haskell.org/platform/windows.html#windows
- Running
stack setup.
Does that work for you?
@fice-t Appreciate your help, I will try it. :)
I have the same problem,but I don't know how to solve. The haskell process log is
`("Starting inferior stack GHCi process using stack" "haskell" nil "stack" "ghci" "--ghc-options=-ferror-spans") -> Prelude.putStrLn "" :set -v1 :set +c -> :set prompt "\4" -> :set prompt2 "λ| " <- Note: No local targets specified, so a plain ghci will be started with no package hiding or package options.
If you want to use package hiding and options, then you can try one of the following:
* If you want to start a different project configuration
than C:\sr\global-project\stack.yaml, then you can use stack init to create a new stack.yaml
for the packages in the current directory.
* If you want to use the project configuration
at C:\sr\global-project\stack.yaml, then you can add to its 'packages' field.
<- Configuring GHCi with the following packages:
<- GHCi, version 8.6.3: http://www.haskell.org/ghc/ :? for help
<- Loaded GHCi configuration from C:\Users\bugczw\AppData\Local\Temp\haskell-stack-ghci\2a3bbd58\ghci-script Prelude> Prelude> Prelude> Prelude> Leaving GHCi.`