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 6NXzJavBP2cQJAAAe85BDQ:P1 (envelope-from ) for ; Thu, 21 Nov 2024 23:26: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 mp2.migadu.com with LMTPS id 6NXzJavBP2cQJAAAe85BDQ (envelope-from ) for ; Fri, 22 Nov 2024 00:26: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=bYUX2mqv; dkim=fail ("headers rsa verify failed") header.d=zancanaro.id.au header.s=k1 header.b=mDT8jwpL; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=zancanaro.id.au (policy=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=1732231595; a=rsa-sha256; cv=none; b=Zc5+hP/jkfA5bNVPdV1ufbsdLU3c+5JJ6/X1V0e3w2kH7rSr3cvWNmo8OLCqY6raYQRe+J AXY36bjo0IH+P2eH6r3DudGrjLDvAA//dgUHx1bsrNWv84d1gshfgkDZdkR4ULYM8SYE52 4JN807UgYAY7SbN5SqH4R5FhZJd0UnMCiYXui3oFy/tjj5OhZUmdfZ4RTW5ANY0HketK0F 8DCHZ6u9Dx725sIuPy6qpg1g/aWxV7VqT3WAO/DHlcve1F+3fhJNnlS3KeJaWNfVYx7VFP J6wSL78Q1Jb/T1aLxoAQ1dYCucPpq/8Buki5cwA4e7/z3XLz1MiZE4RQEQT/wA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=bYUX2mqv; dkim=fail ("headers rsa verify failed") header.d=zancanaro.id.au header.s=k1 header.b=mDT8jwpL; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=zancanaro.id.au (policy=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=1732231595; 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=kcZcF91iKGwCmEQcpnx4+XTBarzgFYCTit4ESJiyIZE=; b=XBVVAlB1LDm6c92UJkzIm4XRzKq7QZ06C/OhYshfpIU9zvim3yu1WlCSM3kPLMvWhLRgFF 7qbEd1zAxNEl1SH+PDpArLEM1JafXL21bm8ayKtnVWQoOIGjHHgmhKbAWkcZPCO+rTRpHC ePP1Lykshie6sXS+Uk8bf6jOJF58lR0uSYTYGXNf6BG/5ofWh9Zu/pTl8C2BeudMKyVEsb UlXXmVFkRj4aeYaNL09sZwex6RkaoTgLLRgTKtb188oGiSVLh0JMs01aYyJSDrxMQbF3+P z0JBKZUPOQ3GywyH8qFOPPMpIZj5xJRqfZd/FqGjnoFC0j0FHVKe3c+fz7imSQ== 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 EDAA03BDF for ; Fri, 22 Nov 2024 00:26:34 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tEGYl-0005Cb-Ux; Thu, 21 Nov 2024 18:26:03 -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 1tEGYk-0005CG-60 for guix-patches@gnu.org; Thu, 21 Nov 2024 18:26: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 1tEGYj-0002nk-U7 for guix-patches@gnu.org; Thu, 21 Nov 2024 18:26:01 -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=kcZcF91iKGwCmEQcpnx4+XTBarzgFYCTit4ESJiyIZE=; b=bYUX2mqvjCoyc6P2inN68JulkYSVYdI5JTIzmZInu9U11p2zZyRMaVxbmjAKG1H9OguCv9yeVAHEWG0KMZe61RrX1kkLo7tm/5XhPRVdkZTgPftH+oqJj2fkatWs93FqZSlSh8xuP6u1YKTp2NKYG6x1IXvuIhzlOR6SEE/pR8vUolVfMe8pa9KynjrBq2k90Pxas5xbJRHbZBs5o/BwpBKeaqfdjOuBadjsRfhStg/6iveJQkxotoMOfB3ahJ3bDYeR/xT1+NOt4m3uyzpYkA9G6zTBAaTgRTMBKTdoWilu38gpiggFXeIXDzBwijqw+RV7VEl99QXL97moD0sdsQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tEGYj-00051P-LL for guix-patches@gnu.org; Thu, 21 Nov 2024 18:26:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74425] [PATCH] ui: Include channels in load path before searching for commands. Resent-From: Carlo Zancanaro Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 21 Nov 2024 23:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74425 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , 74425@debbugs.gnu.org, Christopher Baines Received: via spool by 74425-submit@debbugs.gnu.org id=B74425.173223152719255 (code B ref 74425); Thu, 21 Nov 2024 23:26:01 +0000 Received: (at 74425) by debbugs.gnu.org; 21 Nov 2024 23:25:27 +0000 Received: from localhost ([127.0.0.1]:52120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEGYA-00050U-V9 for submit@debbugs.gnu.org; Thu, 21 Nov 2024 18:25:27 -0500 Received: from voltorb.zancanaro.id.au ([45.77.50.64]:49958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEGY7-000506-N2 for 74425@debbugs.gnu.org; Thu, 21 Nov 2024 18:25:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=k1; bh=kcZcF91iKGwCmEQ cpnx4+XTBarzgFYCTit4ESJiyIZE=; h=date:references:in-reply-to:subject: cc:to:from; d=zancanaro.id.au; b=mDT8jwpLH/SCXhHOB+Vxg8cysnfIbNoOnUBPI kvVgE47l4W+j3IOfuFwdSFvQtRC0dY0Yk4eiZIKvcOafuRqW2McIpK3Qwzh6+Lhcn9dpKm L8+sD1zhd2egYvECOejMFKQLs98T+tW3kp/upyZgNrMqF+wcMR3DTveNItCCBxz4= Received: by voltorb.zancanaro.id.au (OpenSMTPD) with ESMTPSA id faa7e0e7 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 21 Nov 2024 23:24:40 +0000 (UTC) From: Carlo Zancanaro In-Reply-To: <87jzcwss1j.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 21 Nov 2024 13:14:00 +0100") References: <87jzcwss1j.fsf@gnu.org> Date: Fri, 22 Nov 2024 10:25:15 +1100 Message-ID: <87iksgxj8k.fsf@zancanaro.id.au> 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-Spam-Score: -0.52 X-Spam-Score: -0.52 X-Migadu-Queue-Id: EDAA03BDF X-Migadu-Scanner: mx12.migadu.com X-TUID: CXj4MY4n6Ot/ On Thu, Nov 21 2024, Ludovic Court=C3=A8s wrote: > I think you could do: > > #:autoload (guix describe) (package-path-entries) > > instead of doing the trick above. I tried that, and it breaks "guix pull" (as mentioned in the comment in the code). I don't have the specific error easily accessible, but I think it was "no code for module: (git)". I assume it was an issue with how build-program in (build-self) puts things together, but I wasn't able to investigate further than that. > 1. The =E2=80=98%load-path=E2=80=99 and =E2=80=98%load-compiled-path=E2= =80=99 modifications can now be > removed from (gnu packages), after checking that GUIX_PACKAGE_PATH > still takes precedence. With this change, (extension-directories) does not include the paths in GUIX_PACKAGE_PATH. Perhaps it should, but I wasn't sure given the distinction between GUIX_PACKAGE_PATH and GUIX_EXTENSIONS_PATH. Do we want to run commands from GUIX_PACKAGE_PATH? Or load packages from GUIX_EXTENSIONS_PATH? At the moment I think the code says "no" to both. My other concern with removing the code in (gnu packages) is that it may break code that is using Guix as a library. That is, something like this: --8<---------------cut here---------------start------------->8--- guix shell guix guile -- guile -c '(use-modules (gnu packages)) (pk (find-p= ackages-by-name "guile"))' --8<---------------cut here---------------end--------------->8--- might not add the right things to the load path. That said, the current patch will add duplicate entries to the load path when using the Guix CLI, which also isn't good. Perhaps this needs to be factored out into a single place where we can keep track of whether we've already added to the load paths. > 2. The performance impact of this change must be tested, in particular > the startup time of =E2=80=98guix=E2=80=99 commands since they=E2=80= =99ll now be loading > (guix channels) & co. unconditionally. > > One way to do that might be: > > PROFILE=3D$(guix time-machine -q --url=3D/path/to/checkout) > guix shell time -- time $PROFILE/bin/guix build --help > strace -c $PROFILE/bin/guix build --help >=20=20=20=20=20=20 > Could you give it a try? Sure! With the change in my patch, I'm seeing: strace: number of calls and errors is roughly the same both with and without my patch. time: all the numbers look pretty similar with and without my patch. I haven't done any statistical analysis of the various values recorded by strace and time, but the numbers don't vary *too* much between runs, so I'm fairly confident this isn't having too much of an effect. I also tested leaving off the "-q" in the time machine call (so my other channels were also included), but this didn't make any meaningful difference to the numbers when running "guix build --help". Carlo