[Nix-dev] Building an old GHC for a new Cabal...

Marc Weber marco-oweber at gmx.de
Wed May 12 21:02:19 CEST 2010


>   I do have GHC 6.10 still installed; but why does it not build
>   against the new GHC?

Because of a design decision Andres Loeh once made:

try cat `which ghc`. You'll see that ghc finds the packages containing
ghc libraries by iterating over $PATH.
So the wrong ghc is found and their libraries are found.

solutions:

keep two different environments:

env -i ghc_6_10_and_libs -p ~/ghc-6.10-env 

env -i ghc_6_12_and_libs -p ~/ghc-6.12-env 

or such.
Then use either

  PATH=$PATH:~/ghc_6_10_and_libs/bin

or

  PATH=$PATH:~/ghc_6_12_and_libs/bin


A more complicated solution is using hack-nix which somewhat tries
automating this for you. However I only patch packages to work with new
ghcs.

HTH
Marc Weber



More information about the nix-dev mailing list