bug-guix
[Top][All Lists]
Advanced

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

bug#22073: Fwd: search-paths and propagated inputs


From: Ludovic Courtès
Subject: bug#22073: Fwd: search-paths and propagated inputs
Date: Sun, 20 Dec 2015 13:56:35 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Thanks for the heads-up, and sorry for the delay!

Federico Beffa <address@hidden> 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’.

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.

reply via email to

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