From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id wA2GGjXYoWUoVwEAkFu2QA (envelope-from ) for ; Sat, 13 Jan 2024 01:24:21 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id OLZ2EzXYoWXdKwAAqHPOHw (envelope-from ) for ; Sat, 13 Jan 2024 01:24:21 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=illucid.net header.s=fm1 header.b=Bo81GCZj; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b="7 zfJPsW"; 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=1705105461; h=from:from:sender:sender:reply-to: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=+cY6Vx1Pj2UgZ0AKiNmsdqy3AX07UIuvmShB1Qfbmpc=; b=tXZm6EKQxSKRzeCVHiOAhhEetX1Y+qVjWwAeu1EkD9bjUH4p9ZEY6/ijXMTiop2Fk9t+Kc +yg9MqXEpFNVmOk103waz0DvkzrRQ00CHZvUidbRGKTE3wrt5tqCjssPwXWaTpiY9s7C5b j4ap4i95ORTLgTUtinV1rVdb9bIQmDDnd/ICy19qzJlyyfwNnF7FG6ZPspq32qiKSiHIDm yxiHKYhbZp5FpOHpbflkOE7WgXJQmeg4bh63L4A4W6bMDHVbgLjd5u+B0u2A/yWq8yfX+e LBiqUdY7zHinVWOx/f2l+Rid06aN9wV5u2zoQMQr8Muo8wASpEeb//5YzbcHgw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=illucid.net header.s=fm1 header.b=Bo81GCZj; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b="7 zfJPsW"; 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=1705105461; a=rsa-sha256; cv=none; b=iFaAG1TIPCUmfNQxp/KSOQ+7Gz9peZUHkTpsdtH92xoekaoGZVdeQ1VjNc7PyLqvpOhfNz dismGXMJ98apRvQiUzGSxDhZXN03q7cGbGl5m/XHT5Co5nrh398rgUbwlP8RKRVse2SHsP Jqus76xOnv2TAPzozviv7DMtIE/Xk5jp9+RYlBwm4VDLJvJj5rf+J7v/8fqqeiMPAyrFtH 68iVipTZmXK7guAR4kr9L14dj4mv9KypoW1Lfva6z+oYxYpMXXtABrJNK3GbsMUb7nivMm 3Au7SnGcAgEsrkPtEjFM2W0lIGlE9dFcD3Qmx1jnxKgV5KwJF3wkVIDTIpJ0mQ== 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 6BFFF38743 for ; Sat, 13 Jan 2024 01:24:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rORom-00006o-42; Fri, 12 Jan 2024 19:24:08 -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 1rORoj-00006b-AQ for guix-patches@gnu.org; Fri, 12 Jan 2024 19:24:05 -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 1rORoi-0004yp-AE for guix-patches@gnu.org; Fri, 12 Jan 2024 19:24:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rORog-0004Sh-7b for guix-patches@gnu.org; Fri, 12 Jan 2024 19:24:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68163] [PATCH] gnu: Prevent stale cache use when `%package-module-path' is parameterized. Resent-From: antlers Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 13 Jan 2024 00:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68163 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimon.toutoune@gmail.com, 68163@debbugs.gnu.org Cc: dev@jpoiret.xyz, othacehe@gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= , me@tobias.gr, rekado@elephly.net, guix@cbaines.net X-Debbugs-Original-To: "Simon Tournier" , "antlers via Guix-patches via" , 68163@debbugs.gnu.org Received: via spool by 68163-submit@debbugs.gnu.org id=B68163.170510543817141 (code B ref 68163); Sat, 13 Jan 2024 00:24:02 +0000 Received: (at 68163) by debbugs.gnu.org; 13 Jan 2024 00:23:58 +0000 Received: from localhost ([127.0.0.1]:37998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rORoc-0004SO-CZ for submit@debbugs.gnu.org; Fri, 12 Jan 2024 19:23:58 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:44013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rORoZ-0004S9-5w for 68163@debbugs.gnu.org; Fri, 12 Jan 2024 19:23:56 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id BD18F5C0199; Fri, 12 Jan 2024 19:23:51 -0500 (EST) Received: from imap44 ([10.202.2.94]) by compute5.internal (MEProxy); Fri, 12 Jan 2024 19:23:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=illucid.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1705105431; x=1705191831; bh=+cY6Vx1Pj2UgZ0AKiNmsdqy3AX07UIuvmShB1Qfbmpc=; b= Bo81GCZjjIMDsb3PgTMg39U/UOak8sdorVDOboJleJXSTZ7sKhk/rjTtucMbqW5W kmo782oE2UPlxNFNlAvdzCYrF3TJBQLsk1vuBb369nfuM4a6frV8N9YLcuEGdFb4 PgD9fwAyBVQrmyStKJahZLbmnLK/QI1/LKZe/BVvno/q8OIedP7zmUnP+MjnQZ4Y gCH6zrqqkSYGY1YThMm64T3xZ+zMK7a7o13ifmTvy1QrBfj6KeYuDuV5jiy1rIrB dyj5PYlXYFgCy9Nhd5pxYrK6HZS9Be3gwpqUJvHGeRCQjNEWw2DNyn4Cm3JlZ8kz NE9YDXejTd/15p+ThZQ+tA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1705105431; x= 1705191831; bh=+cY6Vx1Pj2UgZ0AKiNmsdqy3AX07UIuvmShB1Qfbmpc=; b=7 zfJPsWsJ6CXmZxdDqBpUbOmicqw3PXmIqetpabO9v5BrFai/nbOkxuitoxLGr5ZM omLP3+HnYdB0X1R3jL/j0LhygUhYPxje155CTtp+eVaSbTDt36Nvx8IohNUskxvN C0lK/0eAraT/CE7VrrtMC12JBpkL0jA+MDh0Ec3YfW3JVdd50iOxP1TlwB6svOm0 Jcw6B5xTfZ8sR5qtXOfIP0WfbDsSTO5J8xlCfUJuLDfhZu4vc9t6mdG8c1A2B+QT zBtww4N8n42Y3iD6YtNV2lCPyStBv8SbJ7PAyiR+dUri96qRTKdb9J7RJyXs5FM4 DW1xcxkpLlMR6fMOakz8w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiiedgvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtgfesthhqredtreerjeenucfhrhhomheprghn thhlvghrshcuoegrnhhtlhgvrhhssehilhhluhgtihgurdhnvghtqeenucggtffrrghtth gvrhhnpeeghfdttefhvedujeejudejffekffefleeiveegleduhedtkeehfeeklefhfeeu tdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnh htlhgvrhhssehilhhluhgtihgurdhnvght X-ME-Proxy: Feedback-ID: ie5814659:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 35CD236A0076; Fri, 12 Jan 2024 19:23:51 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1374-gc37f3abe3d-fm-20240102.001-gc37f3abe MIME-Version: 1.0 Message-Id: In-Reply-To: <87mstbzq26.fsf@gmail.com> References: <87mstbzq26.fsf@gmail.com> Date: Fri, 12 Jan 2024 16:23:30 -0800 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: , Reply-to: antlers X-ACL-Warn: , antlers via Guix-patches From: antlers via Guix-patches via 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: -5.78 X-Migadu-Queue-Id: 6BFFF38743 X-Spam-Score: -5.78 X-Migadu-Scanner: mx11.migadu.com X-TUID: 6R1RIwhfJxOq > =E2=80=99fold-packages=E2=80=99 accepts a list of modules as argument = and it > would be the way you should go Thanks for the suggestion! I was so focused on making `specification->pa= ckage' cooperate, I failed to consider calling `fold-packages' directly; `#:mod= ules' is exactly the argument I was looking for. I've given it a spin and, whi= le I have some notes, it works great. I still think it's worth considering whether the behavior of `find-packages-by-name/direct' and it's closure in regards to the parameterization of `%package-module-path' is intentional. A user's intu= ition ought to be that dynamically binding a parameter will have the desired a= nd expected effect, down to the bottom of the call-stack, and `find-packages-by-name/direct' is arguably presented as the implementati= on "under" the caching layer. I'm not sure when it's internal cache is instantiated, and find this behavior surprising. Returning to `fold-packages' there are two differences of note, each ste= mming from how `:guix' approximates guix's standard command-line format by appropriating the existing modules. 1.)=20 > I guess [...], right? > If yes, [...] filter based on package name (and/or other information t= racked > under use-package keyword :guix). Right! And, almost! Package specifications do not always match the `package-name' field of the package they resolve to. Consider `package+o= utput' specifications like the venerable `gcc:lib' (RIP), and package aliases l= ike `gnupg-1', `linux-libre-lts', or `texinfo-7'. This is solve-able (maybe = with `package-name->name+version'), but it's neither as simple as filtering on `package-name' nor as elegant as re-using the existing modules-- should = they behave appropriately under parameterization. 2) I can avoid using `specification->package' directly, but would also need= to special-case `options->transformation' when the second argument to `--with-graft` is such a specification because, unlike the other transformations, it resolves that via `package->specification' before re= turning a procedure (uhm, were I in need of such a transformation). Another solv= able problem, but also another example of an entry-point that could just `do-what-I-mean' under parameterization-- and there are likely more. Why rebuild two spokes when, with a small and deliberate tweak, the old = wheel could cooperate with an existing mechanism for exactly this sort of re-t= ooling? --- I feel like that's a great place to leave off, but I appreciate your que= stions and will take a bit more time answer the rest.=20 > i) Could you provide some details about the tree of your channel? Just that it's some custom packages, a home-env with local-files, and so= me dubious programming, all in one channel. If the packages were in a separ= ate channel, or the home-env was kept outside of the repo and provided on the command-line, everything would work just fine. The rest should be clear = from my elaborations. > When you run =E2=80=9Cguix pull=E2=80=9D, it builds the Guix channel a= nd all the other > custom channels, therefore all the packages should be visible from > =E2=80=99specification->package=E2=80=99. Aren=E2=80=99t they? > ii) Could you explain when it fails exactly and running which Guix > command-line? I have a typo in my original message: > this is a compile-time error, so _profiles_ containing such code fail = to build It's *channels*, not profiles (and with the notable exception of guix it= self), that fail to compile when attempting to resolve specifications for packa= ges they define. We fail before Guix builds the package cache. It might help= stage this in a gexp, but `home-profile-service-type' takes a list (not a gexp= ) and I'm not sure (yet) how to write the service I need or how that would eff= ect whether / when it fails. If I knew the package cache better I might know= when / what's missing it (aside from myself) and `force'-ing the cache in the c= losure before I get there. Oh my, time does fly! Thanks again for the questions, and the help. I really could roll with `fold-packages', but I'd rather keep the patch than build any more spoke= s. I think the behavior is cleaner and I hope I've made a good case for that, regardless of whether I'd recommend use-cases indulging in dynamic bindi= ng-- the parameter already exists and should treated as a volatile value.