From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id qLyYNOgXVmct8gAAe85BDQ:P1 (envelope-from ) for ; Sun, 08 Dec 2024 22:04:25 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id qLyYNOgXVmct8gAAe85BDQ (envelope-from ) for ; Sun, 08 Dec 2024 23:04:25 +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=atOYO8ht; dkim=fail ("headers rsa verify failed") header.d=kubisiak.com header.s=s1 header.b="KKW/SlDk"; dmarc=none; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1733695464; a=rsa-sha256; cv=none; b=dF6ersLDijTPM34Q4UQamFxj4A4m29GunIddweKeal8mGpZl24To0G9U5SGREj5I5Q4SbE FCC/wv0w42jUe9YfuWKOla22Dpb9z4MyxWDfUtWOKozINYqMF/D9szDGO6VRxGT70HTXPT 9cK+Gnj2/OtFOGTMb+SoD/LUc43bj8/sedGzErUBH2pPS7eZJ/gY1YcGMEG323shvvll+9 WlMqqyNQE8OlVTyqIcmSHInrlTnrRbGoJcACtoRZZMqmqe8DocXhsIuwoonwIjZkaU3cF2 Ju3+dZHL7mQEwR0iNQhBeGbJPnGZ2G3OqUWAbeiZ/cbrEQJYFsrNWSVGHChMCg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=atOYO8ht; dkim=fail ("headers rsa verify failed") header.d=kubisiak.com header.s=s1 header.b="KKW/SlDk"; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1733695464; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=uTDgIeei+nonM3f78WhRKqXuUHtju5VaSw4vGHPL6ro=; b=lcaBWkUCHXaLC+OoI4Qjg4OTpD3xIHynFrJiHNZzO1vNUJC4Qj83q2wfLR/yglHMtXfmJe azYF0/lYcnogERqIiFgYZGoYAzlM/+HM5VkXfRwJnG8vqsvJHOuZv8/Rr6nCsqsQ8u161e Cv0Dm2unLWa+PIwry++C//g5Xj01vPaeG+L9QwW6/y4YzRJapNdHX8fyDrpvtMtHw59o6U nNnpm4qevLPVjhU8AC6abydw7y2bLsB/u9m923IEPAVEXETrBXhbarAkGlUhxdq9WFQiLy FQ9zxa19yvCe8PJu1lh5oFc6Wi7i+KCKfLII0wpL8R3RPvHRDmLou3hgv5u0EQ== 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 6BA3782E30 for ; Sun, 08 Dec 2024 23:04:23 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKPNk-0001wl-Kt; Sun, 08 Dec 2024 17:04:04 -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 1tKPNi-0001wc-Tb for guix-patches@gnu.org; Sun, 08 Dec 2024 17: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 1tKPNi-0001jz-Ko for guix-patches@gnu.org; Sun, 08 Dec 2024 17:04:02 -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:From:Date:To:In-Reply-To:References:Subject; bh=uTDgIeei+nonM3f78WhRKqXuUHtju5VaSw4vGHPL6ro=; b=atOYO8htYGBmdjWTK1FrPhKSSKI6Y1YZKvbBkO0hKzFRm0FRWvFdCv1aaOtZ0DfL92qJDByEX9fH+ScFhLT8FQDctMRaCl7rOFul/+NXomCBAFPC5pGBx/10Un8ns3SvqoOQwlLGTaXJLEraUKa9Insx8rtX9kIKZ09TFJ7p7AWUgZ4/OR7iXfZqkLdOWIjgX6RfJ7IJICvl2jNMHHZugN4liMuYeJws96oX4DzC6AprEh+NVMVsfH08Wf2CERALT94UftHYjrUWa/I+VUHd81wr3ey1TW0rLcLUJdHDOOvEDsOJNfARsf20Rt5W+GnvO1F9vLro0fhcU29ziN5O9A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKPNi-0001zn-3f for guix-patches@gnu.org; Sun, 08 Dec 2024 17:04:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74633] [PATCH v2] ui: Search channels for guix extensions References: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> In-Reply-To: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> Resent-From: Brian Kubisiak Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 Dec 2024 22:04: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: 74633@debbugs.gnu.org Received: via spool by 74633-submit@debbugs.gnu.org id=B74633.17336954377655 (code B ref 74633); Sun, 08 Dec 2024 22:04:02 +0000 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 Message-ID: <2c078699007e847611b7a20679621813691d9db3.1733695255.git.brian@kubisiak.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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-Spam-Score: -5.56 X-Spam-Score: -5.56 X-Migadu-Queue-Id: 6BA3782E30 X-Migadu-Scanner: mx10.migadu.com X-TUID: A6Efwet2MxXr * 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