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

openFile: does not exist (No such file or directory) #45

Closed patrickbrown-dev closed 8 years ago

patrickbrown-dev commented 9 years ago

I get endless stack traces of:

Haskell-ghc-mod: /Users/ptrckbrwn/.local/bin/ghc-mod check /Users/ptrckbrwn/git/github.com/ptrckbrwn/weblog/site.hs failed with error code 1
/Applications/ghc-7.8.4.app/Contents/lib/ghc-7.8.4/settings: openFile: does not exist (No such file or directory)

It's absolutely correct, I do not have ghc installed at /Applications/ghc-7.8.4.app. Is atom-haskell/hakell-ghc-mod compatible with ghc installed in other locations?

For example:

$ which ghc-mod
/Users/ptrckbrwn/.local/bin/ghc-mod

image

lierdakil commented 9 years ago

Path to ghc is kinda baked-in into ghc-mod at the time of compilation, I believe. It should be possible to set ghc path by hand with --with-ghc=/path/to/ghc option passed to ghc-mod. Since at the moment there is no way to specify additional options for ghc-mod, I'd ask you to try the following:

create a shell script along the lines of

#!/path/to/bash

/Users/ptrckbrwn/.local/bin/ghc-mod --with-ghc=/path/to/ghc "$@"

And don't forget to set it as executable (chmod +x script.sh).

Then pass path to it as "Ghc Mod Path", and disable "Enable Ghc Modi" option for simplicity for now.

If it works, I could certainly add an option for different GHC path.

If it doesn't, your other option would be to build ghc-mod from source (cabal install ghc-mod is usually enough, although there are some caveats, and using a cabal sandbox might be a better option)

Thanks.

patrickbrown-dev commented 9 years ago

Ah! You're right! It is a problem with my installed ghc-mod. Strange that It's configured to look for /Applications/ghc-7.8.4.app as I installed it with cabal.

But regardless, not a problem with atom-haskell/haskell-ghc-mod at all :)

nrolland commented 8 years ago

"Path to ghc is kinda baked-in into ghc-mod at the time of compilation, I believe"

jesus...