From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id iK3UCat4TGeReQEA62LTzQ:P1 (envelope-from ) for ; Sun, 01 Dec 2024 14:54:35 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id iK3UCat4TGeReQEA62LTzQ (envelope-from ) for ; Sun, 01 Dec 2024 15:54:35 +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=dztrdnN1; dkim=fail ("headers rsa verify failed") header.d=kubisiak.com header.s=s1 header.b=HbnQkUjC; 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=1733064875; a=rsa-sha256; cv=none; b=XqjiWjVrRZlEqG74qiYKPZAkw3kyMIx/eIJyM8jwvSZ2JTVD1awma8MhWljqAVdcJbuw6x OFv4VtT1//Z0MsMepRaux967Z50RYBJslENPqAhkkScqt/Jw+7AotvneHJaTUV/Y+HalZZ P6cQXeTV0lysu50EMscsAWv3tDvjv/shoVNkSeVjY2ANRdlipxMJsQdE5DohtF9R0t418h koSofeez5aq/ev5nFdS/bmaUetJY2Ugpz61m0ByzdUTvTTMiiEzfM80F2sltKg1FW8jZEy Ku4S0ASqozun4K3B4FlY42mGBL0KMgNZmtvcOM+tAwCwhPZA4x26ZMy+4HWt1A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=dztrdnN1; dkim=fail ("headers rsa verify failed") header.d=kubisiak.com header.s=s1 header.b=HbnQkUjC; 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=1733064875; 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:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=nrO2vr/Pk5PuR7Kjx3xqqcaJLkGHlwfbG8PtNeOprIU=; b=iCKJ71lFGibGp9PiUCp9yRmRm7ghVTGsGEeYmsL7OnPq5iTcmTlQ0xBTUFZI0u/uE4TCe8 vburZvPXZv2SMsEGsmsD7O6LEOtAXfsRMykTYqBXiee1sDJrQMXTh+4sSlP3lPjOz9tufI NaKSw6TlWuE7ypB9K3o41IOrVEjLiRcy+uwjKBoSC905jwxnPYgMD5BHEe3p5B5DIS4fnR AqygnoyaY+KAZgHv3bbXMuvt9qxIOGT0SXBtIkZLroI4wmOnyaVBn7dLrI2XXgYT77dO6x 7ifH96CZr/gVVIsQg4Hj9Eh9rZBdGCROIbJCb0sY2bfiRNq4NCznzFqff6/V8Q== 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 DE67E8687B for ; Sun, 01 Dec 2024 15:54:34 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tHlKt-0007U8-Ok; Sun, 01 Dec 2024 09:54:11 -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 1tHlKm-0007TP-8S for guix-patches@gnu.org; Sun, 01 Dec 2024 09:54:04 -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 1tHlKk-0000LB-B6 for guix-patches@gnu.org; Sun, 01 Dec 2024 09:54:04 -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:Subject; bh=nrO2vr/Pk5PuR7Kjx3xqqcaJLkGHlwfbG8PtNeOprIU=; b=dztrdnN1aZTvio7M0ZRHHIkAM7CZk9qwWgwT5HluXJYmWZxpBRx2Rn4dYvd3rucMgBDxlgDNEHj3Rujr1Yx8mRfspK+H5DBIA81T6wkhKwaNfHm1UCfsKzf8kvldALl+QC4ngcrui8C/REWJP65xedc1dKPGAiUuxRlb3ZbWrPvhHS2BNwNJ9m0pwrQ+EW7oKBuLlFacZcossqHWq3zIBNUzlKYXsPKbQup9FcSxaDGmCHrAyLpjghVfz+9dUoWaqTBFBFJTXoADwbkEVxJ3GtZOr+8XuYzMOxzIGq38nB3XGFHL96xBg+7loZW6hI/vo7FwYzjLW46qO3QXCAZPHg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tHlKk-0005Ra-5a for guix-patches@gnu.org; Sun, 01 Dec 2024 09:54: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: Sun, 01 Dec 2024 14:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74633 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74633@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.173306479220835 (code B ref -1); Sun, 01 Dec 2024 14:54:01 +0000 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 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-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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -2.61 X-Spam-Score: -2.61 X-Migadu-Queue-Id: DE67E8687B X-Migadu-Scanner: mx12.migadu.com X-TUID: LoRwHSyM1uHh * 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