Closed PierreR closed 10 years ago
This is a known deficiency in the ghc-wrapper script. Internal packages, i.e. packages that belong to the GHC distribution, don't show up during ghc-pkg list. Nonetheless, these packages do exist and they will be found just fine during compilation.
If this error message concerns you, then you might want to checkout out the ghcWithPackages
function. https://nixos.org/wiki/Haskell#Customized_GHC_environment has some documentation about that.
Ok, thanks. I guess I am now facing #1438, isn't ?
You might, depending on your choice of libraries. You can always use ghcWithLibrariesOld
if you don't care about collisions.
Just asking for an advice here. I am coming from Arch ... I start wondering if it is such a good idea to use the haskellPlatform at all ... If I need the latest versions of many packages (such as attoparsec and such) I guess I can just use a customized GHC environment and specify all needed haskell libraries in ~/.nixpgks/config.nix ?
Yes, exactly. Personally, I use the following setup in my config.nix:
# ~/.nixpkgs/config.nix
let
haskellEnv = haskellPackages: with haskellPackages; [
# Haskell Platform
async attoparsec caseInsensitive cgi fgl GLUT GLURaw haskellSrc
hashable html HTTP HUnit mtl network OpenGL OpenGLRaw parallel
parsec QuickCheck random regexBase regexCompat regexPosix split stm
syb text transformers unorderedContainers vector xhtml zlib
cabalInstall_1_18_0_3 /*alex_3_1_3*/ /*haddock*/ /*happy_1_19_2*/ primitive
# other packages
cmdlib dimensional funcmp hackageDb hlint hoogle HStringTemplate
monadPar pandoc smallcheck tar uulib permutation criterion graphviz
async hspec HList dimensionalTf doctest testFramework monadLoops
testFrameworkHunit wlPprint polyparse uuParsinglib monadPeel
hashtables terminalProgressBar systemFilepath systemFileio arithmoi
modularArithmetic lens ghcPaths dataMemocombinators nats
# tools
BNFC
ghcMod
xmonad xmonadContrib xmonadExtras xmobar
];
in
{
packageOverrides = pkgs:
{
ghcDevEnv = pkgs.haskellPackages.ghcWithPackages haskellEnv;
};
}
I commented a few packages out because to avoid collisions (they were picked up as dependencies from other libraries already and thus ended up being included twice in that list), but it's always possible to fall back to ghcWithLibrariesOld
if this kind of stuff gets too tedious. We should really make our wrapper more intelligent to avoid these kind of issues in the first place, but so far the problems haven't been serious enough to motivate anyone to tackle this.
[with nixos-13.10, stable channel]
If I install the haskell platform for my user profile using:
Then when I try
ghc-pkg check
I have got:I have removed ~/.cabal to be sure there is no interference but without success.