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 WL/pIeJ/nGVtEQEAkFu2QA (envelope-from ) for ; Tue, 09 Jan 2024 00:06:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id IE/MGeJ/nGX2kQAAqHPOHw (envelope-from ) for ; Tue, 09 Jan 2024 00:06:10 +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="G/7m258X"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=28zuarw0; 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=1704755170; h=from:from:sender:sender:reply-to: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=CwWhwVaAaJgUdbKISmKkdtjK4hEB/zqxXWYumcoW89c=; b=nRNhHWtqRJVTFaToYLcFae26ti/FSt9EhVLUT4QXZFofYJ8jt243WPLMSr9JQWsFaTnxpC Q7l1ccxx3AaeK+XaVbJerBpsEnFdVNCg497DnUc34Qosic1vzrzM8vR3A+8aUghxqmsmGz o17tE90hsSXJyd4nSVS7IdCxEPkoGsmH19lmpPRutzErufTfQjhPPxLCiIxzmP0DDthah5 AfLWYGF3X1dOn6sXXN195Ql6oxvBlhXzFA3zumkjyb/tz44wfjWcDHqFm3OnKXV9Wn+slC vYnbkmZbQOWcRVAJQEICfn2cUQh5Dy9c/IOCx0wEfq4KU07uNc2rdoV+usLVtA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704755170; a=rsa-sha256; cv=none; b=I8BhkZAhoLEcVUSB2AkfXplqQs/MTFKvrA/uhUHGbt2DNVp/GVJZ0d6azP+BGljz5WpIox gTEMrUpRf645d8fNE/UvEVIbQAgeOWG+itwWwS9uBVzZ+f+YBr65csnZi6Obk+tQ5n+iPO DxxUCaBbNfgLNWVKSu0C7hAngsPT15tCZu2rDCsY7Qr0BC6+x6C8AqvBGV9xgfeZPLPmBk GfQ4/Knmi0EKzR3g3yLxIvna+WisqBnLMrrTuN4ZzcNvT+nR/P+93ZGIHvlPS6I0sdMkB+ 6qInRogzKVaGr+zcEQT2XHP9ERqHRCzuCYFMSXs9TS67PT2NCh7duyk/hIGTvQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=illucid.net header.s=fm1 header.b="G/7m258X"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b=28zuarw0; 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 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 3D0CE30CB2 for ; Tue, 9 Jan 2024 00:06:09 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMygv-0006Jf-Ii; Mon, 08 Jan 2024 18:05:57 -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 1rMygt-0006CA-Vl for guix-patches@gnu.org; Mon, 08 Jan 2024 18:05:56 -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 1rMygt-00033r-NL for guix-patches@gnu.org; Mon, 08 Jan 2024 18:05:55 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rMyh0-0002pc-4R for guix-patches@gnu.org; Mon, 08 Jan 2024 18:06: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: Mon, 08 Jan 2024 23:06: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: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 68163@debbugs.gnu.org Received: via spool by 68163-submit@debbugs.gnu.org id=B68163.170475511810814 (code B ref 68163); Mon, 08 Jan 2024 23:06:02 +0000 Received: (at 68163) by debbugs.gnu.org; 8 Jan 2024 23:05:18 +0000 Received: from localhost ([127.0.0.1]:37843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMygH-0002oL-IF for submit@debbugs.gnu.org; Mon, 08 Jan 2024 18:05:18 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:54337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMygD-0002nz-IZ for 68163@debbugs.gnu.org; Mon, 08 Jan 2024 18:05:15 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id F01305C036A; Mon, 8 Jan 2024 18:05:01 -0500 (EST) Received: from imap44 ([10.202.2.94]) by compute5.internal (MEProxy); Mon, 08 Jan 2024 18:05:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=illucid.net; h= cc: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=1704755101; x=1704841501; bh=CwWhwVaAaJ gUdbKISmKkdtjK4hEB/zqxXWYumcoW89c=; b=G/7m258XPeX64GgR5oF6W3QUvE yTU5VWOkm37fe4dMOzGgWpZSY0hRKj72gDoucVOxFXZbPvLXVumoiG8a/8mStErH luzQlBzVNf0t64e5UfR0M2tIng86dSDsEVyh6aa/NhfYPZgAF+3Bqb4PeNvmryyy qOZYxWw91DZAucNWS6Z3WcwD3r5tYfGFH7g1i7oHvuD7IKuBIcmohH41yKvvHLwv tPJgsR4QUjSdq3JOgFBfOEkLtBN0f1ZOMSr6DLibXof2fcjNo/tpv0CmX7XCL5+P qI/t33z0GdHRuCvLbf5e+EFPF0dkLWGMbPoLzAsS/fPwboM8zeBHaTmrT4GQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1704755101; x=1704841501; bh=CwWhwVaAaJgUdbKISmKkdtjK4hEB /zqxXWYumcoW89c=; b=28zuarw0FpzW4VSlmpcewsbtnywn03Bw8UCRAVUeX2dW OdTOzkD7QXAKO77Ks1QEFyw8UUyj0BV7wZX+nJT50iRLG+ILKImv700JhWzb4tF0 +ssoLte9ru0y/OJVnmLh30FLSJVKjvURphyTEABpem4UbQju0hY6Gk0wAfdCd0rA DICb93NegaxqwmI+R3EhaeH2vcED4YSdRTDyc8WITdpqMZphKrCeYYlgyVJTtTXq xLISwOBeSoPSG780xqc0ERPhKtVGrgMs6H8FYps7tFr9BbATPKD0uTbj/LT1zOlT C0425j0atr7YFNxFykR2s6SUT7vWip7XrxbFWEw0UA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdehkedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne goufhushhpvggtthffohhmrghinhculdegledmnecujfgurhepofgfggfkjghffffhvffu tgesthdtredtreertdenucfhrhhomheprghnthhlvghrshcuoegrnhhtlhgvrhhssehilh hluhgtihgurdhnvghtqeenucggtffrrghtthgvrhhnpeejvddthfevgffhtddtgfetjeeu heekjedtledtieefvdfgtdejfeelleegvdehffenucffohhmrghinhepghhithhhuhgsrd gtohhmpdhgihhthhhusgdrihhonecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomheprghnthhlvghrshesihhllhhutghiugdrnhgvth X-ME-Proxy: Feedback-ID: ie5814659:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 7282936A0076; Mon, 8 Jan 2024 18:05:01 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1364-ga51d5fd3b7-fm-20231219.001-ga51d5fd3 MIME-Version: 1.0 Message-Id: <21937d23-9a81-4090-979d-584f40880a51@app.fastmail.com> In-Reply-To: <87a5pf4ux1.fsf@gnu.org> References: <87a5pf4ux1.fsf@gnu.org> Date: Mon, 08 Jan 2024 23:04:41 +0000 Content-Type: text/plain 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: -6.90 X-Spam-Score: -6.90 X-Migadu-Queue-Id: 3D0CE30CB2 X-Migadu-Scanner: mx12.migadu.com X-TUID: ZCsNSdvM7g0x So I did! It's probably better to give a clear, in-line example anyways. I take it you know *what* I'm doing, just not *why*; but I'm going to include a full example anyway for the benefit of future readers. Note that this is a compile-time error, so profiles containing such code fail to build entirely but produce cached object files which may continue to function correctly after eg. a roll-back. I was briefly bit by one after pulling an upstream profile to confirm the behavior shown :p ``` scheme #!/usr/bin/env -S guix repl -L ./modules !# (define-module (example) #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (guix packages)) (define-public my-hello (package (inherit hello) (name "my-hello"))) ;; Suppose we're an average user and keep our configuration in a ;; channel in our home-dir: (format (current-output-port) "~s~%" (module-filename (current-module))) ;; => "/home/user/src/example/./example.scm" ;; Whether or not it's best practice, we may be inclined to use ;; `specification->package' to populate our `operating-system', ;; `home-environment', and even (*gasp*) `service' records. (format (current-output-port) "~s~%" (specification->package "hello")) ;; => # ;; But this procedure fails when we attempt to reference a ;; package-variant defined within our configuration channel (even ;; when it's in another module, eg. `(example packages base)'): (format (current-output-port) "~s~%" (specification->package "my-hello")) ;; => guix repl: error: my-hello: unknown package ;; (Note that this is a non-continuable exception, and would commented out ;; to execute the remaining stanza of this script.) ;; A clever user might parameterize `%package-search-path' to get ;; around this limitation: (parameterize ((%package-module-path (cons `(,(dirname (module-filename (current-module))) . "") (%package-module-path)))) (format (current-output-port) "~s~%" (specification->package "my-hello"))) ;; => guix repl: error: my-hello: unknown package ;; But only with the patch do we enable this functionality: ;; => # ``` Regarding my specific use-case, I have a channel featuring the following at least the following four snippets. antlers/home/files/emacs/init.el[1]: ``` elisp (use-package all-the-icons :guix (emacs-all-the-icons) :defer t) (use-package magit :guix emacs-magit git :custom (magit-diff-refine-hunk t)) (use-package embark :guix (emacs-embark ; This refers to my fork with a page-able which-key pop-up on `embark-collect' --with-git-url=emacs-embark=file:///home/antlers/[...] --with-branch=emacs-embark=fix/issue-647) :custom (prefix-help-command 'embark-prefix-help-command)) (use-package devil-mode :guix emacs-devil-mode :custom (devil-key "'")) ``` antlers/home/extract-emacs-packages.scm[2]: ``` scheme (define extact-emacs-packages (file-path) [...]) ; this is not polished code, you don't wanna see it: just imagine ;; => (list # ...) ``` antlers/packages/emacs-xyz: ``` elisp (define-public emacs-devil-mode (package (name "emacs-devil-mode") (version "0.6.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/susam/devil") (commit version))) (sha256 (base32 "1pr9yf6f37sz5qy1snn8ag5bvg6lza7q635jh8jhaqqfp37jvv1y")) (file-name (git-file-name name version)))) (build-system emacs-build-system) (home-page "https://susam.github.io/devil") (synopsis "Modifier-free editing in Emacs") (description "Devil mode trades your comma key in exchange for a modifier-free editing experience in Emacs.") (license license:expat))) ``` antlers/home.scm: ``` scheme (simple-service 'emacs-packages home-profile-service-type ;; Add `(antlers packages)' to `specification->package' PATH (parameterize ((%package-module-path (cons `(,(dirname (dirname (module-filename (current-module)))) . "antlers/packages") (%package-module-path)))) (append (extract-emacs-packages "./home/files/emacs/init.el") (extract-emacs-packages "./home/files/emacs/early-init.el")))) ``` If there's a better way to do this (barring the obvious of upstreaming assorted bits) let me know, I'm sure there are many ways, but this one's mine. I don't like to keep the manifest seperate from my configuration, but also don't want to keep them in an org file and have to invoke emacs to build my channel. I don't know if a.) there's any cause to be concerned about the performance of this tweak, or b.) that you care to support the behavior at all, but I hope I've made my own use-case clear and the patch is there if you see fit c: Thx for your time! 1: https://gist.github.com/AutumnalAntlers/efa81fbb3ecc2c4fdd97785731f4348c 2: https://gist.github.com/AutumnalAntlers/b3090d73b97779f977105b905be14453