GNU bug report logs - #22073
Fwd: search-paths and propagated inputs

Previous Next

Package: guix;

Reported by: Federico Beffa <beffa <at> ieee.org>

Date: Wed, 2 Dec 2015 08:19:01 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22073 in the body.
You can then email your comments to 22073 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#22073; Package guix. (Wed, 02 Dec 2015 08:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Federico Beffa <beffa <at> ieee.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 02 Dec 2015 08:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Federico Beffa <beffa <at> ieee.org>
To: bug-guix <at> gnu.org
Subject: Fwd: search-paths and propagated inputs
Date: Wed, 2 Dec 2015 09:18:07 +0100
Federico Beffa <beffa <at> ieee.org> writes:

> Federico Beffa <beffa <at> ieee.org> writes:
>
>> Hi,
>>
>> the package 'gobject-introspection' declares a
>> search-path-specification for the variable GI_TYPELIB_PATH and
>> 'matplotlib' uses and propagates said package. I have 'matplotlib' in
>> my profile, but "guix package --search-paths" doesn't show anything
>> about GI_TYPELIB_PATH.
>>
>> Is it intentional or an oversight that search-path-specifications of
>> propagated-inputs are not considered? Or, am I doing something wrong?
>>
>> Regards,
>> Fede
>
> Bug or feature?

I think it’s a bug.  Right now users of matplotlib have to check the
sources where it says that GI_TYPELIB_PATH must be set.

~~ Ricardo




Information forwarded to bug-guix <at> gnu.org:
bug#22073; Package guix. (Thu, 03 Dec 2015 18:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 22073 <at> debbugs.gnu.org (full text, mbox):

From: Federico Beffa <beffa <at> ieee.org>
To: 22073 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Subject: bug#22073: Fwd: search-paths and propagated inputs
Date: Thu, 3 Dec 2015 19:54:16 +0100
Looking at my manifest file I see that, e.g., the entry for
'python-matplotlib' lists all recursively propagated
dependencies. Differently from this the 'search-paths' entry only lists
the entries defined in the package (in this case none), neglecting the
search paths in the 'propagated-inputs'.

If I understand correctly, this behavior is defined by this function (from
guix/profiles.scm):

(define* (package->manifest-entry package #:optional output)
  "Return a manifest entry for the OUTPUT of package PACKAGE.  When OUTPUT is
omitted or #f, use the first output of PACKAGE."
  (let ((deps (map (match-lambda
                    ((label package)
                     (gexp-input package))
                    ((label package output)
                     (gexp-input package output)))
                   (package-transitive-propagated-inputs package))))
    (manifest-entry
     (name (package-name package))
     (version (package-version package))
     (output (or output (car (package-outputs package))))
     (item package)
     (dependencies (delete-duplicates deps))
     (search-paths (package-native-search-paths package)))))

To get all the required search paths recursively we should replace the
last 'manifest-entry' slot with a call to a function like this:

(define (collect-package-search-paths package)
  (define (collect-search-paths package)
    (let ((propagated-inputs (package-propagated-inputs package))
          (search-paths (package-native-search-paths package)))
      (append search-paths
              (append-map
               (match-lambda
                ((name pkg . rest) (collect-search-paths pkg))
                (_ '()))
               propagated-inputs))))
  (delete-duplicates (collect-search-paths package)))

Or, am I missing how this works?

Regards,
Fede




Information forwarded to bug-guix <at> gnu.org:
bug#22073; Package guix. (Sun, 20 Dec 2015 11:38:02 GMT) Full text and rfc822 format available.

Message #11 received at 22073 <at> debbugs.gnu.org (full text, mbox):

From: Federico Beffa <beffa <at> ieee.org>
To: 22073 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>,
 Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>
Subject: bug#22073: Fwd: search-paths and propagated inputs
Date: Sun, 20 Dec 2015 12:37:49 +0100
Any feedback on this?

Thanks,
Fede




Information forwarded to bug-guix <at> gnu.org:
bug#22073; Package guix. (Sun, 20 Dec 2015 12:58:01 GMT) Full text and rfc822 format available.

Message #14 received at 22073 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Federico Beffa <beffa <at> ieee.org>
Cc: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 22073 <at> debbugs.gnu.org
Subject: Re: bug#22073: Fwd: search-paths and propagated inputs
Date: Sun, 20 Dec 2015 13:56:35 +0100
[Message part 1 (text/plain, inline)]
Thanks for the heads-up, and sorry for the delay!

Federico Beffa <beffa <at> ieee.org> skribis:

> Looking at my manifest file I see that, e.g., the entry for
> 'python-matplotlib' lists all recursively propagated
> dependencies. Differently from this the 'search-paths' entry only lists
> the entries defined in the package (in this case none), neglecting the
> search paths in the 'propagated-inputs'.

That’s a bug, indeed.

> If I understand correctly, this behavior is defined by this function (from
> guix/profiles.scm):
>
> (define* (package->manifest-entry package #:optional output)
>   "Return a manifest entry for the OUTPUT of package PACKAGE.  When OUTPUT is
> omitted or #f, use the first output of PACKAGE."
>   (let ((deps (map (match-lambda
>                     ((label package)
>                      (gexp-input package))
>                     ((label package output)
>                      (gexp-input package output)))
>                    (package-transitive-propagated-inputs package))))
>     (manifest-entry
>      (name (package-name package))
>      (version (package-version package))
>      (output (or output (car (package-outputs package))))
>      (item package)
>      (dependencies (delete-duplicates deps))
>      (search-paths (package-native-search-paths package)))))
>
> To get all the required search paths recursively we should replace the
> last 'manifest-entry' slot with a call to a function like this:

Right.

Here’s a variant of what you propose.  With that, I get:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix package -i python2-matplotlib -p foo

[...]

The following environment variable definitions may be needed:
   export PATH="foo/bin:foo/sbin"
   export PYTHONPATH="foo/lib/python2.7/site-packages"
   export GI_TYPELIB_PATH="foo/lib/girepository-1.0"
   export XDG_DATA_DIRS="foo/share"
   export GIO_EXTRA_MODULES="foo/lib/gio/modules"
--8<---------------cut here---------------end--------------->8---

… which is what we’re expecting, right?

If that’s fine with you, I’ll commit this patch along with test cases.

Thanks!

Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/guix/packages.scm b/guix/packages.scm
index 68fb091..7222337 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -89,6 +89,7 @@
             package-transitive-target-inputs
             package-transitive-native-inputs
             package-transitive-propagated-inputs
+            package-transitive-native-search-paths
             package-transitive-supported-systems
             package-source-derivation
             package-derivation
@@ -632,6 +633,16 @@ for the host system (\"native inputs\"), and not target inputs."
 recursively."
   (transitive-inputs (package-propagated-inputs package)))
 
+(define (package-transitive-native-search-paths package)
+  "Return the list of search paths for PACKAGE and its propagated inputs,
+recursively."
+  (append-map (match-lambda
+                ((label (? package? p) _ ...)
+                 (package-native-search-paths p))
+                (_
+                 '()))
+              (package-transitive-propagated-inputs package)))
+
 (define (transitive-input-references alist inputs)
   "Return a list of (assoc-ref ALIST <label>) for each (<label> <package> . _)
 in INPUTS and their transitive propagated inputs."
diff --git a/guix/profiles.scm b/guix/profiles.scm
index ce6b2c4..ce86ff8 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -176,7 +176,7 @@ omitted or #f, use the first output of PACKAGE."
      (output (or output (car (package-outputs package))))
      (item package)
      (dependencies (delete-duplicates deps))
-     (search-paths (package-native-search-paths package)))))
+     (search-paths (package-transitive-native-search-paths package)))))
 
 (define (packages->manifest packages)
   "Return a list of manifest entries, one for each item listed in PACKAGES.

Information forwarded to bug-guix <at> gnu.org:
bug#22073; Package guix. (Sun, 20 Dec 2015 16:53:01 GMT) Full text and rfc822 format available.

Message #17 received at 22073 <at> debbugs.gnu.org (full text, mbox):

From: Federico Beffa <beffa <at> ieee.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 22073 <at> debbugs.gnu.org
Subject: Re: bug#22073: Fwd: search-paths and propagated inputs
Date: Sun, 20 Dec 2015 17:52:17 +0100
On Sun, Dec 20, 2015 at 1:56 PM, Ludovic Courtès <ludo <at> gnu.org> wrote:
>> To get all the required search paths recursively we should replace the
>> last 'manifest-entry' slot with a call to a function like this:
>
> Right.
>
> Here’s a variant of what you propose.  With that, I get:
>
> --8<---------------cut here---------------start------------->8---
> $ ./pre-inst-env guix package -i python2-matplotlib -p foo
>
> [...]
>
> The following environment variable definitions may be needed:
>    export PATH="foo/bin:foo/sbin"
>    export PYTHONPATH="foo/lib/python2.7/site-packages"
>    export GI_TYPELIB_PATH="foo/lib/girepository-1.0"
>    export XDG_DATA_DIRS="foo/share"
>    export GIO_EXTRA_MODULES="foo/lib/gio/modules"
> --8<---------------cut here---------------end--------------->8---
>
> … which is what we’re expecting, right?

I think so.

>
> If that’s fine with you, I’ll commit this patch along with test cases.

Sure, thanks for that!

Regards,
Fede




Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Sun, 20 Dec 2015 21:36:01 GMT) Full text and rfc822 format available.

Notification sent to Federico Beffa <beffa <at> ieee.org>:
bug acknowledged by developer. (Sun, 20 Dec 2015 21:36:01 GMT) Full text and rfc822 format available.

Message #22 received at 22073-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Federico Beffa <beffa <at> ieee.org>
Cc: Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de>, 22073-done <at> debbugs.gnu.org
Subject: Re: bug#22073: Fwd: search-paths and propagated inputs
Date: Sun, 20 Dec 2015 22:35:09 +0100
Fixed in ccda8f7, thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 18 Jan 2016 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 101 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.