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 UGk+DVgJkWV1IwEAkFu2QA (envelope-from ) for ; Sun, 31 Dec 2023 07:25:28 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id mBr/B1gJkWV9rgAAqHPOHw (envelope-from ) for ; Sun, 31 Dec 2023 07:25:28 +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="w9e/6iYa"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=FmaQfJTC; 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=1704003928; 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-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=BITDvyJOi55QFAmQC+FjjU7ez8cei8GJIaMXWBec/Lk=; b=B7/4mQRZYqgvlNLVI9lAARgGzbRGThy0hvfVNu0tzZ1mr3U8LOfI8P9+2x3eYjb3nIlWkL 5mFSnqu9GPnfgiJMV/qtr4S9tk5dvd0v6wWxUnpcyW0MPsqLS82ydoYcCRKYjUoNE9VdML kfvYBh4NI+48ppSMIkd2FkvwoFujoLUmJi0mCor1ULmImz9Wu3yAxKdvWvUZ2uzSeEFO65 vJOrRJYxRYtz3rqG2fetQlvd4gqAZBno207DHsdkGbDEV/L8cgwrgqJvMlmKxZbS4ffCdJ cnsJp0rXGstxs3GqVqZ5MYPnyezKC58+LSFjhwqMTm875ztH44nJuLFZTZvt6g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=illucid.net header.s=fm1 header.b="w9e/6iYa"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=FmaQfJTC; 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=1704003928; a=rsa-sha256; cv=none; b=R9QYsqR13YoM0LZJ/2pVGZGX9Z4ZhTkahcgOpkr3QWMwEy5BgEMKkIIjADE7lpPWz6wOek xHamdu7OlOm5WUnxYKWajWmzicr3q4v29NR6lrTD69uh+PtizrmWUxi7pMoW7XHR3hB5RI V6N7si9wa/mrzvJ7GDIhc0SgFi3tO0PaoY0cZS2Rj+YSiaR4U9X61rLMSDXP2803yjwPy2 10PnibZCYDFpONDNPrzMDbZTt7U9KxASzKVLfSmyvi+TFuEBTLK8+3JZhDS2mHZMYkWLT3 SKMBOQeuV5lmRVjCG0Bh/keNtY57SVFDnXKXNQDUhcPc/l63vwYazNdPWRPvng== 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 1F8AE32812 for ; Sun, 31 Dec 2023 07:25:26 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJpG3-0003U3-PY; Sun, 31 Dec 2023 01:25: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 1rJpG0-0003Tg-2A for guix-patches@gnu.org; Sun, 31 Dec 2023 01:25:08 -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 1rJpFz-0001xC-14; Sun, 31 Dec 2023 01:25:07 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rJpFu-0007aN-Ed; Sun, 31 Dec 2023 01:25: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@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Sun, 31 Dec 2023 06:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68163 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68163@debbugs.gnu.org Cc: antlers , guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr Received: via spool by submit@debbugs.gnu.org id=B.170400389529133 (code B ref -1); Sun, 31 Dec 2023 06:25:02 +0000 Received: (at submit) by debbugs.gnu.org; 31 Dec 2023 06:24:55 +0000 Received: from localhost ([127.0.0.1]:45502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJpFm-0007Zp-Ib for submit@debbugs.gnu.org; Sun, 31 Dec 2023 01:24:54 -0500 Received: from lists.gnu.org ([2001:470:142::17]:58210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJpFh-0007ZU-Oe for submit@debbugs.gnu.org; Sun, 31 Dec 2023 01:24:53 -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 1rJpFb-0003Sx-7F for guix-patches@gnu.org; Sun, 31 Dec 2023 01:24:43 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rJpFZ-0001i5-8L for guix-patches@gnu.org; Sun, 31 Dec 2023 01:24:42 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id CD5853200C3D; Sun, 31 Dec 2023 01:24:36 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 31 Dec 2023 01:24:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=illucid.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to; s=fm1; t=1704003876; x=1704090276; bh=BITDvyJOi55QFAmQC+Fjj U7ez8cei8GJIaMXWBec/Lk=; b=w9e/6iYaYGKnrTns1eQPfR+8wLbPyuMJA2L0n IMj4+PlAJBN7d8Ze6LityCmGaM0qxSj5QumiqyfqNw0JBnyrU2kwsIF8aW5osyuC aL2SB90fkPH61vrF2tIvzlQgfLR5lHEzpdDIkB+lkfJUiwH7TYWfhiVw0xGytqlU EZvtl4hC08Je6xVHOeOng80D60jW/m6z6nhJOUXb8/BXsB8UYud11kEbl/Kwf1xT TB4eNZ3Fl4mXMUPNiitm3feYOuSxMdE9nIYn1GVEsVHAjdCwSupEoUZ2SHR/DH/5 GsrvQEc2KTKGy2S+2KFCvcDy5J5pE47cSnCCb278bT2AooZow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1704003876; x=1704090276; bh=BITDvyJOi55QFAmQC+FjjU7ez8ce i8GJIaMXWBec/Lk=; b=FmaQfJTCnW2zhoMEYELX/zqylqpVGKE5riYo0P13XXu3 /HhCQZ4k/SU/7kX9md75cqDbraPCjSoT1sZRJAgPDAFsLv3CZiKVjHtH57CD84IM 5ApxZ+8OXevOo1HB8serGDjlxtqpNbos+PEXr4hL06A2wC1fmf0YyHfaQ4OXGJdx C4Ugzw6BH2wtiJZ5t/T+G1JVVg8MkrvXXLO2m675My+5RU0NfHp2HbEkVFCN+TyP lvtbxfQtITSbiXNctsQQcrPBu3Gms87hjIo5z1gsF3IeLwC6kh1E4U8sH49NqCB+ Wjiz5Syj9oQSVQNxFy2U6zhpIm5Rjq6ywqpn+9kcKw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdefiedgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpegrnhhtlhgvrhhsuceorghnthhlvghrshesihhllhhutghiugdr nhgvtheqnecuggftrfgrthhtvghrnhephfefkedthfegjedugefggfdvgeegueeilefhgf elgffhvedulefghfekteevgfejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomheprghnthhlvghrshesihhllhhutghiugdrnhgvth X-ME-Proxy: Feedback-ID: ie5814659:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 31 Dec 2023 01:24:35 -0500 (EST) Date: Sun, 31 Dec 2023 06:06:21 +0000 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=64.147.123.24; envelope-from=antlers@illucid.net; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.87 X-Spam-Score: -4.87 X-Migadu-Queue-Id: 1F8AE32812 X-Migadu-Scanner: mx10.migadu.com X-TUID: LR+vy1hnmdj0 * gnu/packages.scm(find-package-by-name/direct): Convert `delay'-ed cache construction in closure into a form memoized over `%package-module-path'. Change-Id: I6e4b4b3fa58082b79aacf307468aec43ec60bf22 --- This enables `specification->package' to be parameterized to resolve packages from within the module-under-compilation. I use this to parse my init.el[0] into packages in my guix-home profile, all in one repo. gnu/packages.scm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/gnu/packages.scm b/gnu/packages.scm index 80c22d1d7f..b0cc2f7427 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -281,18 +281,21 @@ (define load-package-cache #f (apply throw args)))))))) -(define find-packages-by-name/direct ;bypass the cache - (let ((packages (delay - (fold-packages (lambda (p r) - (vhash-cons (package-name p) p r)) - vlist-null))) +(define find-packages-by-name/direct + ;; Bypass pre-built cache, but still memoize over `(%package-module-path)' + (let ((packages (lambda () + ((mlambda (_%package-module-path) + (fold-packages (lambda (p r) + (vhash-cons (package-name p) p r)) + vlist-null)) + (%package-module-path)))) (version>? (lambda (p1 p2) (version>? (package-version p1) (package-version p2))))) (lambda* (name #:optional version) "Return the list of packages with the given NAME. If VERSION is not #f, then only return packages whose version is prefixed by VERSION, sorted in decreasing version order." - (let ((matching (sort (vhash-fold* cons '() name (force packages)) + (let ((matching (sort (vhash-fold* cons '() name (packages)) version>?))) (if version (filter (lambda (package) base-commit: 2a242e86379ebddbdddf2927f26e5e27a98fc605 -- 2.41.0