Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

using ghc-mod with stack: cabal-helper-wrapper: ghc: readCreateProcess: runInteractiveProcess: exec: does not exist (No such file or directory) #660

Closed
deflexor opened this issue Oct 18, 2015 · 14 comments
Labels

Comments

@deflexor
Copy link

Just did fresh install of stack, then haskell via stack setup, then configured emacs as described here: https://github.com/serras/emacs-haskell-tutorial/blob/master/tutorial.md

Then after starting emacs and opening .hs file got this error message:

cabal-helper-wrapper: ghc: readCreateProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
ghc-mod: GMEProcess "readProcessStderrChan" "/home/deflexor/.stack/global/.stack-work/install/x86_64-linux/lts-3.9/7.10.2/libexec/cabal-helper-wrapper" ["/tmp/hhi","/tmp/hhi/.stack-work/dist/x86_64-linux/Cabal-1.22.4.0"] (Left 1)
cabal-helper-wrapper: ghc: readCreateProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
ghc-mod: GMEProcess "readProcessStderrChan" "/home/deflexor/.stack/global/.stack-work/install/x86_64-linux/lts-3.9/7.10.2/libexec/cabal-helper-wrapper" ["/tmp/hhi","/tmp/hhi/.stack-work/dist/x86_64-linux/Cabal-1.22.4.0"] (Left 1)

There is no dist subdirectory in project dir. GHC, version 7.10.2

@DanielG
Copy link
Owner

DanielG commented Oct 19, 2015

Okay so it's complaining the ghc executable does not exist.

My guess is you installed ghc-mod using stack, you're using Stack's --install-ghc builtin GHC thing. Therefore the GHC that Stack installed is not on your PATH and you're trying to use ghc-mod in a project that is not a Stack project.

Easy fix: just add any version of ghc to your PATH. It's only needed to build cabal-helper's runtime wrapper thing so anything that is old enough to be compatible with whatever version of Cabal is in your projects will do. (this most likely means 7.8 or 7.10 or so since you're using Stack)

@DanielG
Copy link
Owner

DanielG commented Oct 19, 2015

Maybe we ought to check if ghc exists on the path and ask stack for one (if it's installed) when we can't find it. Should be relatively easy to add if anyone wants to shoot me a PR.

@DanielG DanielG added the easy label Oct 19, 2015
@DanielG
Copy link
Owner

DanielG commented Oct 19, 2015

(Note to self: remember to remove wiki entry when this is resolved: https://github.com/kazu-yamamoto/ghc-mod/wiki#cabal-helper-wrapper-ghc--does-not-exist)

@nrolland
Copy link
Contributor

if that's an easy fix, it would probably be a good opportunity to make it an introduction to ghc-mod structure to see how you would investigate about this. that would give other contributors a map of where things are

@codygman
Copy link

Is anyone working on this? It looks like a nice weekend (maybe less) project.

@DanielG
Copy link
Owner

DanielG commented Dec 18, 2015

Actually I just tested this and it works even if you don't have a system wide ghc installed.

https://github.com/kazu-yamamoto/ghc-mod/blob/master/Language/Haskell/GhcMod/CabalHelper.hs#L123

patchStackPrograms looks on Stack's bin-path and uses the path to it's GHC instead.

@codygman are you getting the same error as well? It might be something I fixed in git so do try the version from master if so.

@DanielG
Copy link
Owner

DanielG commented Jan 3, 2016

I think this is fixed in master just reopen if I'm wrong.

@DanielG DanielG closed this as completed Jan 3, 2016
@x-ji
Copy link

x-ji commented Jan 10, 2016

Still not working for me. I instlaled ghc-mod with stack, resolver version lts-4.0. Do I have to manually install ghc-mod via master branch instead of using stack then? However when I tried to run stack init/stack install in the downloaded repo, it says some of the dependencies can't be met.

@DanielG DanielG reopened this Jan 10, 2016
@DanielG
Copy link
Owner

DanielG commented Jan 10, 2016

Ah that's interesting, I can reproduce this but only when .stack-work doesn't exists yet. So after the first run it works just fine.

@codygman
Copy link

That's interesting.
On Jan 10, 2016 11:18 AM, "Daniel Gröber" notifications@github.com wrote:

Ah that's interesting, I can reproduce this but only when .stack-work
doesn't exists yet.


Reply to this email directly or view it on GitHub
#660 (comment).

@DanielG
Copy link
Owner

DanielG commented Jan 10, 2016

Ah I found the cause writeAutogenFiles from cabal-helper doesn't allow passing down Programs so I forgot doing it there. I think I can make a minor upgrade that should be able to go into stackage.

@DanielG
Copy link
Owner

DanielG commented Jan 10, 2016

Gah now I have to maintain a stable branch for stackage too. Anyways give it a go:

$ git clone https://github.com/DanielG/ghc-mod -b stable-5.4 ghc-mod-stable-5.4
$ cd ghc-mod-stable-5.4
$ stack install

@DanielG
Copy link
Owner

DanielG commented Jan 17, 2016

So this is going into 5.5 not sure if we're going to do a minor release for 5.4 too.

@DanielG DanielG closed this as completed Jan 17, 2016
@codygman
Copy link

👍 thanks for your hard work!

On Sun, Jan 17, 2016 at 1:16 PM, Daniel Gröber notifications@github.com
wrote:

Closed #660 #660.


Reply to this email directly or view it on GitHub
#660 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants