Hi Dennis,

The problem here is that `haddock` can't guess where it should find the
packages (all packages are in /nix/store/<somehash>-...). GHC only works
because the nix cabal builder takes special care to use a wrapped GHC that
also looks in PATH (replacing /bin with /lib/ghc-$ver/, which is kind of a
hack IMO) for packages. But haddock isn't wrapped, so it doesn't find the
packages.

The solution is to set the GHC_PACKAGE_PATH environment variable to point
to the packages. The nix cabal builder does that at the end of the build
phase. So, if you do

    $ eval "$configurePhase"  # The nix cabal builder has it's own
configure phase, which doesn't use cabal-install but only Cabal
    $ eval "$buildPhase"

then haddock should work after that, because eval "$buildPhase" will set
GHC_PACKAGE_PATH. The only problem with that is that you can't use `cabal
configure` anymore, since cabal doesn't support GHC_PACKAGE_PATH. So if you
ever need to run `cabal configure` again, you have to unset that
environment variable again and re-run the above steps.

Benno

John Wiegley <[email protected]> schrieb am Tue Dec 02 2014 at 18:09:26:

>>>>> cdep illabout@gmail com <[email protected]> writes:
>
> > I posted the following question on Stackoverflow, but I received no
> > responses, so I thought this list might be more appropriate.
>
> Btw, I've been using the following two scripts to great success in my
> local haskell work:
>
>
> They will each create the necessary files if they are missing, and then do
> what you expect to be done.
>
> John
> _______________________________________________
> nix-dev mailing list
> [email protected]
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to