Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GHC-mod looking for settings file in wrong directory

I use a number of Haskell plugins in my editor (Neovim), one of which is ghcmod-vim, which works together with syntastic to provide syntax checking as I write Haskell code.

At one point, I had installed GHC for Mac OS X as a temporary workaround for a number of issues in my build system configuration. These issues have since been fixed, so I removed the .app bundle from my /Applications and removed the lines it appended to my ~/.zshrc.

For some reason, even now, when I write a Haskell file and save it to disk, I get an error in Neovim's message buffer:

"myfile.hs" 10L, 163C written
syntastic: error: checker output:
/Applications/ghc-7.8.4.app/Contents/lib/ghc-7.8.4/settings: openFile: does not exist (No such file or directory)
syntastic: error: checker haskell/ghc_mod returned abnormal status 1

The settings file contains a list of key/value pairs with various build environment options which is usually stored alongside the ghc binary, and which exists alongside the ghc binary in my /usr/local/bin, installed using Homebrew.

For some reason, either syntastic or the ghc_mod checker module is looking for the settings file in the wrong place. This is despite the fact that there are no references to this path in any of my Neovim or plugin config files, or in any environment variables.

How can I get ghc_mod or syntastic to look for the GHC settings file in the right place?

like image 580
Jules Avatar asked Dec 29 '15 06:12

Jules


1 Answers

I decided to reinstall ghc-mod using cabal this morning, and this seems to have solved the issue completely!

Other steps taken included running :PlugUpdate, and totally removing and reinstalling the ghcmod-vim and syntastic plugins, although I don't know if these contributed to fixing the issue indirectly - the problem persisted until I ran cabal update and cabal install ghc-mod (which, alone, reinstalled it).

As was kindly pointed out in a comment, the root cause of this issue was the fact that ghc-mod introduced breaking changes after version 5.4.0, which forced the syntastic maintainers to drop support for it.

like image 125
Jules Avatar answered Oct 30 '22 08:10

Jules