* Re: search-paths and propagated inputs
@ 2015-11-30 16:57 Federico Beffa
2015-11-30 18:58 ` Ricardo Wurmus
2016-03-07 13:35 ` Ludovic Courtès
0 siblings, 2 replies; 11+ messages in thread
From: Federico Beffa @ 2015-11-30 16:57 UTC (permalink / raw)
To: Guix-devel
Federico Beffa <beffa@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?
Regards,
Fede
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: search-paths and propagated inputs 2015-11-30 16:57 search-paths and propagated inputs Federico Beffa @ 2015-11-30 18:58 ` Ricardo Wurmus 2015-12-02 8:18 ` bug#22073: Fwd: " Federico Beffa 2016-03-07 13:35 ` Ludovic Courtès 1 sibling, 1 reply; 11+ messages in thread From: Ricardo Wurmus @ 2015-11-30 18:58 UTC (permalink / raw) To: Federico Beffa; +Cc: Guix-devel Federico Beffa <beffa@ieee.org> writes: > Federico Beffa <beffa@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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#22073: Fwd: search-paths and propagated inputs 2015-11-30 18:58 ` Ricardo Wurmus @ 2015-12-02 8:18 ` Federico Beffa 2015-12-03 18:54 ` Federico Beffa 2015-12-20 11:37 ` Federico Beffa 0 siblings, 2 replies; 11+ messages in thread From: Federico Beffa @ 2015-12-02 8:18 UTC (permalink / raw) To: 22073 Federico Beffa <beffa@ieee.org> writes: > Federico Beffa <beffa@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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#22073: Fwd: search-paths and propagated inputs 2015-12-02 8:18 ` bug#22073: Fwd: " Federico Beffa @ 2015-12-03 18:54 ` Federico Beffa 2015-12-20 12:56 ` Ludovic Courtès 2015-12-20 11:37 ` Federico Beffa 1 sibling, 1 reply; 11+ messages in thread From: Federico Beffa @ 2015-12-03 18:54 UTC (permalink / raw) To: 22073 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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#22073: Fwd: search-paths and propagated inputs 2015-12-03 18:54 ` Federico Beffa @ 2015-12-20 12:56 ` Ludovic Courtès 2015-12-20 16:52 ` Federico Beffa 0 siblings, 1 reply; 11+ messages in thread From: Ludovic Courtès @ 2015-12-20 12:56 UTC (permalink / raw) To: Federico Beffa; +Cc: 22073 [-- Attachment #1: Type: text/plain, Size: 2204 bytes --] Thanks for the heads-up, and sorry for the delay! Federico Beffa <beffa@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’. [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: Type: text/x-patch, Size: 1771 bytes --] 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. ^ permalink raw reply related [flat|nested] 11+ messages in thread
* bug#22073: Fwd: search-paths and propagated inputs 2015-12-20 12:56 ` Ludovic Courtès @ 2015-12-20 16:52 ` Federico Beffa 2015-12-20 21:35 ` Ludovic Courtès 0 siblings, 1 reply; 11+ messages in thread From: Federico Beffa @ 2015-12-20 16:52 UTC (permalink / raw) To: Ludovic Courtès; +Cc: 22073 On Sun, Dec 20, 2015 at 1:56 PM, Ludovic Courtès <ludo@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 ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#22073: Fwd: search-paths and propagated inputs 2015-12-20 16:52 ` Federico Beffa @ 2015-12-20 21:35 ` Ludovic Courtès 0 siblings, 0 replies; 11+ messages in thread From: Ludovic Courtès @ 2015-12-20 21:35 UTC (permalink / raw) To: Federico Beffa; +Cc: 22073-done Fixed in ccda8f7, thanks! Ludo’. ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#22073: Fwd: search-paths and propagated inputs 2015-12-02 8:18 ` bug#22073: Fwd: " Federico Beffa 2015-12-03 18:54 ` Federico Beffa @ 2015-12-20 11:37 ` Federico Beffa 1 sibling, 0 replies; 11+ messages in thread From: Federico Beffa @ 2015-12-20 11:37 UTC (permalink / raw) To: 22073 Any feedback on this? Thanks, Fede ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: search-paths and propagated inputs 2015-11-30 16:57 search-paths and propagated inputs Federico Beffa 2015-11-30 18:58 ` Ricardo Wurmus @ 2016-03-07 13:35 ` Ludovic Courtès 2016-03-07 20:03 ` Federico Beffa 1 sibling, 1 reply; 11+ messages in thread From: Ludovic Courtès @ 2016-03-07 13:35 UTC (permalink / raw) To: Federico Beffa; +Cc: Guix-devel Federico Beffa <beffa@ieee.org> skribis: > Federico Beffa <beffa@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? Sorry to reply to a months-old message… and thanks for waiting. :-) What you describe above would be a bug, but it seems there’s no longer any such bug: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,m (gnu packages python) scheme@(gnu packages python)> (package-search-paths python-matplotlib) $2 = () scheme@(gnu packages python)> (package-transitive-native-search-paths python-matplotlib) $3 = (#<<search-path-specification> variable: "GI_TYPELIB_PATH" files: ("lib/girepository-1.0") separator: ":" file-type: directory file-pattern: #f> #<<search-path-specification> variable: "PYTHONPATH" files: ("lib/python3.4/site-packages") separator: ":" file-type: directory file-pattern: #f> #<<search-path-specification> variable: "GUIX_GTK3_PATH" files: ("lib/gtk-3.0") separator: ":" file-type: directory file-pattern: #f> #<<search-path-specification> variable: "XDG_DATA_DIRS" files: ("share") separator: ":" file-type: directory file-pattern: #f> #<<search-path-specification> variable: "GIO_EXTRA_MODULES" files: ("lib/gio/modules") separator: ":" file-type: directory file-pattern: #f>) --8<---------------cut here---------------end--------------->8--- Could you confirm? Ludo’. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: search-paths and propagated inputs 2016-03-07 13:35 ` Ludovic Courtès @ 2016-03-07 20:03 ` Federico Beffa 2016-03-07 21:06 ` Ludovic Courtès 0 siblings, 1 reply; 11+ messages in thread From: Federico Beffa @ 2016-03-07 20:03 UTC (permalink / raw) To: Ludovic Courtès; +Cc: Guix-devel On Mon, Mar 7, 2016 at 2:35 PM, Ludovic Courtès <ludo@gnu.org> wrote: [...] > Could you confirm? We fixed that a while back :-) http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22073 Regards, Fede ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: search-paths and propagated inputs 2016-03-07 20:03 ` Federico Beffa @ 2016-03-07 21:06 ` Ludovic Courtès 0 siblings, 0 replies; 11+ messages in thread From: Ludovic Courtès @ 2016-03-07 21:06 UTC (permalink / raw) To: Federico Beffa; +Cc: Guix-devel Federico Beffa <beffa@ieee.org> skribis: > On Mon, Mar 7, 2016 at 2:35 PM, Ludovic Courtès <ludo@gnu.org> wrote: > > [...] > >> Could you confirm? > > We fixed that a while back :-) > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22073 Excellent non-news. :-) My inbox is a mess! Cheers, Ludo’. ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2016-03-07 21:06 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-11-30 16:57 search-paths and propagated inputs Federico Beffa 2015-11-30 18:58 ` Ricardo Wurmus 2015-12-02 8:18 ` bug#22073: Fwd: " Federico Beffa 2015-12-03 18:54 ` Federico Beffa 2015-12-20 12:56 ` Ludovic Courtès 2015-12-20 16:52 ` Federico Beffa 2015-12-20 21:35 ` Ludovic Courtès 2015-12-20 11:37 ` Federico Beffa 2016-03-07 13:35 ` Ludovic Courtès 2016-03-07 20:03 ` Federico Beffa 2016-03-07 21:06 ` Ludovic Courtès
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/guix.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.