guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 5/6] guix: Move package-transitive-propagated-labels* and pac


From: Eric Bavier
Subject: Re: [PATCH 5/6] guix: Move package-transitive-propagated-labels* and package-propagated-input-refs to (guix packages).
Date: Tue, 8 Sep 2015 03:31:58 -0500

I find myself needing this functionality while exploring configuration
support in xmonad, so I am (finally) revisiting this patch.

The attached patch, rather than simply moving the two relevant
procedures from (gnu packages version-control), instead replaces them
with a single new procedure, named 'transitive-input-references', in
(guix packages). I think the new procedure addresses the concerns raised
previously.

On Wed, 22 Jul 2015 15:20:11 +0200
address@hidden (Ludovic Courtès) wrote:

> Eric Bavier <address@hidden> skribis:
> 
> > From 6282f668d3cadb9f24f045a0c6992eda9fbe6d5d Mon Sep 17 00:00:00 2001
> > From: Eric Bavier <address@hidden>
> > Date: Tue, 21 Jul 2015 20:45:54 -0500
> > Subject: [PATCH 5/6] guix: Move package-transitive-propagated-labels* and
> >  package-propagated-input-refs to (guix packages).
> >
> > * gnu/packages/version-control.scm (package-transitive-propagated-labels*)
> >   (package-propagated-input-refs): Move from here...
> > * guix/packages.scm: ...to here.
> 
[...]
> 
> > +(define (package-propagated-input-refs inputs packages)
> 
> Should be “references”, not “refs.”

Sure.

> 
> > +  "Return a list of (assoc-ref INPUTS <package-name>) for each package in
> > +PACKAGES and their transitive propagated inputs."
> 
> Maybe mention that this assumes that each input uses the package name as
> the label.

This is not the case with the new transitive-input-references.  Labels
may be arbitrary strings.  This behavior is checked in the new test
case.

> 
> > +  (map (lambda (l)
> > +         `(assoc-ref ,inputs ,l))
> > +       (delete-duplicates               ;XXX: efficiency
> > +        (append-map package-transitive-propagated-labels*
> > +                    packages))))
> 
> The quadratic ‘delete-duplicates’ is going to be a problem sooner or
> later.

The new procedure makes use of 'transitive-inputs' and so benefits from
its optimizations.
 
> Also, could you add one or two tests?

Done.

> 
> I understand this is needed in some cases, but it is not really nice (or
> “really not nice”?).

I would go with "really not nice"

> I would rather avoid propagating the use of these
> constructs,

No pun intended? ;)

> but OTOH, I have nothing better to propose currently.

For Perl, my idea is to wrap each module somehow, so that perl gets the
appropriate 'use lib "/gnu/store/..."' when it loads each module.
Preferably the solution would also work with store deduplication.
I've not yet confirmed this is even feasible, so anyone with more perl
knowledge should chime in.

Our haskell modules install files into a "package.conf.d" subdirectory,
and these files actually keep references to all haskell modules that
were configured in the environment when it was built.  I'm baffled why
GHC does not make use of this information for dependency resolution when
it loads libraries.  Perhaps we could hack our GHC to do so.

`~Eric


Attachment: 0005-guix-packages-Add-transitive-input-references.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]