From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.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 kOiwIUrGbWf93wAAe85BDQ:P1 (envelope-from ) for ; Thu, 26 Dec 2024 21:10:34 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id kOiwIUrGbWf93wAAe85BDQ (envelope-from ) for ; Thu, 26 Dec 2024 22:10:34 +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=m8zf5pTd; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=H6On5hmI; 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=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735247434; 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: content-transfer-encoding:content-transfer-encoding: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=EJhQIpzrCZ6S0AYAiZ7O44b49JFJaKTD8IO96MQgQNI=; b=oT6kc4eCQcb3DUO8rQsh14P2CmS3Sf2odmd4UDmbnnBrg5SdW8AcaxrSl1muYFsa3LGkMb HRFNFACsNMWA9DrihuRcuP/V8O+WNzfKeHu7Lqe4uZHTUks6vKWpaBZl4lWiRQsLbAsIUC t2sC6Bfl2YPhU+KJrNuZzW81hvOE0PSYl/kXHFLDSy7S5eQy4AjIVjc0tAQMMGlsBm5FVd byeiO2depy0EMjYg5MFMDHXl5XZ1P/YeO5o3XWOegCEbDJr2UqmTL3lKSrvMGJeYuXEREt roI2PA1j8hC9pShwD6g3qyiJzfCou9ek/V4tbuy84FrZP2VC4rWutf1/l7v4dA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=m8zf5pTd; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=H6On5hmI; 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=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735247434; a=rsa-sha256; cv=none; b=N3kFq9wuEe1GdYaQXdpLVUNRrYNbswm5CguwBEND1D6AjPj6HtmhPSBflPTtgjFumUtL5p MzxU6wPTQb4Mb3ol/6LQiX/jS/Yl6s/Ypd6mpo2k6k5b2FExuf+0VLqwMQf4zC7MkdqTjP CbQJESa2M68n8bn9lOtK+R+GhFlrMM43FjEBiElWdxODsdapvm5vNOnJxKGMDFOgo0Hl2C uKxd+Agn89fMj8LvZm7o11C3bp8c4+vnDemZzTzS2GRZDCbIn2AIaMCueyCD77jTEa+SIV 6ti7kMiVuqOEr5Z/7JBUg5ecAzokAYu3pHwFaef08Eagb4zDf9hlPjoPGiQpLw== 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 716412C49 for ; Thu, 26 Dec 2024 22:10:34 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQv7N-0002n2-Nv; Thu, 26 Dec 2024 16:10: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 1tQv7M-0002mq-0A for guix-patches@gnu.org; Thu, 26 Dec 2024 16:10: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 1tQv7L-0001vs-MQ for guix-patches@gnu.org; Thu, 26 Dec 2024 16:10: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=EJhQIpzrCZ6S0AYAiZ7O44b49JFJaKTD8IO96MQgQNI=; b=m8zf5pTd4oKZeluElEDldb3JQOaJIOdiG+RFbJo2SiaykogY05AB+lOAkVfxk+4J1ChoitSUXenDIkbSkTHIdzTzsrxvGIA7gwIgG66GVNYB2gwkz4ecBk3GjMmPZF2V08KGeXb0sjpqRlDWPKA75FjB9lwjbl0GTCIbXNeUv5omPPN/6dYZ2yr8LRZl4bSwp18JdLOZUhuHcBlRZDhY+C/38eSVCDJAiX3tlxekYuYAyhNhWM2OhoCRLp5mBD2Y2slrYRg02PWKTHWUydwfzNa417bl6RWAWOyJTxBGKpd4PX+ND/nbSVJdwZ40HOW8OafENIibmH2CqN6D4AFHLw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQv7K-00026M-GF for guix-patches@gnu.org; Thu, 26 Dec 2024 16:10:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74633] [PATCH v2] 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: Thu, 26 Dec 2024 21:10: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: Brian Kubisiak Cc: 74633@debbugs.gnu.org, Carlo Zancanaro Received: via spool by 74633-submit@debbugs.gnu.org id=B74633.17352473477962 (code B ref 74633); Thu, 26 Dec 2024 21:10:02 +0000 Received: (at 74633) by debbugs.gnu.org; 26 Dec 2024 21:09:07 +0000 Received: from localhost ([127.0.0.1]:42432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQv6Q-00024L-Vu for submit@debbugs.gnu.org; Thu, 26 Dec 2024 16:09:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQv6O-00023m-5n for 74633@debbugs.gnu.org; Thu, 26 Dec 2024 16:09:05 -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 1tQv6H-0001sk-9r; Thu, 26 Dec 2024 16:08:57 -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=EJhQIpzrCZ6S0AYAiZ7O44b49JFJaKTD8IO96MQgQNI=; b=H6On5hmIn5Aenxv+q4ok RVBQ5kuOSqDL0fKTXnWkiChpoL2MXgtXJT3DdoSZaV8lWdZu8fHybc4ndv/8YAsz6ORQ/PNvoEnj3 WUpNT+vTnYe5UE0Z0gI9SKh8awfBHBhza/96rJ7bOgg+rZNNZMHDliNvET91jzpTkVVRWm8OGSVkC 03WOOo8r6lSL2HWq4TE/P3h8Dt/prJOVJR60x+cQFLSXarrU8y5QXJOtFOEYxj6PKDuasqqsVeHju zaQSKuPW4IYs6xf6X34YGM14J2dWaXIiq/mzTsOoAffVGeh8oQksipbXtFE4wWem9CepmN5P/cKUh kBh6vt8DhjoGxQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <2c078699007e847611b7a20679621813691d9db3.1733695255.git.brian@kubisiak.com> (Brian Kubisiak's message of "Sun, 8 Dec 2024 14:03:45 -0800") References: <2fc5afe876af28643f8074dd1623640cb314cc5e.1733064752.git.brian@kubisiak.com> <2c078699007e847611b7a20679621813691d9db3.1733695255.git.brian@kubisiak.com> Date: Thu, 26 Dec 2024 22:08:52 +0100 Message-ID: <87plle17a3.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -2.61 X-Spam-Score: -2.61 X-Migadu-Queue-Id: 716412C49 X-TUID: 86K51ZH1wcJt Hi Brian, Brian Kubisiak skribis: > * 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 Overall LGTM. I tested it with =E2=80=98make as-derivation=E2=80=99 and it= works as advertised; =E2=80=98strace -c=E2=80=99 shows that the number of syscalls i= s comparable to that we currently have. A couple of minor comments: > +++ 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))) This variable is now unused; I think it can be removed. > +(define add-channels-to-load-path! > + (let ((promise > + (delay > + (let-values (((channels-scm channels-go) (package-path-entrie= s))) > + (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 ev= en if > +it is called multiple times." > + (force promise)))) For clarity, I would call this =E2=80=98append-channels-to-load-path!=E2=80= =99. Using a promise here works, but I find it slightly misleading (because we=E2=80=99re using it for side effects) and a bit heavyweight (promises are thread-safe, so there=E2=80=99s a mutex etc.). How about this: (define (append-channels-to-load-path!) (let-values (=E2=80=A6) =E2=80=A6) (set! append-channels-to-load-path! (lambda () #t))) ? Could you send a v3 along these lines, if you think that makes sense? Thanks, Ludo=E2=80=99.