From patchwork Fri Jan 10 19:03:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 36875 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D72FE27BBE2; Fri, 10 Jan 2025 19:04:20 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9F45727BBE9 for ; Fri, 10 Jan 2025 19:04:18 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWKIf-0001Dk-CZ; Fri, 10 Jan 2025 14:04:05 -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 1tWKId-0001C2-Hh for guix-patches@gnu.org; Fri, 10 Jan 2025 14:04:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWKId-0003Hu-8b for guix-patches@gnu.org; Fri, 10 Jan 2025 14:04:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=Iu23VHIf/bKTLJF1Vcua3Z6hfYs0vH6+bgEJeQ2w08g=; b=eODct34dgQlnM1yJBtDdqQBvFC3huINtnHXgoDscecGESe5eNoMAfMaX8c1IxP3sAHfR68tKVLrdMYUqGtchB/B4eXUm2pycPrAIjurMABCm9O26Tc5jfXpCZ+IrrQx1HINsnRS6ZLJyKK1zAqYH1ek09XI/986RynZxzxH9Pm1z0889YMJYerAq9MCJCHb83iMIwylFfqKIBlV83TVsEbgpD5q9r6c2cvVDlWVJTLUpvNOHt+rb95cMVqCoaXX9fie4hXFJRNmtc2u4MZPTV5UwzQjOrGoQqKyZGITnjrl+G0JynkE8bT8Ekxn7IjaH02LjvnfmQhjFWUvwFa22iw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tWKIc-0002Qv-1i for guix-patches@gnu.org; Fri, 10 Jan 2025 14:04:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74633] [PATCH v3] ui: Search channels for guix extensions Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 10 Jan 2025 19:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74633 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brian Kubisiak Cc: 74633@debbugs.gnu.org Received: via spool by 74633-submit@debbugs.gnu.org id=B74633.17365358009271 (code B ref 74633); Fri, 10 Jan 2025 19:04:01 +0000 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: Ludovic =?utf-8?q?Court=C3=A8s?= 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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 ‘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. WDYT? Ludo’. 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."