[Nix-dev] extending release-lib and how to cache in nix

Florian Friesdorf flo at chaoflow.net
Tue Jul 24 16:52:52 CEST 2012


Hi Eelco,

On Tue, 24 Jul 2012 10:16:30 -0400, Eelco Dolstra <eelco.dolstra at logicblox.com> wrote:
> Hi,
> 
> On 24/07/12 10:09, Florian Friesdorf wrote:
> 
> > - condPackagesWithMetaPlatform supports a list of valid platforms which
> >   is intersected with a package's meta.platforms
> > 
> > - condPackagesWithMetaPlatform supports a filter predicate
> > 
> > - packagesWithMetaPlatform is based on condPackagesWithMetaPlatform and
> >   shows the original behaviour
> 
> What's the purpose of these functions?

packagesWithMetaPlatform is used in release.nix to get all packages for
hydra that define a meta.platforms.

condPackagesWithMetaPlatform does the same + filtering packages further
+ limit platforms
 
> > - dependsOn predicate recursively scans a package's *Inputs against a
> >   list of dependencies
> 
> This sounds like an inherently slow thing to do.  Why is it needed?

To avoid manually creating and mainting a list of all packages that
somehow use python. It's an experiment: if we can't get it reasonably
fast it is not an option. We want to limit the python-rework jobset to
only packages depending on python so we can see what is broken because
of python. Currently we have 1181 broken packages in python-rework of
which the majority (probably 95%) are not broken because of python.

> > @Eelco: You said on IRC that nix used to cache function calls with
> > identical arguments. 
> 
> It had a evaluation cache that mapped expressions (including function calls) to
> their normal form.  However, this uses a large amount of memory and prevents
> garbage collection.

Could this be an opt-in for specially decorated functions? Hmm. A
generic caching function that calculates a cache key from the wrapped
functions arguments and caches results?

cachedFunc = cached (func: a: b: c: ...)

regards
florian
-- 
Florian Friesdorf <flo at chaoflow.net>
  GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: flo at chaoflow.net
IRC: chaoflow on freenode,ircnet,blafasel,OFTC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20120724/17bb19fc/attachment.bin 


More information about the nix-dev mailing list