When trying to install Hakyll on GHC 7.6.3 with cabal 1.20.0.0 on Mac OSX 10.9.2 the conduit dependency failed with the following error:

Failed to install conduit-1.1.3

After googling around for a bit I came across this thread on Stackoverflow which lead me to to Manuel’s blog article which explains how to get things working. Basically there are some incompatibilities between Apple’s version of gcc and that used by GHC:

Apple finally dropped the GNU C Compiler (GCC) from its developer tools and only supports the LLVM-based clang compiler. This causes the Glasgow Haskell Compiler (GHC) some grief, mainly due to its use of the C pre-processor (cpp) as a cheap macro system for Haskell.

To overcome this issue you need to do the following:

  1. Download Luke Iannini’s gcc wrapper

  2. Copy it into /usr/local/bin

  3. Make it executable

  4. Edit the GHC settings file found at:

/Library/Frameworks/GHC.framework/Versions/Current/usr/lib/ghc-7.6.3/settings
  1. Change the “C compiler command” to use the wrapper:
("C compiler command", "/usr/local/bin/clang-xcode5-wrapper"),

And you’re done.

You should now be able to install conduit in peace:

cabal install conduit