[Nix-dev] Re: cabal not working well out the box

Peter Simons simons at cryp.to
Fri Dec 24 12:24:42 CET 2010


Hi Paul,

 > If I do `nix-env -i cabal-install` all goes well, but when I try to
 > install a cabal package, for example `cabal install uu-parsinglib` I get
 > an error caused by the utility "ar" being unavailable. If I manually
 > `nix-env -i binutils`, all the problems magically disappear.

from the sound of it, you have discovered a bug in the cabal-install
expression. The build procedure performed by cabal-install requires
'binutils', apparently, but that package isn't listed as a dependency, nor
is it included in $PATH. Consequently, builds performed by cabal-install
fail -- unless if 'binutils' is in $PATH by chance, i.e. because you
manually installed it there.

The proper way to fix this problem would be to create a wrapper around
cabal-install, which ensures that required tools like 'ar' can be found in
the current environment. I'll probably be able to fix this, but it will take
a few days to get it done because I don't have access to a machine with Nix
installed right now.


 > Index: tools/package-management/cabal-install/0.8.0.nix
 > ===================================================================
 > --- tools/package-management/cabal-install/0.8.0.nix    (revision 25247)
 > +++ tools/package-management/cabal-install/0.8.0.nix    (working copy)
 > @@ -1,11 +1,11 @@
 > -{cabal, HTTP, network, zlib} :
 > +{cabal, HTTP, network, zlib, binutils} :
 >
 >  cabal.mkDerivation (self : {
 >    pname = "cabal-install";
 >    name = self.fname;
 >    version = "0.8.0"; # Haskell Platform 2010.1.0.0
 >    sha256 = "6d16618ff454f8d732cad64a53b767b5b6bb95ba4970b260a40e8f467035493c";
 > -  extraBuildInputs = [HTTP network zlib];
 > +  extraBuildInputs = [HTTP network zlib binutils];
 >
 >    meta = {
 >      description = "The command-line interface for Cabal and Hackage";

This patch won't work, unfortunately, because it adds binutils to $PATH at
the time that cabal-install is built, rather than adding it to $PATH at the
time cabal-install is run by the user, which is what would be required.

Take care,
Peter




More information about the nix-dev mailing list