all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Thompson <dthompson2@worcester.edu>
To: "Ludovic Courtès" <ludo@gnu.org>, "Federico Beffa" <beffa@ieee.org>
Cc: Guix-devel <guix-devel@gnu.org>, bug-guix@gnu.org
Subject: Re: guix environment
Date: Thu, 29 Jan 2015 18:00:23 -0500	[thread overview]
Message-ID: <87lhkldwfs.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <87egqpyvov.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 970 bytes --]

Ludovic Courtès <ludo@gnu.org> writes:

> On closer inspection, I see two issues:
>
>   (define (packages->transitive-inputs packages)
>     "Return a list of the transitive inputs for all PACKAGES."
>     (define (transitive-inputs package)
>       (filter-map (match-lambda
>                    ((_ (? package? package)) package)
>                    (_ #f))    ; <---- !
>                   (bag-transitive-inputs
>                    (package->bag package))))
>     (delete-duplicates
>      (append-map transitive-inputs packages)))
>
> Here only inputs of the form ("foo" PKG) are considered; things like
> ("glib" ,glib "bin") are discarded.
>
>   (define (for-each-search-path proc inputs derivations pure?)
>     (let ((paths (map derivation->output-path derivations))) ; <-- !
>       [...]
>
> Above, ‘derivation->output-path’ considers only the “out” output,
> ignoring others if they are needed.

Here's a patch.  WDYT?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-guix-environment-Consider-all-package-outputs.patch --]
[-- Type: text/x-diff, Size: 1848 bytes --]

From 9609806fb78557d74cf5b3fb47802898ef9d1ecf Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
Date: Thu, 29 Jan 2015 17:53:17 -0500
Subject: [PATCH] guix: environment: Consider all package outputs.

* guix/scripts/environment.scm (for-each-search-path): Iterate over all
  derivation output paths.
  (packages->transitive-inputs): Process inputs that specify an output, too.
---
 guix/scripts/environment.scm | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index ffa3a09..bb2ce53 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -40,7 +40,12 @@
 Use the output paths of DERIVATIONS to build each search path.  When PURE? is
 #t, the existing search path value is ignored.  Otherwise, the existing search
 path value is appended."
-  (let ((paths (map derivation->output-path derivations)))
+  (let ((paths (append-map (lambda (drv)
+                             (map (match-lambda
+                                   ((_ . output)
+                                    (derivation-output-path output)))
+                                  (derivation-outputs drv)))
+                           derivations)))
     (for-each (match-lambda
                (($ <search-path-specification>
                    variable directories separator)
@@ -177,7 +182,9 @@ packages."
   "Return a list of the transitive inputs for all PACKAGES."
   (define (transitive-inputs package)
     (filter-map (match-lambda
-                 ((_ (? package? package)) package)
+                 ((or (_ (? package? package))
+                      (_ (? package? package) _))
+                  package)
                  (_ #f))
                 (bag-transitive-inputs
                  (package->bag package))))
-- 
2.1.4


[-- Attachment #3: Type: text/plain, Size: 136 bytes --]


-- 
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate

  parent reply	other threads:[~2015-01-29 23:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20 17:21 guix environment Federico Beffa
2015-01-20 21:43 ` Ludovic Courtès
2015-01-20 21:56   ` David Thompson
2015-01-29 23:00   ` David Thompson [this message]
2015-02-03 20:29     ` Ludovic Courtès
2015-02-03 21:15       ` David Thompson
2015-02-08 18:22       ` bug#19641: " Ludovic Courtès
2015-02-08 18:22       ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2015-06-15  6:55 Pjotr Prins
2015-06-15  7:14 ` Ricardo Wurmus
2015-06-15 13:10 ` Thompson, David
2015-06-15 19:10   ` Pjotr Prins
2015-06-15 19:22     ` Thompson, David
2015-06-16  5:52       ` Pjotr Prins
2015-06-16  7:59         ` Ludovic Courtès
2015-06-16 10:04           ` Pjotr Prins
2015-06-16 11:23             ` Ludovic Courtès
2015-06-16 14:39               ` Pjotr Prins
2015-06-15 13:27 ` Claes Wallin (韋嘉誠)
2015-06-15 20:09   ` Ludovic Courtès
2015-06-16  5:06     ` Claes Wallin (韋嘉誠)
2019-06-01 16:53 H.Nasajpour<PantherX>
2019-06-01 18:42 ` Christopher Baines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lhkldwfs.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me \
    --to=dthompson2@worcester.edu \
    --cc=beffa@ieee.org \
    --cc=bug-guix@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.