Skip to content

Installation Troubleshooting

simon2e edited this page Dec 10, 2014 · 10 revisions

Cabal build errors

The trickiest part of the installation is building the shared binaries like codex and goc-mod. Although the installer builds them each in their own Cabal sandbox it can run into problems if there are too many packages installed globally. Global packages are shared with sandboxes and affect the Cabal planner.

To see what packages you have installed, run ghc-pkg list. You shouldn't have more than these base packages installed globally:

 Cabal, array, base, bin-package-db, binary, bytestring,

containers, deepseq, directory, filepath, ghc, ghc-prim, haskell2010, haskell98, hoopl, hpc, integer-gmp, old-locale, old-time, pretty, process, rts, template-haskell, time, transformers, unix

If you have others, get rid of them with ghc-pkg unregister.

Stalled installation

If the installation stops while building ghc-mod and uses the CPU but makes no progress then you're probably running it with too little memory. If you're using a virtual machine try bumping the memory to at least two gigabytes for the duration of the installation. If you cannot control the available memory, try creating a swap file as discussed here.

Vim can't infer any types

Vim uses ghc-mod to analyze types in your source files. This relies on your project being built with Cabal's --enable-test flag. You may need to recreate your sandbox and rebuild with this option.

The type highlighting is misplaced

This can happen if your source file uses tab indenting. The ghc-mod helper has its own idea of tab width and reports a specific character range for Vim to highlight. The solution is to either indent with spaces, or adjust your Vim tab width.

OSX Yosemite - "need exuberant ctags", "program 'happy' version >=1.17 is required"

Installing on OSX Yosemite (10.10.1) with XCode 6.1.1 and ghc, cabal-install and vim installed from homebrew had two issues for me, both can be addressed before attempting install. If you're doing a fresh install the haskell-vim-now installer will pull down and build a lot of haskell programs, you'll need to be patient.

Problem 1: the ctags included in XCode lacks exuberance:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ctags: illegal option -- -
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
--- Requires exuberant ctags, not just ctags. Aborting.

Problem 2: cabal can't build haskell-src-exts-1.16.0.1, it's un-happy:

Failed to install haskell-src-exts-1.16.0.1
setup-Simple-Cabal-1.20.0.2-x86_64-osx-ghc-7.8.3: The program 'happy' version >=1.17 is required but it could not be found.

Avoid both issues by pre-installing these items:

$ brew install ctags
 [...]
/usr/local/Cellar/ctags/5.8: 8 files, 364K, built in 16 seconds
$ cabal install happy
 [...]
Installed happy-1.19.4

Then run (or re-run) the install script as per instructions.

Clone this wiki locally