[Nix-dev] Guarantee Consistent Builds and Obsolete overrideScope

Felipe Lessa felipe.lessa at gmail.com
Fri Oct 16 17:55:10 CEST 2015


Em 15-10-2015 15:52, Peter Simons escreveu:
> Possible Improvements
> ---------------------
> 
> We generate Haskell build expressions automatically with cabal2nix, and
> that tool knows the complete dependency tree for every package. So it
> would be possible to generate builds that expect as function arguments
> not just their immediate dependencies but the transitive closure of all
> dependencies. Build expressions would then call their direct
> dependencies, passing in appropriate versions of their respective
> dependencies, etc. For example:
> 
>     "foobar" = callPackage
>         ({ mkDerivation, foo, bar, many, other, inputs, of, lens }:
>         let lens' = lens.override { inherit many other inputs of lens; };
>             foo'  = foo.override { lens = lens'; };
>             bar'  = bar.override { lens = lens'; };
>         in
>         mkDerivation {
>           pname = "foobar"; [...]
>           libraryHaskellDepends = [foo' bar'];
>         }) {};
> 
> Now, foobar expects every single package that occurs anywhere inside of
> its dependency tree as an argument, and it constructs the dependency
> tree using those arguments. So the build must be consistent. It's
> impossible for foobar to refer to two incompatible versions of lens,
> because its inputs always use the same version.

From a newbie that doesn't really understand the implications of each
option, it seems to me that this improvement is a good one.  Not being
able to break builds is nice!

However, in the future it may be possible for one to use two versions of
the same package at the same time using Backpack.  Should this catch on,
the non-breakable improvement will become a bit inflexible in some cases.

Cheers,

-- 
Felipe.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20151016/e390da27/attachment.bin 


More information about the nix-dev mailing list