GHC-mod looking for settings file in wrong directory
Asked Answered
P

1

7

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?

Pettus answered 29/12, 2015 at 6:39 Comment(0)
P
2

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.

Pettus answered 29/12, 2015 at 14:35 Comment(1)
For whoever it might be useful to: I had to additionally remove ~/.cabal — merely reinstalling ghc-mod did not resolve the error (possibly because HomeBrew introduced ghc-7.10.3a and ghc-7.10.3b, which are obviously not official GHC versions).Raptorial

© 2022 - 2024 — McMap. All rights reserved.