From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 01 09:53:11 2024 Received: (at submit) by debbugs.gnu.org; 1 Dec 2024 14:53:12 +0000 Received: from localhost ([127.0.0.1]:50819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHlJv-0005Py-FL for submit@debbugs.gnu.org; Sun, 01 Dec 2024 09:53:11 -0500 Received: from lists.gnu.org ([209.51.188.17]:49714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHlJt-0005Pr-RH for submit@debbugs.gnu.org; Sun, 01 Dec 2024 09:53:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tHlJt-0007Qy-Eq for guix-patches@gnu.org; Sun, 01 Dec 2024 09:53:09 -0500 Received: from [75.171.110.13] (helo=mail.kubisiak.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tHlJr-0008S9-KO for guix-patches@gnu.org; Sun, 01 Dec 2024 09:53:09 -0500 dkim-signature: v=1; a=rsa-sha256; d=kubisiak.com; s=s1; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:MIME-Version:Content-Type; bh=nrO2vr/Pk5PuR7Kjx3xqqcaJLkGHlwfbG8PtNeOprIU=; b=HbnQkUjCELP/q+pPQOpqyPxe7MrYt2Oka7xD5wOJQQv5I6VTmqt3Maq9VyrXcUdnTfDVc5lyYZBx6cm0ntJsUaP6IC5x0fKHBnjNu3RCu5WL30jD77AQqbCgnJx9XkQACtwa8pVu/lCc+YZczj1UA/4XnTFDNNgH6Lpq0QpcY2DGE5+bKzRvZZxmjvoGvQuRKkbMvk4TypPAlPQXhMsL6plg2cyQSCU1wKgxXb4YOEBnaotaDDrNXPlnNo pBnj4DmaWWDB992fPVA9lzVZ49suI77wWKRLXSZLxS7Ke81MD+kOuTyg5RiCjKGuIsHf/6+g/CW2WMxjeAVWmEdZoIwg== Received: from peregrine (135-180-130-213.dsl.dynamic.sonic.net [135.180.130.213]) (envelope-sender ) by mail.kubisiak.com with ESMTPSA id <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> for (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256) ; Sun, 1 Dec 2024 08:53:04 -0600 Date: Sun, 1 Dec 2024 06:53:03 -0800 From: Brian Kubisiak To: guix-patches@gnu.org Subject: [PATCH] ui: Search channels for guix extensions Message-ID: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Host-Lookup-Failed: Reverse DNS lookup failed for 75.171.110.13 (failed) Received-SPF: pass client-ip=75.171.110.13; envelope-from=brian@kubisiak.com; helo=mail.kubisiak.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) 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.4 (--) * guix/describe.scm (add-channels-to-load-path!): New function. * gnu/packages.scm (%package-module-path): Call new function. Remove the code that the function call replaces. * guix/ui.scm (extension-directories): Call new function. Search channels for guix extensions. * guix/self.scm (compiled-guix)[*core-modules*]: Add 'guile-git' to the list of extensions. Change-Id: I53af828dc554485ca28389c9e2653ea6b4fb6b7e --- gnu/packages.scm | 7 ++++--- guix/describe.scm | 13 +++++++++++++ guix/self.scm | 1 + guix/ui.scm | 13 ++++++++++--- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/gnu/packages.scm b/gnu/packages.scm index 80c22d1d7f..05b8bf8e6d 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -147,15 +147,16 @@ (define %package-module-path (let* ((not-colon (char-set-complement (char-set #\:))) (environment (string-tokenize (or (getenv "GUIX_PACKAGE_PATH") "") not-colon)) - (channels-scm channels-go (package-path-entries))) + (channels-scm (package-path-entries))) ;; Automatically add channels and items from $GUIX_PACKAGE_PATH to Guile's ;; search path. For historical reasons, $GUIX_PACKAGE_PATH goes to the ;; front; channels go to the back so that they don't override Guix' own ;; modules. + (add-channels-to-load-path!) (set! %load-path - (append environment %load-path channels-scm)) + (append environment %load-path)) (set! %load-compiled-path - (append environment %load-compiled-path channels-go)) + (append environment %load-compiled-path)) (make-parameter (append environment diff --git a/guix/describe.scm b/guix/describe.scm index a4ca2462f4..3bbda15db5 100644 --- a/guix/describe.scm +++ b/guix/describe.scm @@ -27,6 +27,7 @@ (define-module (guix describe) sexp->channel manifest-entry-channel) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) #:use-module (srfi srfi-34) #:use-module (ice-9 match) #:export (current-profile @@ -34,6 +35,7 @@ (define-module (guix describe) current-profile-entries current-channels package-path-entries + add-channels-to-load-path! package-provenance package-channels @@ -190,6 +192,17 @@ (define (package-path-entries) "/site-ccache"))) (current-channel-entries)))) +(define add-channels-to-load-path! + (let ((promise + (delay + (let-values (((channels-scm channels-go) (package-path-entries))) + (set! %load-path + (append %load-path channels-scm)) + (set! %load-compiled-path + (append %load-compiled-path channels-go)))))) + (lambda () + (force promise)))) + (define (package-channels package) "Return the list of channels providing PACKAGE or an empty list if it could not be determined." diff --git a/guix/self.scm b/guix/self.scm index 2652688c71..28239d53f5 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -882,6 +882,7 @@ (define* (compiled-guix source #:key ,(local-file "../guix/store/schema.sql"))) #:extensions (list guile-gcrypt + guile-git ;for (guix git) guile-json) ;for (guix swh) #:guile-for-build guile-for-build)) diff --git a/guix/ui.scm b/guix/ui.scm index eba12c8616..28690b22bc 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -38,6 +38,7 @@ (define-module (guix ui) ;import in user interfaces only #:use-module (guix i18n) #:use-module (guix colors) + #:use-module (guix describe) #:use-module (guix diagnostics) #:use-module (guix gexp) #:use-module (guix sets) @@ -2192,9 +2193,15 @@ (define* (command-files #:optional directory) (define (extension-directories) "Return the list of directories containing Guix extensions." - (filter file-exists? - (parse-path - (getenv "GUIX_EXTENSIONS_PATH")))) + (add-channels-to-load-path!) + (let ((channels (package-path-entries))) + (filter file-exists? + (append + (parse-path + (getenv "GUIX_EXTENSIONS_PATH")) + (map + (cut string-append <> "/guix/extensions") + channels))))) (define (commands) "Return the list of commands, alphabetically sorted." base-commit: 369d2698b0bfc3726f8e6d232d43d0dda832225f prerequisite-patch-id: cd0707c90e1d321f3f16f2f861313dd330e9f0b4 -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 02 12:28:11 2024 Received: (at 74633) by debbugs.gnu.org; 2 Dec 2024 17:28:11 +0000 Received: from localhost ([127.0.0.1]:56432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIADT-0004xe-A5 for submit@debbugs.gnu.org; Mon, 02 Dec 2024 12:28:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIADQ-0004xF-3w for 74633@debbugs.gnu.org; Mon, 02 Dec 2024 12:28:09 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIABD-0000RP-K0; Mon, 02 Dec 2024 12:25:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=dSOxIbbI5thGU/n+AyHqdq+wv/SyAwimJ6faa6SlRfw=; b=Tg7GVhYtOEqG42mJbwGj Hx15ZPB/f3aao0YwsuV2Zu3z1nmYGnscnms03Al9VHiALWpvd2igUcrdXKaEqACjACRumlW3bFytn 0so54/ztiaodFhMQYcFXHEzOsbd8CDiLCNspGJFUeQpx8TYLluLLy0GEKg46Ynk2IKVMc2fg9p96C 5ser+A2wJctFx37T5NQmSqL8mrMb9eLrl9M98qJT+x420GG1KkT+4Wkw+6QieHCTyfzMnOpaPcIrE wr3GH+6BwUyBMxoVDzfCnZFNOBB/LM19rpG1ORWhjefkfVKytFfPfGnmEbLH1IGcmWfLghywAeeDE VdaIoOWmPFXFRw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Brian Kubisiak Subject: Re: [bug#74633] [PATCH] ui: Search channels for guix extensions In-Reply-To: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> (Brian Kubisiak's message of "Sun, 1 Dec 2024 06:53:03 -0800") References: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> Date: Mon, 02 Dec 2024 18:25:43 +0100 Message-ID: <87frn63sko.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74633 Cc: 74633@debbugs.gnu.org, Carlo Zancanaro 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 (---) Hello, Brian Kubisiak skribis: > * guix/describe.scm (add-channels-to-load-path!): New function. > * gnu/packages.scm (%package-module-path): Call new function. Remove > the code that the function call replaces. > * guix/ui.scm (extension-directories): Call new function. Search > channels for guix extensions. > * guix/self.scm (compiled-guix)[*core-modules*]: Add 'guile-git' to > the list of extensions. > > Change-Id: I53af828dc554485ca28389c9e2653ea6b4fb6b7e Before looking further, note that Carlo (Cc=E2=80=99d) has been looking into this as well: https://issues.guix.gnu.org/74425 So there=E2=80=99s a real need :-) and perhaps ways both can be merged. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 03 06:29:59 2024 Received: (at 74633) by debbugs.gnu.org; 3 Dec 2024 11:30:00 +0000 Received: from localhost ([127.0.0.1]:58447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIR6N-0000Yy-9g for submit@debbugs.gnu.org; Tue, 03 Dec 2024 06:29:59 -0500 Received: from voltorb.zancanaro.id.au ([45.77.50.64]:54190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIR6K-0000Ye-Nx for 74633@debbugs.gnu.org; Tue, 03 Dec 2024 06:29:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=k1; bh=wThLffGQysgTKYt oJD5NB+dPBNaE9aWpUVHJlIcSxCE=; h=date:references:in-reply-to:subject: cc:to:from; d=zancanaro.id.au; b=nSFbjENGtTcwsYn+Bna0iS7i0ftTc9BYOYUCM qL1ku7P4/+JB6pRtlSzU/NfXAFT00U1J2CBPM846vadO4/gaH45aJ/cbpzftg+qZuoHN4r 8SUmCfrotIfRgySLGq2BrkgC/wUMIGofO9s95FD2Q7RAx7HOrEkeX+qBq7VChPsk= Received: by voltorb.zancanaro.id.au (OpenSMTPD) with ESMTPSA id 8d4ae4dc (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 3 Dec 2024 11:29:06 +0000 (UTC) From: Carlo Zancanaro To: Brian Kubisiak Subject: Re: [bug#74633] [PATCH] ui: Search channels for guix extensions In-Reply-To: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> (Brian Kubisiak's message of "Sun, 1 Dec 2024 06:53:03 -0800") References: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> Date: Tue, 03 Dec 2024 22:29:46 +1100 Message-ID: <87mshdknrp.fsf@zancanaro.id.au> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74633 Cc: 74633@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: -1.0 (-) Hi Brian! As Ludo mentioned, I've recently sent a patch to solve the same problem, but mine is a bit different. I think your change is better in most ways to mine, but I'll comment on some things inline below. On Sun, Dec 01 2024, Brian Kubisiak wrote: > diff --git a/gnu/packages.scm b/gnu/packages.scm > index 80c22d1d7f..05b8bf8e6d 100644 > --- a/gnu/packages.scm > +++ b/gnu/packages.scm > @@ -147,15 +147,16 @@ (define %package-module-path > (let* ((not-colon (char-set-complement (char-set #\:))) > (environment (string-tokenize (or (getenv "GUIX_PACKAGE_PATH") "") > not-colon)) > - (channels-scm channels-go (package-path-entries))) > + (channels-scm (package-path-entries))) > ;; Automatically add channels and items from $GUIX_PACKAGE_PATH to Guile's > ;; search path. For historical reasons, $GUIX_PACKAGE_PATH goes to the > ;; front; channels go to the back so that they don't override Guix' own > ;; modules. This comment should be moved onto add-channels-to-load-path!. Possibly even as a docstring. > diff --git a/guix/describe.scm b/guix/describe.scm > index a4ca2462f4..3bbda15db5 100644 > --- a/guix/describe.scm > +++ b/guix/describe.scm > @@ -190,6 +192,17 @@ (define (package-path-entries) > "/site-ccache"))) > (current-channel-entries)))) > > +(define add-channels-to-load-path! > + (let ((promise > + (delay > + (let-values (((channels-scm channels-go) (package-path-entries))) > + (set! %load-path > + (append %load-path channels-scm)) > + (set! %load-compiled-path > + (append %load-compiled-path channels-go)))))) > + (lambda () > + (force promise)))) I like that this is avoiding adding things to the path multiple times (which is a problem with my proposed change). > diff --git a/guix/self.scm b/guix/self.scm > index 2652688c71..28239d53f5 100644 > --- a/guix/self.scm > +++ b/guix/self.scm > @@ -882,6 +882,7 @@ (define* (compiled-guix source #:key > ,(local-file "../guix/store/schema.sql"))) > > #:extensions (list guile-gcrypt > + guile-git ;for (guix git) I don't know enough to know if this is a problem, but it's a shame to have to add this, given I don't think this change actually ends up using any git functionality. I solved the same issue by lazily resolving the (guix describe) module. Using an autoload wasn't enough (i.e. it still broke "guix pull"), but using (@ (guix describe) package-path-entries) worked. > diff --git a/guix/ui.scm b/guix/ui.scm > index eba12c8616..28690b22bc 100644 > --- a/guix/ui.scm > +++ b/guix/ui.scm > @@ -2192,9 +2193,15 @@ (define* (command-files #:optional directory) > > (define (extension-directories) > "Return the list of directories containing Guix extensions." > - (filter file-exists? > - (parse-path > - (getenv "GUIX_EXTENSIONS_PATH")))) > + (add-channels-to-load-path!) > + (let ((channels (package-path-entries))) > + (filter file-exists? > + (append > + (parse-path > + (getenv "GUIX_EXTENSIONS_PATH")) > + (map > + (cut string-append <> "/guix/extensions") > + channels))))) I don't think you need the (append ...). According to the manual, parse-path takes another argument as a "tail" for the resulting list, so (parse-path (getenv "GUIX_EXTENSIONS_PATH") (map ... channels)) should be enough here. Am I right in thinking that this will look inside the channels at /guix/extensions to try to find things? That is, if I wanted to add a command "guix foo" I would need to define a module in $channel_dir/guix/extensions/guix/scripts/foo.scm? If I'm reading that correctly, this feels unnecessary. Channels can already specify a directory in their .guix-channel file. In my change it just looks for $channel_dir/guix/scripts/foo.scm, which seems more straightforward. (I'm not worried about people accidentally defining something /guix/scripts/, because the name is pretty obvious.) All together, I'm proposing simplifying things to: --8<---------------cut here---------------start------------->8--- (define (extension-directories) "Return the list of directories containing Guix extensions." (add-channels-to-load-path!) (let ((channels (package-path-entries))) (filter file-exists? (parse-path (getenv "GUIX_EXTENSIONS_PATH") channels)))) --8<---------------cut here---------------end--------------->8--- We may also want to something into the docstring to mention that it adds to %load-path. Carlo From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 03 20:00:05 2024 Received: (at 74633) by debbugs.gnu.org; 4 Dec 2024 01:00:05 +0000 Received: from localhost ([127.0.0.1]:33447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIdkJ-0006fs-DQ for submit@debbugs.gnu.org; Tue, 03 Dec 2024 20:00:05 -0500 Received: from [75.171.110.13] (port=2213 helo=mail.kubisiak.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIdkG-0006ej-BU for 74633@debbugs.gnu.org; Tue, 03 Dec 2024 20:00:01 -0500 dkim-signature: v=1; a=rsa-sha256; d=kubisiak.com; s=s1; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type:In-Reply-To:References; bh=AH6JIRjzi49FCCL0Jpoc4LnKHcf98B+Q5Eavd7H2b94=; b=hUzAxFYL9tuK2vx7BdmxZjB4cxcsQXPlphBQYH+b9tfzB1HMa179Dl00mEiFiIteziUNgx0x0jidmjPcZLPsrEY2RFPS9aGKPvzcmdmJ3jbb3gLxLA1QE9e+yHGmIuIb+QVHngFKRASOdYh5inimwYdziGqF1qt0T/XtqiBhmvTttR9v/upJ/F0Y3CC5LYthFvO69xzYobqZe8O74G49nqHU1zBJ/8+LxQtYBgCsDOHDv//d5p/suk2wJL Mt2l0xqQ5pbJE/A+786x1kOXbrGucdniEVp6f+/O2OZGJRS9lrKIOApckjGtqYIEwN9NCd5XlgCaVWz6pkIY5Bnd2pxQ== Received: from peregrine (135-180-130-213.dsl.dynamic.sonic.net [135.180.130.213]) (envelope-sender ) by mail.kubisiak.com with ESMTPSA id for (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256) ; Tue, 3 Dec 2024 18:59:49 -0600 Date: Tue, 3 Dec 2024 16:59:47 -0800 From: Brian Kubisiak To: Carlo Zancanaro Subject: Re: [bug#74633] [PATCH] ui: Search channels for guix extensions Message-ID: References: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> <87mshdknrp.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mshdknrp.fsf@zancanaro.id.au> X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Carlo, > On Sun, Dec 01 2024, Brian Kubisiak wrote: > > diff --git a/gnu/packages.scm b/gnu/packages.scm > > index 80c22d1d7f..05b8bf8e6d 100644 > > --- a/gnu/packages.scm > > +++ b/gnu/packages.scm > > @@ - [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [75.171.110.13 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [75.171.110.13 listed in bl.score.senderscore.com] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 74633 Cc: 74633@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: 0.3 (/) Hi Carlo, > On Sun, Dec 01 2024, Brian Kubisiak wrote: > > diff --git a/gnu/packages.scm b/gnu/packages.scm > > index 80c22d1d7f..05b8bf8e6d 100644 > > --- a/gnu/packages.scm > > +++ b/gnu/packages.scm > > @@ -147,15 +147,16 @@ (define %package-module-path > > (let* ((not-colon (char-set-complement (char-set #\:))) > > (environment (string-tokenize (or (getenv "GUIX_PACKAGE_PATH") "") > > not-colon)) > > - (channels-scm channels-go (package-path-entries))) > > + (channels-scm (package-path-entries))) > > ;; Automatically add channels and items from $GUIX_PACKAGE_PATH to Guile's > > ;; search path. For historical reasons, $GUIX_PACKAGE_PATH goes to the > > ;; front; channels go to the back so that they don't override Guix' own > > ;; modules. > > This comment should be moved onto add-channels-to-load-path!. Possibly > even as a docstring. Will do. > > diff --git a/guix/self.scm b/guix/self.scm > > index 2652688c71..28239d53f5 100644 > > --- a/guix/self.scm > > +++ b/guix/self.scm > > @@ -882,6 +882,7 @@ (define* (compiled-guix source #:key > > ,(local-file "../guix/store/schema.sql"))) > > > > #:extensions (list guile-gcrypt > > + guile-git ;for (guix git) > > I don't know enough to know if this is a problem, but it's a shame to > have to add this, given I don't think this change actually ends up using > any git functionality. Honestly I'm not sure what the are the downsides of this, since I don't see how *core-module* would get used without *extra-modules* or why *core-modules* doesn't include all the dependencies. Maybe Ludo knows more? > > diff --git a/guix/ui.scm b/guix/ui.scm > > index eba12c8616..28690b22bc 100644 > > --- a/guix/ui.scm > > +++ b/guix/ui.scm > > @@ -2192,9 +2193,15 @@ (define* (command-files #:optional directory) > > > > (define (extension-directories) > > "Return the list of directories containing Guix extensions." > > - (filter file-exists? > > - (parse-path > > - (getenv "GUIX_EXTENSIONS_PATH")))) > > + (add-channels-to-load-path!) > > + (let ((channels (package-path-entries))) > > + (filter file-exists? > > + (append > > + (parse-path > > + (getenv "GUIX_EXTENSIONS_PATH")) > > + (map > > + (cut string-append <> "/guix/extensions") > > + channels))))) > > I don't think you need the (append ...). According to the manual, > parse-path takes another argument as a "tail" for the resulting list, so > (parse-path (getenv "GUIX_EXTENSIONS_PATH") (map ... channels)) should > be enough here. I saw that on your patch, good to know! > Am I right in thinking that this will look inside the channels at > /guix/extensions to try to find things? Correct. I chose this to match existing behavior, since $GUIX_EXTENSIONS_PATH points at this directory for an extension installed as a package. (I was able to tkae an existing extension and pull it in as a channel and everything "just worked" without changing any code or directory structure in the extension) > That is, if I wanted to add a command "guix foo" I would need to > define a module in $channel_dir/guix/extensions/guix/scripts/foo.scm? This is not required, the command "guix foo" could be defined in $channel_dir/guix/extensions/foo.scm. The command-files function doesn't add /guix/scripts if a directory is passed as an argument and the run-guix-command function will resolve '(guix extensions foo) if foo.scm exists in an extension directory (i.e. $channel_dir/guix/extensions/foo.scm exists). Thanks for the feedback, Brian From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 04 23:38:47 2024 Received: (at 74633) by debbugs.gnu.org; 5 Dec 2024 04:38:47 +0000 Received: from localhost ([127.0.0.1]:37703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tJ3dW-0004ml-Eu for submit@debbugs.gnu.org; Wed, 04 Dec 2024 23:38:47 -0500 Received: from mail-pg1-f179.google.com ([209.85.215.179]:58849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIzj5-00013J-9r for 74633@debbugs.gnu.org; Wed, 04 Dec 2024 19:28:20 -0500 Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-7fbc65f6c72so373425a12.1 for <74633@debbugs.gnu.org>; Wed, 04 Dec 2024 16:28:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sil.org; s=google; t=1733358429; x=1733963229; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=7uFl/3L1Mu4Dtmg5VZAMFK9HOnORoyPS3vh7SCBh+OU=; b=ZqlcoGhe5+7A1yyp9BOKX9wZVW3YtQF6MLjATux3948xWxs6fR4YShjhRW21Er6BGi jflT9zMQ6sPeeho1bAPQW+9EtbW2ggVNPL0LJIO7RpND5oMhZbz1n+XOvfUxR63xTh6V XHSKTSuCgDKGET8j32AEDknxoHAEkkmzPITNA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733358429; x=1733963229; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7uFl/3L1Mu4Dtmg5VZAMFK9HOnORoyPS3vh7SCBh+OU=; b=qSuea5WrTkPZ3kLUebpbdpg3Glvh/o/W9lYhSKeKU0U7f69HljPIvU3xsotkEKcVtI jKJQgEJtoLE3RmSxF7CwQ9fdXkuGYcU1VyEiul8eTyYugcps+S57zKPPU9rKImUMKmPJ wn8IPptWDbQIH5rF3nvA9W5ejG7JqcQM8lB7q+ZL0vGlaqeP/sRcKiTp0h5Qws6kLnEG lkpZEz5ONiadf1ty20y61A7uEaykXYg/NhlMv8MBx8cOUPjfKMlj73CrK6FhiMlK1+oS ynzt7Pr7LgEcpLPydFwT1uvY81vOOporpNRLZK3afNsLy83Eruxgw+nja3n3UmfXJbOg bdYQ== X-Gm-Message-State: AOJu0YydrTxLRAC4pZq2nqnB5ioLornUx2NCJjW1AovSRw+3zkuC3jQo yfLPYdyCCcDENOs+xxJh5MA75iel+uSWW3C6a4Hqb1TVtalk/klteyBJ+kOoSww1mVQ7wpvXH/M oWaIi1OeioX+OYBLalPsr2hzKwgrd7Afxql+QiGukSZkRKXKxhabM0mwwUeAuIUK/WM0mtLCYzK SgKJV472DaoXQyrbFHwTfpLNwxFpmLqOWc3CsOB+mPBQ== X-Gm-Gg: ASbGncueLLNN1o6eZEyQDeYhPKHuv3568IkCF0gTX7aP0cxGMavDq4r8b4c8iwkI+et VcmdeYAbiKMgv5EIgLWONCqe+C1mJfbd+82q3tdDC7mBMZJMYX02nhlB8Yq/Q2NPqVadOytmNhb 5d8r+vNcISNKRo5y4rM9fBnfvTcwEl0ljqLE1kAbAiYKubmb1qv+PzGPRAvtaOswnZz+qaU9fe0 Ip0q2B46P6L185Vdxb4c5/sEmCi0x/IUH8yW/0M3myXOkbi3Pl2cFWqPF7HQ4Fgjk2sUrGQvwuI MR1cScb5/fGcx8Srw7e4xThd X-Google-Smtp-Source: AGHT+IGdqz6c1XVCQUm7X1YN6B8Kx77KdHocXKEN7lotI9Jt6613Z8Qmp89O1E5vqa5dUgkwSaWqyQ== X-Received: by 2002:a05:6a20:e605:b0:1e0:cd2a:d80a with SMTP id adf61e73a8af0-1e1653a05cemr12230324637.7.1733358429256; Wed, 04 Dec 2024 16:27:09 -0800 (PST) Received: from squirtle (n203-164-246-111.bla21.nsw.optusnet.com.au. [203.164.246.111]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-725a2ca671asm84260b3a.153.2024.12.04.16.27.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Dec 2024 16:27:08 -0800 (PST) From: Carlo Zancanaro To: Brian Kubisiak Subject: Re: [bug#74633] [PATCH] ui: Search channels for guix extensions In-Reply-To: (Brian Kubisiak's message of "Tue, 3 Dec 2024 16:59:47 -0800") References: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> <87mshdknrp.fsf@zancanaro.id.au> Date: Thu, 05 Dec 2024 11:27:05 +1100 Message-ID: <87cyi7q8iu.fsf@sil.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74633 X-Mailman-Approved-At: Wed, 04 Dec 2024 23:38:43 -0500 Cc: 74633@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: -1.0 (-) On Tue, Dec 03 2024, Brian Kubisiak wrote: >> That is, if I wanted to add a command "guix foo" I would need to >> define a module in $channel_dir/guix/extensions/guix/scripts/foo.scm? > > This is not required, the command "guix foo" could be defined in > $channel_dir/guix/extensions/foo.scm. The command-files function > doesn't add /guix/scripts if a directory is passed as an argument and > the run-guix-command function will resolve '(guix extensions foo) > if foo.scm exists in an extension directory > (i.e. $channel_dir/guix/extensions/foo.scm exists). Ah, I see. That sounds good to me. Given the channel is also being added to %load-path, I expect you can add a command by defining (guix scripts foo) or (guix extensions foo) and it will work either way (finding the former first). We should document this method of extension in the manual. I think a new section in the "(guix) Channels" chapter for "Declaring Custom Commands" would be helpful. I might have some time to write something in the next few days, but if you get a chance before then go ahead. Thanks for your work on this, Carlo From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 08 17:03:57 2024 Received: (at 74633) by debbugs.gnu.org; 8 Dec 2024 22:03:57 +0000 Received: from localhost ([127.0.0.1]:51920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKPNd-0001zO-0a for submit@debbugs.gnu.org; Sun, 08 Dec 2024 17:03:57 -0500 Received: from [75.171.110.13] (port=1859 helo=mail.kubisiak.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKPNa-0001z1-T4 for 74633@debbugs.gnu.org; Sun, 08 Dec 2024 17:03:55 -0500 dkim-signature: v=1; a=rsa-sha256; d=kubisiak.com; s=s1; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:MIME-Version:Content-Type; bh=uTDgIeei+nonM3f78WhRKqXuUHtju5VaSw4vGHPL6ro=; b=KKW/SlDkCd1eCzCTFwwWWuQkaW46aMmY+g0J5mrk40rc0fDn2BeM4wB2DO/wBIRCDvEJav/uODAGENHfHzvFHvKU2tBasJY0dNMPk+2KfDQ306UI/NY3ly85FwA4kRM5vRRh3ws5zRGNlTVIhIhWBZd9TN10qFrDkBO8wJHpv1Qa4mQPKsIsINMsIK6pgKTLRHuAAmmPXGogAxnUsaDDozji2eg4c3ZkjZihQIvjW2JCJSKTBWqwuvLEYQ /12dr1sZpK3Jtua2zvkqMWFER5mSF/yXHLqwzLm7sy35N0vn9mh6ubiEcjGFyNVhqY/NKuQtndp2YqM0jjKnqbkdxh2g== Received: from peregrine (135-180-130-213.dsl.dynamic.sonic.net [135.180.130.213]) (envelope-sender ) by mail.kubisiak.com with ESMTPSA id <2c078699007e847611b7a20679621813691d9db3.1733695255.git.brian@kubisiak.com> for <74633@debbugs.gnu.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256) ; Sun, 8 Dec 2024 16:03:46 -0600 Date: Sun, 8 Dec 2024 14:03:45 -0800 From: Brian Kubisiak To: 74633@debbugs.gnu.org Subject: [PATCH v2] ui: Search channels for guix extensions Message-ID: <2c078699007e847611b7a20679621813691d9db3.1733695255.git.brian@kubisiak.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/describe.scm (add-channels-to-load-path!): New function. * gnu/packages.scm (%package-module-path): Call new function. Remove the code that the function call replaces. * guix/ui.scm (extension- [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [75.171.110.13 listed in sa-accredit.habeas.com] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [75.171.110.13 listed in bl.score.senderscore.com] 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 74633 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: 0.3 (/) * guix/describe.scm (add-channels-to-load-path!): New function. * gnu/packages.scm (%package-module-path): Call new function. Remove the code that the function call replaces. * guix/ui.scm (extension-directories): Call new function. Search channels for guix extensions. * guix/self.scm (compiled-guix)[*core-modules*]: Add 'guile-git' to the list of extensions. Change-Id: I53af828dc554485ca28389c9e2653ea6b4fb6b7e --- gnu/packages.scm | 7 ++++--- guix/describe.scm | 17 +++++++++++++++++ guix/self.scm | 1 + guix/ui.scm | 12 +++++++++--- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/gnu/packages.scm b/gnu/packages.scm index 1af3b8d440..42f3546606 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -148,15 +148,16 @@ (define %package-module-path (let* ((not-colon (char-set-complement (char-set #\:))) (environment (string-tokenize (or (getenv "GUIX_PACKAGE_PATH") "") not-colon)) - (channels-scm channels-go (package-path-entries))) + (channels-scm (package-path-entries))) ;; Automatically add channels and items from $GUIX_PACKAGE_PATH to Guile's ;; search path. For historical reasons, $GUIX_PACKAGE_PATH goes to the ;; front; channels go to the back so that they don't override Guix' own ;; modules. + (add-channels-to-load-path!) (set! %load-path - (append environment %load-path channels-scm)) + (append environment %load-path)) (set! %load-compiled-path - (append environment %load-compiled-path channels-go)) + (append environment %load-compiled-path)) (make-parameter (append environment diff --git a/guix/describe.scm b/guix/describe.scm index a4ca2462f4..6694b1eaf7 100644 --- a/guix/describe.scm +++ b/guix/describe.scm @@ -27,6 +27,7 @@ (define-module (guix describe) sexp->channel manifest-entry-channel) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) #:use-module (srfi srfi-34) #:use-module (ice-9 match) #:export (current-profile @@ -34,6 +35,7 @@ (define-module (guix describe) current-profile-entries current-channels package-path-entries + add-channels-to-load-path! package-provenance package-channels @@ -190,6 +192,21 @@ (define (package-path-entries) "/site-ccache"))) (current-channel-entries)))) +(define add-channels-to-load-path! + (let ((promise + (delay + (let-values (((channels-scm channels-go) (package-path-entries))) + (set! %load-path + (append %load-path channels-scm)) + (set! %load-compiled-path + (append %load-compiled-path channels-go)))))) + (lambda () + "Automatically add channels to Guile's search path. Channels are added +to the end of the path so they don't override Guix' own modules. This +function ensures that channels are only added to the search path once even if +it is called multiple times." + (force promise)))) + (define (package-channels package) "Return the list of channels providing PACKAGE or an empty list if it could not be determined." diff --git a/guix/self.scm b/guix/self.scm index 2652688c71..28239d53f5 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -882,6 +882,7 @@ (define* (compiled-guix source #:key ,(local-file "../guix/store/schema.sql"))) #:extensions (list guile-gcrypt + guile-git ;for (guix git) guile-json) ;for (guix swh) #:guile-for-build guile-for-build)) diff --git a/guix/ui.scm b/guix/ui.scm index eba12c8616..87ae24ea55 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -38,6 +38,7 @@ (define-module (guix ui) ;import in user interfaces only #:use-module (guix i18n) #:use-module (guix colors) + #:use-module (guix describe) #:use-module (guix diagnostics) #:use-module (guix gexp) #:use-module (guix sets) @@ -2192,9 +2193,14 @@ (define* (command-files #:optional directory) (define (extension-directories) "Return the list of directories containing Guix extensions." - (filter file-exists? - (parse-path - (getenv "GUIX_EXTENSIONS_PATH")))) + (add-channels-to-load-path!) + (let ((channels (package-path-entries))) + (filter file-exists? + (parse-path + (getenv "GUIX_EXTENSIONS_PATH") + (map + (cut string-append <> "/guix/extensions") + channels))))) (define (commands) "Return the list of commands, alphabetically sorted." base-commit: 9001514e242ad15c190588439930b0fa4f6782e3 prerequisite-patch-id: cd0707c90e1d321f3f16f2f861313dd330e9f0b4 -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 26 16:09:07 2024 Received: (at 74633) by debbugs.gnu.org; 26 Dec 2024 21:09:07 +0000 Received: from localhost ([127.0.0.1]:42432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQv6Q-00024L-Vu for submit@debbugs.gnu.org; Thu, 26 Dec 2024 16:09:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQv6O-00023m-5n for 74633@debbugs.gnu.org; Thu, 26 Dec 2024 16:09:05 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQv6H-0001sk-9r; Thu, 26 Dec 2024 16:08:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=EJhQIpzrCZ6S0AYAiZ7O44b49JFJaKTD8IO96MQgQNI=; b=H6On5hmIn5Aenxv+q4ok RVBQ5kuOSqDL0fKTXnWkiChpoL2MXgtXJT3DdoSZaV8lWdZu8fHybc4ndv/8YAsz6ORQ/PNvoEnj3 WUpNT+vTnYe5UE0Z0gI9SKh8awfBHBhza/96rJ7bOgg+rZNNZMHDliNvET91jzpTkVVRWm8OGSVkC 03WOOo8r6lSL2HWq4TE/P3h8Dt/prJOVJR60x+cQFLSXarrU8y5QXJOtFOEYxj6PKDuasqqsVeHju zaQSKuPW4IYs6xf6X34YGM14J2dWaXIiq/mzTsOoAffVGeh8oQksipbXtFE4wWem9CepmN5P/cKUh kBh6vt8DhjoGxQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Brian Kubisiak Subject: Re: [bug#74633] [PATCH v2] ui: Search channels for guix extensions In-Reply-To: <2c078699007e847611b7a20679621813691d9db3.1733695255.git.brian@kubisiak.com> (Brian Kubisiak's message of "Sun, 8 Dec 2024 14:03:45 -0800") References: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> <2c078699007e847611b7a20679621813691d9db3.1733695255.git.brian@kubisiak.com> Date: Thu, 26 Dec 2024 22:08:52 +0100 Message-ID: <87plle17a3.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74633 Cc: 74633@debbugs.gnu.org, Carlo Zancanaro 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 Brian, Brian Kubisiak skribis: > * guix/describe.scm (add-channels-to-load-path!): New function. > * gnu/packages.scm (%package-module-path): Call new function. Remove > the code that the function call replaces. > * guix/ui.scm (extension-directories): Call new function. Search > channels for guix extensions. > * guix/self.scm (compiled-guix)[*core-modules*]: Add 'guile-git' to > the list of extensions. > > Change-Id: I53af828dc554485ca28389c9e2653ea6b4fb6b7e Overall LGTM. I tested it with =E2=80=98make as-derivation=E2=80=99 and it= works as advertised; =E2=80=98strace -c=E2=80=99 shows that the number of syscalls i= s comparable to that we currently have. A couple of minor comments: > +++ b/gnu/packages.scm > @@ -148,15 +148,16 @@ (define %package-module-path > (let* ((not-colon (char-set-complement (char-set #\:))) > (environment (string-tokenize (or (getenv "GUIX_PACKAGE_PATH") = "") > not-colon)) > - (channels-scm channels-go (package-path-entries))) > + (channels-scm (package-path-entries))) This variable is now unused; I think it can be removed. > +(define add-channels-to-load-path! > + (let ((promise > + (delay > + (let-values (((channels-scm channels-go) (package-path-entrie= s))) > + (set! %load-path > + (append %load-path channels-scm)) > + (set! %load-compiled-path > + (append %load-compiled-path channels-go)))))) > + (lambda () > + "Automatically add channels to Guile's search path. Channels are = added > +to the end of the path so they don't override Guix' own modules. This > +function ensures that channels are only added to the search path once ev= en if > +it is called multiple times." > + (force promise)))) For clarity, I would call this =E2=80=98append-channels-to-load-path!=E2=80= =99. Using a promise here works, but I find it slightly misleading (because we=E2=80=99re using it for side effects) and a bit heavyweight (promises are thread-safe, so there=E2=80=99s a mutex etc.). How about this: (define (append-channels-to-load-path!) (let-values (=E2=80=A6) =E2=80=A6) (set! append-channels-to-load-path! (lambda () #t))) ? Could you send a v3 along these lines, if you think that makes sense? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 26 16:33:30 2024 Received: (at control) by debbugs.gnu.org; 26 Dec 2024 21:33:30 +0000 Received: from localhost ([127.0.0.1]:42507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQvU2-0003Kn-14 for submit@debbugs.gnu.org; Thu, 26 Dec 2024 16:33:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQvTz-0003KY-Jz for control@debbugs.gnu.org; Thu, 26 Dec 2024 16:33:28 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQvTu-0004Ui-Da for control@debbugs.gnu.org; Thu, 26 Dec 2024 16:33:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:Subject:From:To:Date:in-reply-to: references; bh=TWJ5NoGYY+oKn2Q3Z7Ko2+7HQiX0PKERvoMkC1te5VI=; b=NNBi3AvsiLoSuX APO5DEu+AUu5A++8HPgA95rJWBbBTaHz5ypvTBq+CdM6EO9aLL3FAg5J8IbPVlwdSBQKJ9AT3nmGM cExCFcKlsFXQIavShKtU3qUhc1G3XpoQfiSGF0LP9FC+u0dFw6Klmhl8aGbO5ABgX1zz/gwgYlnwS qqEeSbiBVCYXjsOO6d4PmkoL8zfowNgTF+WccH/mEPOjPvG37RpBgO6G680EvGXVtCjqkuhnOtnQ7 yf+ApAbgVxLPlj1N1sWk9zvDxexIqzVxJNShGAnQvOPf9neNLJhIrofhAvnCXDbgnrudqc0U7m3w8 pxVtSPORe6U2jN7f03nw==; Date: Thu, 26 Dec 2024 22:33:17 +0100 Message-Id: <87msgiyvs2.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #74633 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) 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: -3.3 (---) merge 74633 74425 quit From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 07 20:22:47 2025 Received: (at 74633) by debbugs.gnu.org; 8 Jan 2025 01:22:47 +0000 Received: from localhost ([127.0.0.1]:45320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tVKmU-0003BF-Vf for submit@debbugs.gnu.org; Tue, 07 Jan 2025 20:22:47 -0500 Received: from [75.171.110.13] (port=2322 helo=mail.kubisiak.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tVKmS-0003Az-9K for 74633@debbugs.gnu.org; Tue, 07 Jan 2025 20:22:45 -0500 dkim-signature: v=1; a=rsa-sha256; d=kubisiak.com; s=s1; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:MIME-Version:Content-Type; bh=I/HLI0WgpjXIb5hF9dcOAD8f5y7OGug/3heWVAuhw/8=; b=kRxUvGjGfZuPKN1Y2AzoEbJKC5mgL0PDL7ZgRotvifdx8ln+AeSXnTeraufZ6Rk7Ob8XdPCBEPWhv7H+/chC+mjxaeIBlExv3x/oWnvbKVc0iGYSAxfEr+Bqzn7L/K2yoBGrI1JJdk0Chf91kujfPejoJIcAajnqXFonO1/35SYwmYzERIxIe8VFOH9gKBqnLq4lGCObCCGYdWOd85EvNMbMhelz5X7YrouWlEnEV86Jds3fvizZUwS9lA fD5SXM9a3CgDxCrIkUkYtIWLdlhvCtKW2+XM2D1ZV3Yan+g7noCy7euPQhLiQoTjYCBLVbJpwiCqmMTcKTHUviV8N/Vw== Received: from peregrine (135-180-130-213.dsl.dynamic.sonic.net [135.180.130.213]) (envelope-sender ) by mail.kubisiak.com with ESMTPSA id <6a1ff2a779e9cf5248671fc9e62852aa23be3f16.1736299302.git.brian@kubisiak.com> for <74633@debbugs.gnu.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256) ; Tue, 7 Jan 2025 19:22:36 -0600 Date: Tue, 7 Jan 2025 17:22:35 -0800 From: Brian Kubisiak To: 74633@debbugs.gnu.org Subject: [PATCH v3] ui: Search channels for guix extensions Message-ID: <6a1ff2a779e9cf5248671fc9e62852aa23be3f16.1736299302.git.brian@kubisiak.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/describe.scm (append-channels-to-load-path!): New function. * gnu/packages.scm (%package-module-path): Call new function. Remove the code that the function call replaces. * guix/ui.scm (extensi [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [75.171.110.13 listed in sa-accredit.habeas.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [75.171.110.13 listed in bl.score.senderscore.com] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 74633 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: 0.3 (/) * guix/describe.scm (append-channels-to-load-path!): New function. * gnu/packages.scm (%package-module-path): Call new function. Remove the code that the function call replaces. * guix/ui.scm (extension-directories): Call new function. Search channels for guix extensions. * guix/self.scm (compiled-guix)[*core-modules*]: Add 'guile-git' to the list of extensions. Change-Id: I53af828dc554485ca28389c9e2653ea6b4fb6b7e --- gnu/packages.scm | 7 ++++--- gnu/system/image.scm | 2 +- guix/describe.scm | 14 ++++++++++++++ guix/self.scm | 1 + guix/ui.scm | 12 +++++++++--- 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/gnu/packages.scm b/gnu/packages.scm index bdd5d21940..ee99dea2ca 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -148,15 +148,16 @@ (define %package-module-path (let* ((not-colon (char-set-complement (char-set #\:))) (environment (string-tokenize (or (getenv "GUIX_PACKAGE_PATH") "") not-colon)) - (channels-scm channels-go (package-path-entries))) + (channels-scm (package-path-entries))) ;; Automatically add channels and items from $GUIX_PACKAGE_PATH to Guile's ;; search path. For historical reasons, $GUIX_PACKAGE_PATH goes to the ;; front; channels go to the back so that they don't override Guix' own ;; modules. + (append-channels-to-load-path!) (set! %load-path - (append environment %load-path channels-scm)) + (append environment %load-path)) (set! %load-compiled-path - (append environment %load-compiled-path channels-go)) + (append environment %load-compiled-path)) (make-parameter (append environment diff --git a/gnu/system/image.scm b/gnu/system/image.scm index af0f3eb354..e4fdbab634 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -319,7 +319,7 @@ (define gcrypt-sqlite3&co (match (package-transitive-propagated-inputs package) (((labels packages) ...) packages)))) - (list guile-gcrypt guile-sqlite3))) + (list guile-gcrypt guile-git guile-json-4 guile-sqlite3))) (define-syntax-rule (with-imported-modules* gexp* ...) (with-extensions gcrypt-sqlite3&co diff --git a/guix/describe.scm b/guix/describe.scm index a4ca2462f4..90c17084d1 100644 --- a/guix/describe.scm +++ b/guix/describe.scm @@ -27,6 +27,7 @@ (define-module (guix describe) sexp->channel manifest-entry-channel) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) #:use-module (srfi srfi-34) #:use-module (ice-9 match) #:export (current-profile @@ -34,6 +35,7 @@ (define-module (guix describe) current-profile-entries current-channels package-path-entries + append-channels-to-load-path! package-provenance package-channels @@ -190,6 +192,18 @@ (define (package-path-entries) "/site-ccache"))) (current-channel-entries)))) +(define (append-channels-to-load-path!) + "Automatically add channels to Guile's search path. Channels are added to the +end of the path so they don't override Guix' own modules. This function ensures +that channels are only added to the search path once even if it is called +multiple times." + (let-values (((channels-scm channels-go) (package-path-entries))) + (set! %load-path + (append %load-path channels-scm)) + (set! %load-compiled-path + (append %load-compiled-path channels-go))) + (set! append-channels-to-load-path! (lambda () #t))) + (define (package-channels package) "Return the list of channels providing PACKAGE or an empty list if it could not be determined." diff --git a/guix/self.scm b/guix/self.scm index 2652688c71..28239d53f5 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -882,6 +882,7 @@ (define* (compiled-guix source #:key ,(local-file "../guix/store/schema.sql"))) #:extensions (list guile-gcrypt + guile-git ;for (guix git) guile-json) ;for (guix swh) #:guile-for-build guile-for-build)) diff --git a/guix/ui.scm b/guix/ui.scm index 87a448bf72..05bc99a7e3 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -38,6 +38,7 @@ (define-module (guix ui) ;import in user interfaces only #:use-module (guix i18n) #:use-module (guix colors) + #:use-module (guix describe) #:use-module (guix diagnostics) #:use-module (guix gexp) #:use-module (guix sets) @@ -2194,9 +2195,14 @@ (define* (command-files #:optional directory) (define (extension-directories) "Return the list of directories containing Guix extensions." - (filter file-exists? - (parse-path - (getenv "GUIX_EXTENSIONS_PATH")))) + (append-channels-to-load-path!) + (let ((channels (package-path-entries))) + (filter file-exists? + (parse-path + (getenv "GUIX_EXTENSIONS_PATH") + (map + (cut string-append <> "/guix/extensions") + channels))))) (define (commands) "Return the list of commands, alphabetically sorted." base-commit: a76f2d5927c86e4a76a1d3b49c1a37054612f6c0 prerequisite-patch-id: 7835a4f0fbc5e19dcb65195bc9fb69c656915ee1 -- 2.47.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 07 20:29:29 2025 Received: (at 74633) by debbugs.gnu.org; 8 Jan 2025 01:29:30 +0000 Received: from localhost ([127.0.0.1]:45330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tVKsz-0003ic-Ip for submit@debbugs.gnu.org; Tue, 07 Jan 2025 20:29:29 -0500 Received: from [75.171.110.13] (port=2045 helo=mail.kubisiak.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tVKst-0003iD-Ji for 74633@debbugs.gnu.org; Tue, 07 Jan 2025 20:29:27 -0500 dkim-signature: v=1; a=rsa-sha256; d=kubisiak.com; s=s1; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type:In-Reply-To:References; bh=8zud61gXdWY6iD66fqMBV96Iq2Acueka0H7DgWT3b/Y=; b=NADIqJV9O9EM5XEy5SLPxsXUA6wpOyOa67HX1YYUcvWCP2VVGoxqFPCfRICL0WxHB1GWl+a9CD6etF+OB33mPSu8cwqnt4t/Z9eQJLPXjbrskx+TbtX/IgDrvCEeHJ8IQsj9HXa8wWEpN+5nIKb1DD07h1LDCKQpPh9BJ2wDvRdKKSGx232Y8+tN6rKhgqvvPDX63uE16EZz7GyiT587sHlNa3NH+K0iTNQLZIj6KaHWWcc3DgHYnG/lZF UUFDZPXUe5InFMTiFsAcMKSETPkwZdgjjmlmvmleLDZ+hu88i6L1H8ZEOgOCAe5X0BUtvAn+UgJJrlsf6rluPwB1FYrA== Received: from peregrine (135-180-130-213.dsl.dynamic.sonic.net [135.180.130.213]) (envelope-sender ) by mail.kubisiak.com with ESMTPSA id <4ke6rxdjqgco4quclch6erzjtkz33pz6ofzbh6xzgshpc3us63@ohfmoaq2dnzg> for (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256) ; Tue, 7 Jan 2025 19:29:08 -0600 Date: Tue, 7 Jan 2025 17:29:07 -0800 From: Brian Kubisiak To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#74633] [PATCH v2] ui: Search channels for guix extensions Message-ID: <4ke6rxdjqgco4quclch6erzjtkz33pz6ofzbh6xzgshpc3us63@ohfmoaq2dnzg> References: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> <2c078699007e847611b7a20679621813691d9db3.1733695255.git.brian@kubisiak.com> <87plle17a3.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87plle17a3.fsf@gnu.org> X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Could you send a v3 along these lines, if you think that makes sense? Sent. Note that during testing I noticed that guile-git (and guile-json-4) needed to be added as dependencies to a g-expression that imported guix/build/utils.scm due to the additional dependencies in [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [75.171.110.13 listed in sa-trusted.bondedsender.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [75.171.110.13 listed in bl.score.senderscore.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 74633 Cc: 74633@debbugs.gnu.org, Carlo Zancanaro 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: 0.3 (/) > Could you send a v3 along these lines, if you think that makes sense? Sent. Note that during testing I noticed that guile-git (and guile-json-4) needed to be added as dependencies to a g-expression that imported guix/build/utils.scm due to the additional dependencies introduced in this patch. I'm probably missing more places where this is required and Carlo's lazy import may be a better option to avoid issues like this. Let me know what you think, I can send another version if you think that's better. > > +++ b/gnu/packages.scm > > @@ -148,15 +148,16 @@ (define %package-module-path > > (let* ((not-colon (char-set-complement (char-set #\:))) > > (environment (string-tokenize (or (getenv "GUIX_PACKAGE_PATH") "") > > not-colon)) > > - (channels-scm channels-go (package-path-entries))) > > + (channels-scm (package-path-entries))) > > This variable is now unused; I think it can be removed. This is still used in the below make-parameter call (not shown in the patch), so I've left it in. Thanks, Brian From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 10 14:03:20 2025 Received: (at 74633) by debbugs.gnu.org; 10 Jan 2025 19:03:20 +0000 Received: from localhost ([127.0.0.1]:58820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tWKHv-0002PT-J0 for submit@debbugs.gnu.org; Fri, 10 Jan 2025 14:03:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57184) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tWKHt-0002P5-85 for 74633@debbugs.gnu.org; Fri, 10 Jan 2025 14:03:17 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tWKHn-00039i-LU; Fri, 10 Jan 2025 14:03:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Iu23VHIf/bKTLJF1Vcua3Z6hfYs0vH6+bgEJeQ2w08g=; b=d7fUTUX4MBJzc/1vkuC/ LoEuMxsVT8O52PSNk8i3zpwQsNrTv9d2wkJ/Vc85W+27NcIj4C+ID14kf7kELvHwhlFrBo43YkYUH V2vwCg7vkqgHzVFSon2kmESOh9YPdlFmNcDvGHSMgfsm2HLETTnHc8yOujLppT4h/kBNk243vbTvz yCm+kAf2XEJY/Rt8Ov3b4Ac03f5A8bMSAGXtdzu+aFX0ZXEpcDTg3u4RrxDvggrfYu4QS7ro3J/p0 OxuFWAqseryPmEAakUObEKiSxEWUW9xG4u2L4LXffuEOKkrh2CnHB40Vf4PCE2Y4xvH6NELhK9ztT 0m1uzyQ0isexSg==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Brian Kubisiak Subject: Re: [bug#74633] [PATCH v3] ui: Search channels for guix extensions In-Reply-To: <6a1ff2a779e9cf5248671fc9e62852aa23be3f16.1736299302.git.brian@kubisiak.com> (Brian Kubisiak's message of "Tue, 7 Jan 2025 17:22:35 -0800") References: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> <6a1ff2a779e9cf5248671fc9e62852aa23be3f16.1736299302.git.brian@kubisiak.com> Date: Fri, 10 Jan 2025 20:03:03 +0100 Message-ID: <87v7umjxug.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74633 Cc: 74633@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 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, Overall it LGTM. I propose the mostly-cosmetic changes below. Once thing I overlooked before is that commands will have to live under /guix/extensions, right? (define (commands) "Return the list of commands, alphabetically sorted." (filter-map source-file-command (append (command-files) (append-map command-files (extension-directories))))) And likewise in =E2=80=98run-guix-command=E2=80=99. But now, if a channel provides =E2=80=98guix/scripts/foo.scm=E2=80=99, the = =E2=80=98guix help=E2=80=99 command will not show =E2=80=98foo=E2=80=99 but the =E2=80=98guix foo=E2=80= =99 command will effectively work (which wasn=E2=80=99t the case until now). Maybe it=E2=80=99s fine actually, I don=E2=80=99t know, but I thought this = is worth mentioning and thinking though. WDYT? Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/describe.scm b/guix/describe.scm index 90c17084d1..819f0fef74 100644 --- a/guix/describe.scm +++ b/guix/describe.scm @@ -27,8 +27,8 @@ (define-module (guix describe) sexp->channel manifest-entry-channel) #:use-module (srfi srfi-1) - #:use-module (srfi srfi-11) #:use-module (srfi srfi-34) + #:use-module (srfi srfi-71) #:use-module (ice-9 match) #:export (current-profile current-profile-date @@ -194,10 +194,11 @@ (define (package-path-entries) (define (append-channels-to-load-path!) "Automatically add channels to Guile's search path. Channels are added to the -end of the path so they don't override Guix' own modules. This function ensures -that channels are only added to the search path once even if it is called -multiple times." - (let-values (((channels-scm channels-go) (package-path-entries))) +end of the path so they don't override Guix' own modules. + +This procedure ensures that channels are only added to the search path once +even if it is called multiple times." + (let ((channels-scm channels-go (package-path-entries))) (set! %load-path (append %load-path channels-scm)) (set! %load-compiled-path diff --git a/guix/ui.scm b/guix/ui.scm index 05bc99a7e3..d9d7c8469f 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -38,7 +38,8 @@ (define-module (guix ui) ;import in user interfaces only #:use-module (guix i18n) #:use-module (guix colors) - #:use-module (guix describe) + #:autoload (guix describe) (append-channels-to-load-path! + package-path-entries) #:use-module (guix diagnostics) #:use-module (guix gexp) #:use-module (guix sets) @@ -2200,9 +2201,8 @@ (define (extension-directories) (filter file-exists? (parse-path (getenv "GUIX_EXTENSIONS_PATH") - (map - (cut string-append <> "/guix/extensions") - channels))))) + (map (cut string-append <> "/guix/extensions") + channels))))) (define (commands) "Return the list of commands, alphabetically sorted." --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 13 18:53:35 2025 Received: (at 74633) by debbugs.gnu.org; 13 Jan 2025 23:53:35 +0000 Received: from localhost ([127.0.0.1]:53259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tXUFT-0004aE-IE for submit@debbugs.gnu.org; Mon, 13 Jan 2025 18:53:35 -0500 Received: from [75.171.110.13] (port=2373 helo=mail.kubisiak.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tXUFR-0004a1-T4 for 74633@debbugs.gnu.org; Mon, 13 Jan 2025 18:53:34 -0500 dkim-signature: v=1; a=rsa-sha256; d=kubisiak.com; s=s1; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References; bh=S4tSZZGEcgIaesZS23+xf3P+uLZ5CVU7DMAnVwSHfoE=; b=gJt74vkC3M8+BSALrQYYUZ7I6pK37ir08TFPEyZWP8bHLL+KxADgh5ZKnAcA3CFsczTq0rCKdgWeQqcKUoNCb2Pv1YGjKR2aNnk8eRIjAkGp1ZqoLifiWQruuk+t8//DkdOI8hOcsn6mGTIM87BAay3euA4LGKJjYDRtUV570Ps5e/1qFgF5ZqTcACDUyd12vdUgHevT6LP+zfcnUMJGwvmHcT2ZRgYk9AmlSaQjJaWnvQK6j9MgPhunS4 hfckQ7NcLiBRhICgCzFqEev0DqWNkv8+9r6iQQPQ+JjcyAU84GYdZok4IFVs6lkUGGkrgKAXM7duZsZs5ij/kGwSEJgA== Received: from peregrine (135-180-130-213.dsl.dynamic.sonic.net [135.180.130.213]) (envelope-sender ) by mail.kubisiak.com with ESMTPSA id for (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256) ; Mon, 13 Jan 2025 17:53:26 -0600 Date: Mon, 13 Jan 2025 15:53:25 -0800 From: Brian Kubisiak To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#74633] [PATCH v3] ui: Search channels for guix extensions Message-ID: References: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> <6a1ff2a779e9cf5248671fc9e62852aa23be3f16.1736299302.git.brian@kubisiak.com> <87v7umjxug.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87v7umjxug.fsf@gnu.org> X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > Overall it LGTM. I propose the mostly-cosmetic changes below. LGTM > Once thing I overlooked before is that commands will have to live under > /guix/extensions, right? > > (define (commands) > "Return the list of commands, alphabetically sorted." > (filter-map source [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [75.171.110.13 listed in bl.score.senderscore.com] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [75.171.110.13 listed in sa-accredit.habeas.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 74633 Cc: 74633@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: 0.3 (/) > Overall it LGTM. I propose the mostly-cosmetic changes below. LGTM > Once thing I overlooked before is that commands will have to live under > /guix/extensions, right? > > (define (commands) > "Return the list of commands, alphabetically sorted." > (filter-map source-file-command > (append (command-files) > (append-map command-files > (extension-directories))))) > > And likewise in ‘run-guix-command’. > > But now, if a channel provides ‘guix/scripts/foo.scm’, the ‘guix help’ > command will not show ‘foo’ but the ‘guix foo’ command will effectively > work (which wasn’t the case until now). > > Maybe it’s fine actually, I don’t know, but I thought this is worth > mentioning and thinking though. My intention was to use /guix/extensions since it's the same directory structure as existing extensions. I don't have a strong preference here, though I think Carlo intended to support /guix/scripts in #74425. Maybe it's a good idea to support both? Brian From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 24 17:32:11 2025 Received: (at 74633) by debbugs.gnu.org; 24 Jan 2025 22:32:11 +0000 Received: from localhost ([127.0.0.1]:47375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tbSDj-0007V6-0L for submit@debbugs.gnu.org; Fri, 24 Jan 2025 17:32:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43114) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tbSDg-0007Uf-Kl for 74633@debbugs.gnu.org; Fri, 24 Jan 2025 17:32:09 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbSDb-00045F-6t; Fri, 24 Jan 2025 17:32:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=8hDCdi6UkAynOeVJGlet18uCeGX895sW1gh/AV9mBUk=; b=Lx9DgzBykITayX1sWsje ZF1i6C2XHfoQAbNkW8dl2+c2Yst84yLpOdEZztx7+i/48T5xaTnebOKSZEp1HueyU7qU7CfrCGRup fwrSJkqg4IfYdgorR4LuruewSbpxnf5YxoOCj2CFwo/wrq2DSwGGQAhB27hn54gMzzLb7dFihwRu3 mMwQUB2hZ4eRkAUZH8zWLvfE7IrrGA6Q8P12bYohZLaGTPWKhklp6AU7QlTw0VebGJeCt8lmAVHq6 NYYKIP/Y/Amu+V3cZuSgi4HfcFzhjv+CJ0Wp4DcCGA0Gpe6I3XMUn4ssKkIMMZhNmufItrts6Xw2g mhEBO3iVL6/CJA==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Brian Kubisiak Subject: Re: [bug#74633] [PATCH v3] ui: Search channels for guix extensions In-Reply-To: (Brian Kubisiak's message of "Mon, 13 Jan 2025 15:53:25 -0800") References: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> <6a1ff2a779e9cf5248671fc9e62852aa23be3f16.1736299302.git.brian@kubisiak.com> <87v7umjxug.fsf@gnu.org> Date: Fri, 24 Jan 2025 23:32:01 +0100 Message-ID: <87jzajdese.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74633 Cc: 74633@debbugs.gnu.org, Carlo Zancanaro 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, Brian Kubisiak skribis: >> Once thing I overlooked before is that commands will have to live under >> /guix/extensions, right? >> >> (define (commands) >> "Return the list of commands, alphabetically sorted." >> (filter-map source-file-command >> (append (command-files) >> (append-map command-files >> (extension-directories))))) >> >> And likewise in =E2=80=98run-guix-command=E2=80=99. >> >> But now, if a channel provides =E2=80=98guix/scripts/foo.scm=E2=80=99, t= he =E2=80=98guix help=E2=80=99 >> command will not show =E2=80=98foo=E2=80=99 but the =E2=80=98guix foo=E2= =80=99 command will effectively >> work (which wasn=E2=80=99t the case until now). >> >> Maybe it=E2=80=99s fine actually, I don=E2=80=99t know, but I thought th= is is worth >> mentioning and thinking though. > > My intention was to use /guix/extensions since it's the same directory > structure as existing extensions. I don't have a strong preference > here, though I think Carlo intended to support /guix/scripts in > #74425. Maybe it's a good idea to support both? Yes, it=E2=80=99s probably a good idea to support both. In that case, the = only thing missing here I think is for =E2=80=98commands=E2=80=99 to somehow vis= it guix/scripts/*.scm coming from channels. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 17 10:41:59 2025 Received: (at 74633) by debbugs.gnu.org; 17 Feb 2025 15:41:59 +0000 Received: from localhost ([127.0.0.1]:47786 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tk3Fu-0007SK-FF for submit@debbugs.gnu.org; Mon, 17 Feb 2025 10:41:58 -0500 Received: from [75.171.110.13] (port=2679 helo=mail.kubisiak.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tk3Fr-0007Rm-UN for 74633@debbugs.gnu.org; Mon, 17 Feb 2025 10:41:56 -0500 dkim-signature: v=1; a=rsa-sha256; d=kubisiak.com; s=s1; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:MIME-Version:Content-Type; bh=jmVSgZgAB5blRPek6fQUrYKjolt4RZjTPTPhUFENap4=; b=QC20NaubcqQDsk4dw5K8G3hpumHVC1UToAo9ziMhI/kmU2X2llLDiync8rbhKtrocG6uwFTCTwNHftLT1IYf2yqNZH0vqnd8ZG2cYc3002QA6dfEJzcgpAZmT591T9x4IjtvOGV2RMWntwVkhSwUIqsIl6w+OAs7kWjZrvnedb93cON82BuYQAyFAcLC1X5eRUt+6M6i6L6KO5vo+LxzJhLUd86BM0AWIhiK+KVt3T9CLpFnocvYKk8mJg kikwtp4sdrD1Zvxdh58IxdH5zwMF6r4UDdCRXzQ7inPM8b/H/wXAW8gjR3IMiL0OuANS6CtZP/g621TbMe6kaCZjYJYQ== Received: from peregrine (135-180-130-213.dsl.dynamic.sonic.net [135.180.130.213]) (envelope-sender ) by mail.kubisiak.com with ESMTPSA id <6c9bd54fc741c8e31821b1506e261776b0829e43.1739806839.git.brian@kubisiak.com> for <74633@debbugs.gnu.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256) ; Mon, 17 Feb 2025 09:41:48 -0600 Date: Mon, 17 Feb 2025 07:41:46 -0800 From: Brian Kubisiak To: 74633@debbugs.gnu.org Subject: [PATCH v4] ui: Search channels for guix extensions Message-ID: <6c9bd54fc741c8e31821b1506e261776b0829e43.1739806839.git.brian@kubisiak.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/describe.scm (append-channels-to-load-path!): New function. * gnu/packages.scm (%package-module-path): Call new function. Remove the code that the function call replaces. * guix/ui.scm (extensi [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [75.171.110.13 listed in bl.score.senderscore.com] 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [75.171.110.13 listed in sa-trusted.bondedsender.org] 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 74633 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: 0.3 (/) * guix/describe.scm (append-channels-to-load-path!): New function. * gnu/packages.scm (%package-module-path): Call new function. Remove the code that the function call replaces. * guix/ui.scm (extension-directories): Call new function. Search channels for guix extensions. * guix/self.scm (compiled-guix)[*core-modules*]: Add 'guile-git' to the list of extensions. Change-Id: I53af828dc554485ca28389c9e2653ea6b4fb6b7e --- gnu/packages.scm | 7 ++++--- guix/describe.scm | 15 +++++++++++++++ guix/self.scm | 1 + guix/ui.scm | 27 +++++++++++++++++++++++---- 4 files changed, 43 insertions(+), 7 deletions(-) diff --git a/gnu/packages.scm b/gnu/packages.scm index bdd5d21940..ee99dea2ca 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -148,15 +148,16 @@ (define %package-module-path (let* ((not-colon (char-set-complement (char-set #\:))) (environment (string-tokenize (or (getenv "GUIX_PACKAGE_PATH") "") not-colon)) - (channels-scm channels-go (package-path-entries))) + (channels-scm (package-path-entries))) ;; Automatically add channels and items from $GUIX_PACKAGE_PATH to Guile's ;; search path. For historical reasons, $GUIX_PACKAGE_PATH goes to the ;; front; channels go to the back so that they don't override Guix' own ;; modules. + (append-channels-to-load-path!) (set! %load-path - (append environment %load-path channels-scm)) + (append environment %load-path)) (set! %load-compiled-path - (append environment %load-compiled-path channels-go)) + (append environment %load-compiled-path)) (make-parameter (append environment diff --git a/guix/describe.scm b/guix/describe.scm index a4ca2462f4..819f0fef74 100644 --- a/guix/describe.scm +++ b/guix/describe.scm @@ -28,12 +28,14 @@ (define-module (guix describe) manifest-entry-channel) #:use-module (srfi srfi-1) #:use-module (srfi srfi-34) + #:use-module (srfi srfi-71) #:use-module (ice-9 match) #:export (current-profile current-profile-date current-profile-entries current-channels package-path-entries + append-channels-to-load-path! package-provenance package-channels @@ -190,6 +192,19 @@ (define (package-path-entries) "/site-ccache"))) (current-channel-entries)))) +(define (append-channels-to-load-path!) + "Automatically add channels to Guile's search path. Channels are added to the +end of the path so they don't override Guix' own modules. + +This procedure ensures that channels are only added to the search path once +even if it is called multiple times." + (let ((channels-scm channels-go (package-path-entries))) + (set! %load-path + (append %load-path channels-scm)) + (set! %load-compiled-path + (append %load-compiled-path channels-go))) + (set! append-channels-to-load-path! (lambda () #t))) + (define (package-channels package) "Return the list of channels providing PACKAGE or an empty list if it could not be determined." diff --git a/guix/self.scm b/guix/self.scm index 2652688c71..28239d53f5 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -882,6 +882,7 @@ (define* (compiled-guix source #:key ,(local-file "../guix/store/schema.sql"))) #:extensions (list guile-gcrypt + guile-git ;for (guix git) guile-json) ;for (guix swh) #:guile-for-build guile-for-build)) diff --git a/guix/ui.scm b/guix/ui.scm index 87a448bf72..3cc15b05fc 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -2194,9 +2194,24 @@ (define* (command-files #:optional directory) (define (extension-directories) "Return the list of directories containing Guix extensions." - (filter file-exists? - (parse-path - (getenv "GUIX_EXTENSIONS_PATH")))) + ;; We need to resolve these lazily, because even using an #:autoload is too + ;; much and breaks compilation during "guix pull". + (define append-channels-to-load-path! + (module-ref (resolve-module `(guix describe)) + (symbol-append 'append-channels-to-load-path!))) + (define package-path-entries + (module-ref (resolve-module `(guix describe)) + (symbol-append 'package-path-entries))) + (append-channels-to-load-path!) + (let ((channels (package-path-entries))) + (filter file-exists? + (parse-path + (getenv "GUIX_EXTENSIONS_PATH") + (append + (map (cut string-append <> "/guix/scripts") + channels) + (map (cut string-append <> "/guix/extensions") + channels)))))) (define (commands) "Return the list of commands, alphabetically sorted." @@ -2284,7 +2299,11 @@ (define (run-guix-command command . args) (show-guix-usage))))) (file (load file) - (resolve-interface `(guix extensions ,command))))) + (let ((maybe-extension-path + (format #f "/guix/extensions/~a.scm" command))) + (if (string-suffix? maybe-extension-path file) + (resolve-interface `(guix extensions ,command)) + (resolve-interface `(guix scripts ,command))))))) (let ((command-main (module-ref module (symbol-append 'guix- command)))) base-commit: 0cd02f5e083abac280f6478cb8fda16a0a02e789 -- 2.48.1 From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 17 10:53:25 2025 Received: (at 74633) by debbugs.gnu.org; 17 Feb 2025 15:53:25 +0000 Received: from localhost ([127.0.0.1]:47861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tk3Qy-0008LW-Mo for submit@debbugs.gnu.org; Mon, 17 Feb 2025 10:53:24 -0500 Received: from [75.171.110.13] (port=1385 helo=mail.kubisiak.com) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tk3Qw-0008Ks-CO for 74633@debbugs.gnu.org; Mon, 17 Feb 2025 10:53:23 -0500 dkim-signature: v=1; a=rsa-sha256; d=kubisiak.com; s=s1; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References; bh=mdLWlG+z4zmny4EAQIn2BhnK+x6N8+/CpwCzKfRZ4c8=; b=YVcUoiLgaHilbAxG1JgG1axP/O9fQWCxkrXm0+TpaiKYrW5ey8q62itoRoxMoWRVfBSrJ5VlGuKf09NXrScd/JBiJZ6S5UUMIBVBAeOHjZdmUx8yze0aCmERC/8Qxrf4lBTK3FSGFqJ5JwC+Jl7FOTZWcCoKa7ghhFVWZm8x59GT2uEOBRS98z0Uoos/DLAt6N76nhdm8Qq5uHPpBJImQ4QD3e29zZYl/uUnwFZ9BWIf+3H20bQyQhME43 C3KxoAnhakLBnJ18Duy0ABYIrBfR/GyR0NgKCj8XIMqyn19Upk5D9q3svdXtyPa617i2q/R0SIsRBDk3Gc5tl+kUU12w== Received: from peregrine (135-180-130-213.dsl.dynamic.sonic.net [135.180.130.213]) (envelope-sender ) by mail.kubisiak.com with ESMTPSA id <5kgsxrxuoov5bouozoozxqqow6kanf3bsqhfmywnofcpoesbzg@obx3z4sbkfn2> for (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256) ; Mon, 17 Feb 2025 09:53:09 -0600 Date: Mon, 17 Feb 2025 07:53:07 -0800 From: Brian Kubisiak To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#74633] [PATCH v3] ui: Search channels for guix extensions Message-ID: <5kgsxrxuoov5bouozoozxqqow6kanf3bsqhfmywnofcpoesbzg@obx3z4sbkfn2> References: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> <6a1ff2a779e9cf5248671fc9e62852aa23be3f16.1736299302.git.brian@kubisiak.com> <87v7umjxug.fsf@gnu.org> <87jzajdese.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87jzajdese.fsf@gnu.org> X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > > My intention was to use /guix/extensions since it's the same directory > > structure as existing extensions. I don't have a strong preference > > here, though I think Carlo intended to support /gu [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [75.171.110.13 listed in sa-accredit.habeas.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [75.171.110.13 listed in bl.score.senderscore.com] 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 74633 Cc: 74633@debbugs.gnu.org, Carlo Zancanaro 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: 0.3 (/) > > My intention was to use /guix/extensions since it's the same directory > > structure as existing extensions. I don't have a strong preference > > here, though I think Carlo intended to support /guix/scripts in > > #74425. Maybe it's a good idea to support both? > > Yes, it’s probably a good idea to support both. In that case, the only > thing missing here I think is for ‘commands’ to somehow visit > guix/scripts/*.scm coming from channels. I've sent an updated v4 (sorry for the long delay!) that addresses this as well as the style fixes you suggested above. I've also continued to run into issues with trying to import (or autoload) the 'guix describe' module from guix/ui.scm and have resorted to Carlo's original method of resolving the symbols lazily to avoid the issue. Thanks, Brian From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 08 11:39:15 2025 Received: (at 74633-done) by debbugs.gnu.org; 8 Mar 2025 16:39:15 +0000 Received: from localhost ([127.0.0.1]:56329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tqxCk-0002Gl-Qu for submit@debbugs.gnu.org; Sat, 08 Mar 2025 11:39:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49314) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tqxCi-0002GQ-E3 for 74633-done@debbugs.gnu.org; Sat, 08 Mar 2025 11:39:13 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tqxCd-0003hL-0I; Sat, 08 Mar 2025 11:39:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Q+aL7Fa1AbLve/NilkH4XiGXx3J2JtF1l7XcY3E8Ivs=; b=G9iaoaxa9h8wV3UCydDu HK1XVwGF4BFORg7jndPjEZaKsIsm+eECX1AMW+IxKdyhE7JbF3fJYC3RSFeF777O3oHZFC5ULhkI6 NAYWOjc4LNkFwMur9eVwDOi3xSHkX4GNw2Jixmxz/czdde/5Sv3aGN7bkUe7hp9qnoC35/pEVao+A 8MnoNfCpA26DEnxGjUyIto/MPtyeHL3mrnUT2Dmfsh/5kQNXrB/3Nn3Ny0lwuEcbHEgUOZghxrLJH Y7xXW7Sx/ZeezJZsSiraKaXqJBrSvmw/ZTgN0t+iWU8IPci9+N5MPpwXT15xq4fzWxgbZRJ8birHE eqJZZgfCcQt84w==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Brian Kubisiak Subject: Re: [bug#74633] [PATCH v4] ui: Search channels for guix extensions In-Reply-To: <6c9bd54fc741c8e31821b1506e261776b0829e43.1739806839.git.brian@kubisiak.com> (Brian Kubisiak's message of "Mon, 17 Feb 2025 07:41:46 -0800") References: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> <6c9bd54fc741c8e31821b1506e261776b0829e43.1739806839.git.brian@kubisiak.com> Date: Sat, 08 Mar 2025 17:39:03 +0100 Message-ID: <878qpftr2w.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74633-done Cc: 74633-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 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Brian, Brian Kubisiak skribis: > * guix/describe.scm (append-channels-to-load-path!): New function. > * gnu/packages.scm (%package-module-path): Call new function. Remove > the code that the function call replaces. > * guix/ui.scm (extension-directories): Call new function. Search > channels for guix extensions. > * guix/self.scm (compiled-guix)[*core-modules*]: Add 'guile-git' to > the list of extensions. > > Change-Id: I53af828dc554485ca28389c9e2653ea6b4fb6b7e Finally applied, with the cosmetic changes below. Thanks! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/ui.scm b/guix/ui.scm index 3cc15b05fc..d462f7133e 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -2197,11 +2197,12 @@ (define (extension-directories) ;; We need to resolve these lazily, because even using an #:autoload is too ;; much and breaks compilation during "guix pull". (define append-channels-to-load-path! - (module-ref (resolve-module `(guix describe)) - (symbol-append 'append-channels-to-load-path!))) + (module-ref (resolve-interface '(guix describe)) + 'append-channels-to-load-path!)) (define package-path-entries - (module-ref (resolve-module `(guix describe)) - (symbol-append 'package-path-entries))) + (module-ref (resolve-interface '(guix describe)) + 'package-path-entries)) + (append-channels-to-load-path!) (let ((channels (package-path-entries))) (filter file-exists? --=-=-=-- From unknown Fri Aug 15 02:02:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 06 Apr 2025 11:24:12 +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