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 OHoIJ5TTfWcsagEAe85BDQ:P1 (envelope-from ) for ; Wed, 08 Jan 2025 01:23:32 +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 OHoIJ5TTfWcsagEAe85BDQ (envelope-from ) for ; Wed, 08 Jan 2025 02:23:32 +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=Ez5GAOt8; dkim=fail ("headers rsa verify failed") header.d=kubisiak.com header.s=s1 header.b=kRxUvGjG; 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=1736299412; 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=I/HLI0WgpjXIb5hF9dcOAD8f5y7OGug/3heWVAuhw/8=; b=LKwV8pAY/Z0/SlGdC2moH/fFvnZKMzjJHuDChWXyC0KvuXvBruhS605MgTn1Bq7ZgZph9Q VXWywgw0Wq82ZzChmyEaxq9kqHuDEqPXENWedIsGewINw7IPmVMSqrropjlQSwJxApVqFV p5Fp3z0AlvdcecWeWr8VikcFfZ9AgxPJyhcfWVZ80nCRPBDrzbMbojFY4lzMxKwHABuwsm g0aW/BDh5YIAf850dMZzTGJUnrIP1vtYR8WMdKrGqeQH8C3Ri4MnvhP2mqBl5h2Yek1D6l C3N3+Vuoi3GAUGjirCGklMh4bznFONn9ad8Axeuv2D8S951yAIT9OGIfO1M1Ew== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=Ez5GAOt8; dkim=fail ("headers rsa verify failed") header.d=kubisiak.com header.s=s1 header.b=kRxUvGjG; 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=1736299412; a=rsa-sha256; cv=none; b=lfzrbrycbvBd/48E67WILPyGPuSlmNsf1lZjMlhkY7ppNWQUt8oe9JMaEfl1fnR8d+1H6Y y9MzvC7BMCIvPPmWF7zoCx/bxZPrcxKM+qhRvvR7KDHm1hlEUvPcb7K91qBuOLXyp254EY stXwJ2IypkZ/6wCzbGeeuB7sIVouxfhiQZVoIONhqHnMEX0SCyXWqGxxCT/jPhnlveNaJ5 /Hta7fq2XoL4+ArQXTRg+kMkjL6XOkGdT7YirtjA0PZNew514H4JYIBwHcj3SucFMuRS66 ELLn6SzM0klU915L7fmpFACDlJcarZ72pT5YqWZ5tqvGSPouppLax180+hvW2Q== 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 25B8E196C2 for ; Wed, 08 Jan 2025 02:23:32 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVKmo-0008Mq-2R; Tue, 07 Jan 2025 20:23:06 -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 1tVKmk-0008MX-Gd for guix-patches@gnu.org; Tue, 07 Jan 2025 20:23:02 -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 1tVKmk-0005h9-8L for guix-patches@gnu.org; Tue, 07 Jan 2025 20:23: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=I/HLI0WgpjXIb5hF9dcOAD8f5y7OGug/3heWVAuhw/8=; b=Ez5GAOt8o+i6C6SoAqMuh946f+dpapC+70t9xXz6Wbdp5nLba5HHQh8774S8/5x+A7X7fMYW5Q8SRLzQq7ULymS4ru00j69oqcNQ+Njpi1PQLkVByDZial6TXk480bxQnltyBP4QqtTkNn083gsILwSnmsNMIOcVjMWjp9dBA/MY1tHWA16b9Gaq/8QqpTlsUuOaYE1CsKTsBTNAObcv2aw61hYrhdHFx3IlqenfvJIdfkxbmfBh//dEHmvFsQFm7Ft7fS9KFG2MtjAOYAZTKaiVJ9ITN04osA9ii1gfHP8NFUHz26D6zAB84MPHCydRGikt2ZvVjcxUC1EpT8NjlA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tVKmj-0003Bq-QW for guix-patches@gnu.org; Tue, 07 Jan 2025 20:23:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74633] [PATCH v3] 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: Wed, 08 Jan 2025 01:23: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: 74633@debbugs.gnu.org Received: via spool by 74633-submit@debbugs.gnu.org id=B74633.173629936712233 (code B ref 74633); Wed, 08 Jan 2025 01:23:01 +0000 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 Message-ID: <6a1ff2a779e9cf5248671fc9e62852aa23be3f16.1736299302.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: -6.92 X-Spam-Score: -6.92 X-Migadu-Queue-Id: 25B8E196C2 X-Migadu-Scanner: mx10.migadu.com X-TUID: hsVNMgoZNYsi * 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