[Nix-dev] warning if trying to install a package but it fails an assert.

Andres Loeh andres.loeh at googlemail.com
Wed Dec 17 07:54:35 CET 2008


> I left out setting the svn perl bindings:
>
>  subversion = {
>    perlBindings = true;
>  };
>
> This was tripping this assert in .../git/default.nix:
>
> assert svnSupport -> (subversion != null && perlLibs != [] &&
> subversion.perlBindings);
>
> But there was no warning or message explaining what was going on. It
> would help me a lot next time I run into this if nix gave me a more
> detailed  explanation of what happened. Any chance this could be
> added?

I want to voice my support. Apart from the lacking error
message/warning, which I would like, but for which I don't see an
immediate option, I don't think an assertion as the above is in the
spirit of NixOS. The assertion does some form of dependency
management, but forces that to be dealt with manually by the user. If
you want subversion support, you better enable perl support yourself.
But that's like in classical Linux distributions.

The NixOS way to do this is to say: if we need subversion with perl
support, we better get subversion with perl support. There is no
reason whatsoever why all the functions that build individual packages
should be first order. So in this case, we should pass in a function
for subversion that can still be applied to the desired value of
perlBindings. So, if you say you want git with subversion support, and
you hadn't installed it so far, it will just pull it as a dependency.

Cheers,
  Andres



More information about the nix-dev mailing list