Open drewr opened 9 years ago
@johnwalker does it really work for you?
Works for me, but this setup should also work. Does emacs see stack on your path?
Oh, that shouldn't be related. All that is happening is stack ghci is being called in your target directory.
What does ps -x tell you about the programs being run?
28042 pts/3 Ssl+ 0:01 /home/john/.cabal/bin/stack ghci --ghc-options=-ferror-spans
28065 pts/3 Sl+ 0:00 /home/john/.stack/programs/x86_64-linux/ghc-7.8.4/lib/ghc-7.8.4/bin/ghc -B/home/john/.stack/programs/x86_64-linux/ghc-7.
28290 pts/5 R+ 0:00 ps -x
Interesting, ps
indeed shows stack ghci
was spawned. Any ideas why I still get the cabal dialog? Any way to turn it off?
I think the fault is in:
(let ((target (haskell-session-target session)))
(if target (list target) nil))
Instead of this chunk of code, we should just prompt for a directory to run stack ghci.
Oh no, that seems fine. Still thinking. But it's definitely a problem with the elisp
OK, I think I know whats going on. If you do ps -aux | grep cabal, it should give you a huge line with stack and then buried off to the side a reference to the version of cabal that stack is using. This should be the only instance of cabal used for interaction.
For example
28886 home/john/.stack/programs/x86_64-linux/ghc-7.8.4/lib/ghc-7.8.4/bin/ghc -B/home/john/.stack/programs/x86_64-linux/ghc-7.8.4/lib/ghc-7.8.4 --interactive -hide-all-packages -i/home/john/z/scr/ -i/home/john/z/scr/src/ -i/home/john/z/scr/.stack-work/dist/x86_64-linux/Cabal-1.18.1.5/build/autogen/ -optP-include -optP/home/john/z/scr/.stack-work/dist/x86_64-linux/Cabal-1.18.1.5/build/autogen/cabal_macros.h -package=base -package=text -package=bytestring -package=HTTP -package=http-conduit -package=tagsoup -rtsopts -with-rtsopts=-N -i/home/john/z/scr/app/ -package=scr -i/home/john/z/scr/test/ /home/john/z/scr/src/Lib.hs -ferror-spans
Can you tell me more about the cabal dialog you're getting? Is it a prompt from emacs?
It's the flow that goes:
Start a new project named.... ?
Cabal dir:
build target (empty for default):
Set current directory:
I hadn't updated my haskell-mode in a while, so this may just be new behavior. I'd like to just have a GHCI prompt from C-c C-l
but it wasn't obvious from the elisp how to do it.
I can see how that is confusing. We should probably mention to the user whether stack or cabal is being used in the line that begins "Start a new project named ... ? "
@drewr @johnwalker: Did you manage to resolve what is going on here?
I would love to merge a pull request that improves messages around cabal/stack startup as we seem to have many confused users here.
Yes. I don't know how much of this process is needed:
Start a new project named.... ?
Cabal dir:
build target (empty for default):
Set current directory:
And what is confusing users is the line "cabal dir."
Do we need a call to haskell-session-target?
@johnwalker: Can you do one thing for me and change this:
Start a new project named.... ?
Cabal dir:
build target (empty for default):
Set current directory:
Into this:
Start a new $type project named.... ?
Directory where project *.cabal file is located (empty to autodetect):
Project build target (empty for default):
Set current directory to (empty for default):
and put $type over there to ghci
to cabal-repl
or stack-ghci
.
(Note that cabal-ghci
should no longer exist. I do not remember why is it still there.)
Whilst the wording can be improved, I think your suggestions @gracjan are a tad too long, the 2nd one in particular.
Maybe something like:
Project root directory (empty to autodetect):
I also wonder whether the last prompt is needed with cabal-repl
as you specify the directories used in the .cabal file...
Whole workflow needs improvement, meanwhile I'd like to have it mouthful.
Yes, I'll do this late on Wednesday.
Will take me a little longer
That is ok. We will wait.
:+1: I have just been bitten by this one ;-) Will revert to use an external ghci session.
stack-ghci
doesn't work for me.haskell-session
seems to always get tohaskell-session-new-assume-from-cabal
:Even though:
Is there something else I need to do?