From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id +PC6GuOpT2fm3gAAqHPOHw:P1 (envelope-from ) for ; Wed, 04 Dec 2024 01:01:23 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id +PC6GuOpT2fm3gAAqHPOHw (envelope-from ) for ; Wed, 04 Dec 2024 02:01:23 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=fMx1i1+z; dkim=fail ("headers rsa verify failed") header.d=kubisiak.com header.s=s1 header.b=hUzAxFYL; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1733274083; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=AH6JIRjzi49FCCL0Jpoc4LnKHcf98B+Q5Eavd7H2b94=; b=pNAaYBVYKgGbrvLgjuf/G3zznamT9fettymbDMGrxcePwhEJi63rZxX0oHtMlusw06pdTg XJQMMv+TyN9iGNdAxTMj0F7D4oRVmoeZ8O1zY7JsSFVPI1FNgG6LO4e/1qBIjmy07Cu54q eB2aHzQZYRMlTwoMkrovx8ykEoFD8+6ts+xNkAhu+ibQrTIXDh3hzPUIWu5Ho/wO9Rs0pQ QKRhQhZ1RuWPwI40AgCy4TozFF8DNFuDhiFOtUx8z4QAk3Np/nGdcvAcU7PbZjdOuU6Q4Y HRxpY3x6pDXQwmeh+5O1l78Ay1Iui91+DZX5+ylFunYAlTcJXhXOCd1PiMRzxg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=fMx1i1+z; dkim=fail ("headers rsa verify failed") header.d=kubisiak.com header.s=s1 header.b=hUzAxFYL; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1733274083; a=rsa-sha256; cv=none; b=Ro9+DzViy/WZ9wjXJNysyaxccxzrp2C6s8JoT7HSriOw6aTOVrr+dlkRDpg2qZTjnmfXj7 BxbzU0euOPHeO/1c6vAsO1+ArhxQwhx38StPp4b0jV3/Cg+8IFdHG/CyBpB2Vu/08nvUR+ 2ixNcWYPUJFiHfv/wvJWhVCIj67tyw7DTp5YIt6BDwHKJl/nvDhJ/a5Gc5OGIU0Leaot2E XHFNIoK0Aq5msXS8nQdTIlIbgx57SCm0X5NwSPsTMYTKAHKiztEYlr3okhH/qEvSse8ZvL jh2XKqi3bNbkeOm1zC4OerGYTTCTllNnnNP5wZPN08LKS11Wuo5SYOu21vRw6g== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D97FD85BE4 for ; Wed, 04 Dec 2024 02:01:22 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIdlO-0003p5-O8; Tue, 03 Dec 2024 20:01: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 1tIdlI-0003om-E0 for guix-patches@gnu.org; Tue, 03 Dec 2024 20:01:05 -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 1tIdlG-00006q-8o for guix-patches@gnu.org; Tue, 03 Dec 2024 20:01:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:MIME-Version:References:From:Date:To:Subject; bh=AH6JIRjzi49FCCL0Jpoc4LnKHcf98B+Q5Eavd7H2b94=; b=fMx1i1+zS6PqmaBd4QCVzm3x9b1Q15ufZxYXYNbAFh5A2IodnaY/27amyq4KTLf+Ha1GB91IcFxkLFSFHYwN5yXpEWLvQMWr5ZQl7415Q8vXZ/rmsZhTsPg3pG62U5oQU3w9wWDzpYHHWvXQ0MynqpwMpZz7H316ILD/uGKN/QiEwU7GV0qXJVDGn0YpO8QpzBgreW1fVotSRfFJqPY/9BGVPtwdkWbJO8XRLoELTNINrc7XpWJuXuy0IwN0qH+UF4S7BkX8OQkpQtwXGhX/Q5ggMlPMm/vmpn6K7g5xgUiVmfWDIaHWgR9UTZkVlITe5+dw2jFIJ8AyREYj2ElEBg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tIdlG-0006pC-3p for guix-patches@gnu.org; Tue, 03 Dec 2024 20:01:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74633] [PATCH] ui: Search channels for guix extensions Resent-From: Brian Kubisiak Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 04 Dec 2024 01:01:02 +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: Carlo Zancanaro Cc: 74633@debbugs.gnu.org Received: via spool by 74633-submit@debbugs.gnu.org id=B74633.173327400525684 (code B ref 74633); Wed, 04 Dec 2024 01:01:02 +0000 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 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-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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -5.23 X-Spam-Score: -5.23 X-Migadu-Queue-Id: D97FD85BE4 X-TUID: 990bO1DMkyJi 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