From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Thompson Subject: Re: guix environment Date: Thu, 29 Jan 2015 18:00:23 -0500 Message-ID: <87lhkldwfs.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> References: <87egqpyvov.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGy4g-0002SI-Jo for guix-devel@gnu.org; Thu, 29 Jan 2015 18:00:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGy4f-0000rL-CX for guix-devel@gnu.org; Thu, 29 Jan 2015 18:00:34 -0500 In-Reply-To: <87egqpyvov.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= , Federico Beffa Cc: Guix-devel , bug-guix@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s 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, =E2=80=98derivation->output-path=E2=80=99 considers only the =E2= =80=9Cout=E2=80=9D output, > ignoring others if they are needed. Here's a patch. WDYT? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-guix-environment-Consider-all-package-outputs.patch >From 9609806fb78557d74cf5b3fb47802898ef9d1ecf Mon Sep 17 00:00:00 2001 From: David Thompson 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 (($ 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 --=-=-= Content-Type: text/plain -- David Thompson Web Developer - Free Software Foundation - http://fsf.org GPG Key: 0FF1D807 Support the FSF: https://fsf.org/donate --=-=-=--