From debbugs-submit-bounces@debbugs.gnu.org Sat May 25 15:17:13 2019 Received: (at submit) by debbugs.gnu.org; 25 May 2019 19:17:13 +0000 Received: from localhost ([127.0.0.1]:49660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hUcAK-000891-Nv for submit@debbugs.gnu.org; Sat, 25 May 2019 15:17:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52157) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hUcAH-00088n-Mt for submit@debbugs.gnu.org; Sat, 25 May 2019 15:17:10 -0400 Received: from lists.gnu.org ([209.51.188.17]:49273) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hUcAB-0007pq-QU for submit@debbugs.gnu.org; Sat, 25 May 2019 15:17:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUcA8-0002vB-SW for guix-patches@gnu.org; Sat, 25 May 2019 15:17:03 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hUcA6-0007iB-Tl for guix-patches@gnu.org; Sat, 25 May 2019 15:17:00 -0400 Received: from mx1.mailbox.org ([2001:67c:2050:104:0:1:25:1]:24264) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hUcA5-0007XG-42 for guix-patches@gnu.org; Sat, 25 May 2019 15:16:58 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id E1A364FF6D for ; Sat, 25 May 2019 21:16:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id xvNc7L_6V_Ae for ; Sat, 25 May 2019 21:16:35 +0200 (CEST) From: Robert Vollmert Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: [PATCH] find-package-by-name: reverse package load precedence Message-Id: Date: Sat, 25 May 2019 21:16:34 +0200 To: guix-patches@gnu.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:67c:2050:104:0:1:25:1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit 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: -2.6 (--) =46rom e484a11fa652c6e9cb4484c6f700b91f134e7156 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Sat, 25 May 2019 08:40:38 +0200 Subject: [PATCH] guix: find-package-by-name: list modules in path order A particular effect of this is that if there are ambiguous packages in a directory specified with `-L module_dir` and the distribution, the version from `module_dir` will be loaded, which is usually what would be expected. (E.g. for `guix build` or `guix package -i`.) * guix/discovery.scm (all-modules): Return modules in path order. * tests/guix-package.sh: Test local definitions take precedence. --- guix/discovery.scm | 4 ++-- tests/guix-package.sh | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/guix/discovery.scm b/guix/discovery.scm index ef5ae73973..5bb494941b 100644 --- a/guix/discovery.scm +++ b/guix/discovery.scm @@ -145,8 +145,8 @@ Call (PROC MODULE RESULT) for each module that is = found." "Return the list of package modules found in PATH, a list of = directories to search. Entries in PATH can be directory names (strings) or (DIRECTORY . SUB-DIRECTORY) pairs, in which case modules are searched for beneath -SUB-DIRECTORY." - (fold-modules cons '() path #:warn warn)) +SUB-DIRECTORY. Modules are listed in the order they appear on the = path." + (reverse (fold-modules cons '() path #:warn warn))) =20 (define (fold-module-public-variables* proc init modules) "Call (PROC MODULE SYMBOL VARIABLE) for each variable exported by one = of MODULES, diff --git a/tests/guix-package.sh b/tests/guix-package.sh index 767c3f8a66..79d6ec65e4 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -280,6 +280,20 @@ export GUIX_PACKAGE_PATH guix package -A emacs-foo-bar | grep 42 guix package -i emacs-foo-bar@42 -n =20 +# Make sure GUIX_PACKAGE_PATH/'-L' takes precedence in case of = duplicate packages. +cat > "$module_dir/bar.scm"<&1 | grep choosing.*bar.scm +( unset GUIX_PACKAGE_PATH; \ + guix package -i hello -n -L "$module_dir" 2>&1 | grep = choosing.*bar.scm ) + # Make sure patches that live under $GUIX_PACKAGE_PATH are found. cat > "$module_dir/emacs.patch"<) id 1hV0JY-0005M0-4A for submit@debbugs.gnu.org; Sun, 26 May 2019 17:04:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39463) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hV0JV-0005Ln-UN for 35905-done@debbugs.gnu.org; Sun, 26 May 2019 17:04:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hV0JP-0001jj-PK; Sun, 26 May 2019 17:04:11 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49594 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hV0JL-0003c3-Or; Sun, 26 May 2019 17:04:08 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Robert Vollmert Subject: Re: [bug#35905] [PATCH] find-package-by-name: reverse package load precedence References: Date: Sun, 26 May 2019 23:04:05 +0200 In-Reply-To: (Robert Vollmert's message of "Sat, 25 May 2019 21:16:34 +0200") Message-ID: <87y32tj5bu.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (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-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35905-done Cc: 35905-done@debbugs.gnu.org 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: -3.3 (---) Hi Robert, Robert Vollmert skribis: > From e484a11fa652c6e9cb4484c6f700b91f134e7156 Mon Sep 17 00:00:00 2001 > From: Robert Vollmert > Date: Sat, 25 May 2019 08:40:38 +0200 > Subject: [PATCH] guix: find-package-by-name: list modules in path order > > A particular effect of this is that if there are ambiguous > packages in a directory specified with `-L module_dir` and the > distribution, the version from `module_dir` will be loaded, > which is usually what would be expected. (E.g. for `guix build` > or `guix package -i`.) > > * guix/discovery.scm (all-modules): Return modules in path order. > * tests/guix-package.sh: Test local definitions take precedence. Good catch, applied! (I adjusted the summary line so that it mentions =E2=80=9Cdiscovery=E2=80=9D.) Likewise, in case more than one packages match a given spec, packages of third-party channels would take precedence over those coming from the =E2=80=98guix=E2=80=99 channel, contrary to what was intended. Thanks for fixing it! Ludo=E2=80=99. From unknown Fri Aug 15 18:05:45 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 24 Jun 2019 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator