atom-haskell-archive / haskell-ghc-mod

haskell-ghc-mod atom package
https://atom.io/packages/haskell-ghc-mod
MIT License
69 stars 20 forks source link

ghc-mod failed to launch ENOENT #71

Closed nykh closed 8 years ago

nykh commented 8 years ago

For some reason GHC-Mod is not working. I do not remember the chance I did prior to this happening, but updating Atom to the latest version has not solved the problem.

The following error messages pop up when starting Atom:

Haskell-ghc-mod: ghc-mod failed to launch it is probably missing or misconfigured

Error: spawnSync ghc-mod ENOENT

Haskell-ghc-mod: ghc-mod lang failed with error message Error: spawn ghc-mod ENOENT

Haskell-ghc-mod: ghc-mod flag failed with error message Error: spawn ghc-mod ENOENT

The current ghc-mod and ghc version

ghc-mod version 5.4.0.0 compiled by GHC 7.10.2

simonh1000 commented 8 years ago

Same here. I recall I once had it working on Ubuntu (15.04 i think), and have never seen it work on OSX. It would be great if someone in the know could add more to the README

I tweaked the options to point to the recently compiled ghc-mod and the file referenced in the error message does exist:

Haskell-ghc-mod: ~/.cabal/bin/ghc-mod lang failed with error message Error: spawn ~/.cabal/bin/ghc-mod ENOENT

lierdakil commented 8 years ago

@simonh1000, ~ is shell-specific. Atom doesn't understand that one. Please try to specify full path without any shell substitutions and environment variables.

@nykh, Atom doesn't pick up on environment variables set in terminal session when run from Finder on OSX. Try starting Atom from terminal. If it helps, adjust 'Additional Path Directories' setting to reflect your terminal PATH. Otherwise, make sure you have ghc-mod installed and Atom knows where to look for it (via 'Additional Path Directories' setting or 'ghc-mod path' setting)

simonh1000 commented 8 years ago

Thanks @lierdakil - that has helped, but now I face (on OSX):

ghc-mod: cabal: readCreateProcess: runInteractiveProcess: exec: does not exist (No such file or directory)

lierdakil commented 8 years ago

@simonh1000, do you have cabal-install? If not, easier to just install it, probably.

simonh1000 commented 8 years ago
$ cabal-install 
-bash: cabal-install: command not found
lierdakil commented 8 years ago

I meant a haskell package that provides 'cabal' command. 17 дек. 2015 г. 1:06 пользователь "Simon Hampton" notifications@github.com написал:

$ cabal-install -bash: cabal-install: command not found

— Reply to this email directly or view it on GitHub https://github.com/atom-haskell/haskell-ghc-mod/issues/71#issuecomment-165258995 .

simonh1000 commented 8 years ago

Ah, sorry, misunderstood. I have the following on my linux box

ghc-mod version 5.4.0.0 compiled by GHC 7.8.4

$ cabal --version cabal-install version 1.22.0.1 using version 1.22.1.1 of the Cabal library

image

lierdakil commented 8 years ago

Huh. Could you show 'which cabal' output? 17 дек. 2015 г. 9:55 пользователь "Simon Hampton" notifications@github.com написал:

Ah, sorry, misunderstood. I have the following on my linux box

ghc-mod version 5.4.0.0 compiled by GHC 7.8.4

$ cabal --version cabal-install version 1.22.0.1 using version 1.22.1.1 of the Cabal library

[image: image] https://cloud.githubusercontent.com/assets/5256724/11863344/7d7cb0e0-a493-11e5-8cb2-f85a5ec6fa80.png

— Reply to this email directly or view it on GitHub https://github.com/atom-haskell/haskell-ghc-mod/issues/71#issuecomment-165359256 .

simonh1000 commented 8 years ago

OSX - /usr/local/bin/cabal Linux - .cabal/bin/cabal

simonh1000 commented 8 years ago

Linux us beginning to settle down. I run stack build from a console, but in Atom I get some linting messages. Still get something like this quite often

image

lierdakil commented 8 years ago

@simonh1000, you might want to add /usr/local/bin to 'Additional Path Directories' on OSX, in case it's not there. That might help with ghc-mod: cabal: readCreateProcess: runInteractiveProcess: exec: does not exist. As for latter error, it suggests that either your package.cache is broken, or you have multiple versions of packages (possibly also built with different versions of ghc) competing for attention there.

Probably could solve this by installing everything (i.e. ghc-mod and probably cabal-install) exclusively with stack, and using stack exec -- atom to start Atom (I know this is suboptimal, but I have no better option at the moment). Mixing stack with cabal-install is usually not a very good idea unless you know precisely what you are doing.

lierdakil commented 8 years ago

Closing due to inactivity.