Search code examples
haskellcabalfay

Using Fay in a cabal sandbox


I've just started using both cabal sandboxes and Fay. However, Fay seems unable to find the packages automatically, presumably as they are not in the 'global' cabal package database. I tried unsuccessfully to follow the advice on this wiki page, which to me looked like:

./cabal-sandbox/bin/fay.exe --base-path .cabal-sandbox/i386-windows-ghc-7.6.3/fay-base-0.19/src/ Frontend.hs

But Fay still complains it cannot find package fay-base. Is there something I can do about this, or must I install Fay outside the sandbox?


Solution

  • You don't need to supply the base path, but you need to point it to the correct package config by passing --package-conf or setting the HASKELL_PACKAGE_SANDBOX environment variable.

    For instance:

    ./.cabal-sandbox/bin/fay --package-conf=.cabal-sandbox/x86_64-osx-ghc-7.6.3-packages.conf.d examples/alert.hs
    

    or

    HASKELL_PACKAGE_SANDBOX=./.cabal-sandbox/x86_64-osx-ghc-7.6.3-packages.conf.d ./.cabal-sandbox/bin/fay examples/alert.hs
    

    More information is available at https://github.com/faylang/fay/wiki/Installing-and-running#wiki-sandboxes (I just edited it to make it a bit clearer, and I'll add a link from the other wiki page)