From unknown Fri Jun 13 11:51:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22138: Search paths of dependencies are not honored Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 10 Dec 2015 09:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22138 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 22138@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.144974018317402 (code B ref -1); Thu, 10 Dec 2015 09:37:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Dec 2015 09:36:23 +0000 Received: from localhost ([127.0.0.1]:38609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a6xeA-0004Wb-PK for submit@debbugs.gnu.org; Thu, 10 Dec 2015 04:36:22 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49949) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1a6xe9-0004WO-12 for submit@debbugs.gnu.org; Thu, 10 Dec 2015 04:36:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6xe3-0002e4-6h for submit@debbugs.gnu.org; Thu, 10 Dec 2015 04:36:15 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:60937) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6xe3-0002e0-42 for submit@debbugs.gnu.org; Thu, 10 Dec 2015 04:36:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6xe2-0003Jd-Bd for bug-guix@gnu.org; Thu, 10 Dec 2015 04:36:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6xdy-0002cb-ED for bug-guix@gnu.org; Thu, 10 Dec 2015 04:36:14 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6xdy-0002cW-B7 for bug-guix@gnu.org; Thu, 10 Dec 2015 04:36:10 -0500 Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:36476 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1a6xdx-0002pi-Pv for bug-guix@gnu.org; Thu, 10 Dec 2015 04:36:10 -0500 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 Frimaire an 224 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x3D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Thu, 10 Dec 2015 10:36:08 +0100 Message-ID: <87bn9yk5mf.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.6 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.6 (-----) As of 0.9.0+, only the search paths of packages explicitly in the profile are shown by =E2=80=98--search-paths=E2=80=99 and similar. This is= a problem for libraries that have associated environment variables. For instance, if one installs an application linked against OpenSSL, they will not know about =E2=80=98SSL_CERT_DIR=E2=80=99 and =E2=80=98SSL_CE= RT_FILE=E2=80=99. Similarly for GStreamer and =E2=80=98GST_PLUGIN_PATH=E2=80=99, libc and =E2=80=98GUIX= _LOCPATH=E2=80=99, and so on. Fixing it seems tricky. We could pass the profile builder the closure=E2= =80=99s graph (via #:references-graph) and the the set of search paths of all the direct and indirect dependencies of the profile. The builder would then need to somehow determine the subset of these search paths that is actually useful, and use it to build the search path spec in the manifest as well as etc/profile. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 26 09:18:39 2017 Received: (at control) by debbugs.gnu.org; 26 Mar 2017 13:18:39 +0000 Received: from localhost ([127.0.0.1]:45120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cs847-0006b0-C2 for submit@debbugs.gnu.org; Sun, 26 Mar 2017 09:18:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cs845-0006am-4S for control@debbugs.gnu.org; Sun, 26 Mar 2017 09:18:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cs83u-0000us-Rc for control@debbugs.gnu.org; Sun, 26 Mar 2017 09:18:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cs83u-0000uo-OT for control@debbugs.gnu.org; Sun, 26 Mar 2017 09:18:26 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:35044 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cs83u-0001cB-55 for control@debbugs.gnu.org; Sun, 26 Mar 2017 09:18:26 -0400 Date: Sun, 26 Mar 2017 15:18:24 +0200 Message-Id: <87shm0rxb3.fsf@gnu.org> To: control@debbugs.gnu.org From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: control message for bug #22138 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) severity 22138 important From unknown Fri Jun 13 11:51:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22138: Search paths of dependencies are not honored References: <87bn9yk5mf.fsf@gnu.org> In-Reply-To: <87bn9yk5mf.fsf@gnu.org> Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 01 Aug 2019 20:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22138 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 22138@debbugs.gnu.org Received: via spool by 22138-submit@debbugs.gnu.org id=B22138.156469034430562 (code B ref 22138); Thu, 01 Aug 2019 20:13:01 +0000 Received: (at 22138) by debbugs.gnu.org; 1 Aug 2019 20:12:24 +0000 Received: from localhost ([127.0.0.1]:55406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1htHR2-0007wr-0o for submit@debbugs.gnu.org; Thu, 01 Aug 2019 16:12:24 -0400 Received: from lepiller.eu ([89.234.186.109]:35742) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1htHQz-0007we-JJ for 22138@debbugs.gnu.org; Thu, 01 Aug 2019 16:12:22 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 29eb82a8 for <22138@debbugs.gnu.org>; Thu, 1 Aug 2019 20:12:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lepiller.eu; h=date:from :to:subject:message-id:mime-version:content-type; s=dkim; bh=pnd zzYMka2zr8cQ4jlNihuwiRrA=; b=kiL/y7FsCMQrqFEl4Jgx8Vuy+J5r3InjKzO e3+dZIrMPIgkZG9zRLSDfh0CMU42o6HWue2MiK8vZaF3mJL/71xIohnqwXJNY3+l 36CSPkzA4yXxU2/l3cSYDy7VBu4a41royL+ag8g1fjP+mxNwB8mPyqzXT3CqoJk1 4lKq0VLupf9o7IfXGQ671E8Qx+BraPN0litchZGtVeJ9vpsIy81qiRqEq70w4aB1 Co815W2GQg/Np/IMpsM37XJvfgYE37QwjrP/qffUC16GL9YDLmTYqyqQXP6uyFUi JRr255h6KqyTpG9P4swk22JU/U2OsWi/2ZHDnV8aDqGaf/eW0Kg== DomainKey-Signature: a=rsa-sha1; c=nofws; d=lepiller.eu; h=date:from:to :subject:message-id:mime-version:content-type; q=dns; s=dkim; b= kUrtrHA+Tlp1M1NxnQauMoh1ofEW+k+etr0bAUAFeUSyfq1hCJC5+h53Dk2PAiik gJFxME9MkMCqa8De1iONyZ5zlB7lXoHWEUv1pds91O3GlHkddEvnE6JG/yqkRcc4 lLos34QHJv5lCBlgKPKr+QiH/xBGsmrVV2eYv5NozGhCCJ9sMLfz9P9b9BkcaPoX Z9UNTMCnqOQ8mYa3Vh9bhMP4iuIXbZmLqvECgTS/M/1Rqy4zMfITKYG+LuYqiyf2 zM6steVksE6L3u3XehNyJidiO5CaOtBMvfWGvFjkuBzzv+78OavGmig7q9XFMREn pdlOXLyceQzkMf/z4SPcnQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id a64bdbcb (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <22138@debbugs.gnu.org>; Thu, 1 Aug 2019 20:12:16 +0000 (UTC) Date: Thu, 1 Aug 2019 22:12:06 +0200 From: Julien Lepiller Message-ID: <20190801221206.17965136@sybil.lepiller.eu> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/P7b3w4QD0RSr.lNrEvJblE1" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --MP_/P7b3w4QD0RSr.lNrEvJblE1 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I've been looking at our current code and would like to propose the attached patch for that issue. --MP_/P7b3w4QD0RSr.lNrEvJblE1 Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-guix-Recursively-honor-search-paths-of-dependencies.patch >From cfd2c229087166ab4cc0a9e2bdb72c8b393bcdd5 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 1 Aug 2019 22:09:38 +0200 Subject: [PATCH] guix: Recursively honor search paths of dependencies. * guix/packages.scm (all-transitive-inputs) (package-all-transitive-inputs) (package-all-transitive-native-search-paths): New procedures. * guix/profiles.scm (package->manifest-entry): Use package-all-transitive-native-search-paths to generate manifest search paths. --- guix/packages.scm | 53 +++++++++++++++++++++++++++++++++++++++++++++++ guix/profiles.scm | 2 +- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/guix/packages.scm b/guix/packages.scm index c94a651f27..f9095759f1 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -101,6 +101,7 @@ package-transitive-propagated-inputs package-transitive-native-search-paths package-transitive-supported-systems + package-all-transitive-native-search-paths package-mapping package-input-rewriting package-input-rewriting/spec @@ -686,6 +687,42 @@ preserved, and only duplicate propagated inputs are removed." ((input rest ...) (loop rest (cons input result) propagated first? seen))))) +(define (all-transitive-inputs inputs) + "Return the closure of INPUTS when considering the 'propagated-inputs', +'inputs' and 'native-inputs' edges. Omit duplicate inputs, except for +those already present in INPUTS itself. + +This is implemented as a breadth-first traversal such that INPUTS is +preserved, and only duplicate propagated inputs are removed." + (define (seen? seen item outputs) + ;; FIXME: We're using pointer identity here, which is extremely sensitive + ;; to memoization in package-producing procedures; see + ;; . + (match (vhash-assq item seen) + ((_ . o) (equal? o outputs)) + (_ #f))) + + (let loop ((inputs inputs) + (result '()) + (transitive '()) + (first? #t) + (seen vlist-null)) + (match inputs + (() + (if (null? transitive) + (reverse result) + (loop (reverse (concatenate transitive)) result '() #f seen))) + (((and input (label (? package? package) outputs ...)) rest ...) + (if (and (not first?) (seen? seen package outputs)) + (loop rest result transitive first? seen) + (loop rest + (cons input result) + (cons (package-direct-inputs package) transitive) + first? + (vhash-consq package outputs seen)))) + ((input rest ...) + (loop rest (cons input result) transitive first? seen))))) + (define (package-direct-sources package) "Return all source origins associated with PACKAGE; including origins in PACKAGE's inputs." @@ -720,6 +757,11 @@ with their propagated inputs." with their propagated inputs, recursively." (transitive-inputs (package-direct-inputs package))) +(define (package-all-transitive-inputs package) + "Return the transitive inputs of PACKAGE---i.e., its direct inputs along +with their propagated inputs, recursively." + (all-transitive-inputs (package-direct-inputs package))) + (define (package-transitive-target-inputs package) "Return the transitive target inputs of PACKAGE---i.e., its direct inputs along with their propagated inputs, recursively. This only includes inputs @@ -749,6 +791,17 @@ recursively." '())) (package-transitive-propagated-inputs package)))) +(define (package-all-transitive-native-search-paths package) + "Return the list of search paths for PACKAGE and its propagated inputs, +recursively." + (append (package-native-search-paths package) + (append-map (match-lambda + ((label (? package? p) _ ...) + (package-native-search-paths p)) + (_ + '())) + (package-all-transitive-inputs package)))) + (define (transitive-input-references alist inputs) "Return a list of (assoc-ref ALIST