From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:700:3204::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id cOBKNxI2oWVjlgAAkFu2QA (envelope-from ) for ; Fri, 12 Jan 2024 13:52:35 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id GKCJMRI2oWVsQQEAe85BDQ (envelope-from ) for ; Fri, 12 Jan 2024 13:52:34 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=Mpwp9Dcv; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705063954; 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=FIYJlleZFLUugN0UCBjQV0XGg2+bBSMPU9J6nCqmRzs=; b=o8eRFicgzBEpsEo8vvgX4IVdc+ATIh/v2Izy/TQJ2RqvgeQrrUhEIjjzX1eo828nsi8cdl buOuZONWnIBvGMVl5PCGyO++T7h3aP9KhndczMqEjtEX+O2C08yDXWxIVt10iiN3kPCK8+ Nf6pGGw0u9vKWRCfzmbXsqrCNt7jSl50Kp/XlOeAsF6dzZ1ciVMCoiLVjBqTGqOIdyG3KX kwvSwe5z4KfWKt7IGsrrTf+ZQ6IlZKH3w/WIWM8to4eUU/K0iKgNd2bXzRegOEoUQi4eHU 5bJZeliinw7RIa6uGvo8AR2wha9wG8Z6wzx2cvPDRAR3R2a0FkZwW4KhdmvtLw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=Mpwp9Dcv; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705063954; a=rsa-sha256; cv=none; b=cECDPpnjSHUhtPXbOa5wP+5t/zkVGBy8Jrb8MxWxJW2hYa7kgV5+am+vNzxvM7bpOt2zPQ r/Vp3YWI1wG6hSR6AOeakbBuIdks25pl+Xv2OyK4DmUVTfhnuPh/sQm0iIWtmp6qIBWbmM VlI/hCVlvwMZ8g2CQXKpIM2HQ40yHki4IoL4Vrahh5EvllP32kz4d91wtqwJqoDKLrD1oV DbXQ9VyhDt4PxUzF3F/YlsPSSaADN31zQrbA+bP9alKmxGfK1NQHVSR3XIJcLzcAx/0/0z cgGzjKaIoNAGXYJ57R08JxEzqswPltaobS8fv/qY+LpQh0jPicHp84jjprFJng== 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 75E8862670 for ; Fri, 12 Jan 2024 13:52:34 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOH18-0005VP-FZ; Fri, 12 Jan 2024 07:52:13 -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 1rOH13-0005UE-5u for guix-patches@gnu.org; Fri, 12 Jan 2024 07:52: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 1rOH12-0004iV-Rw for guix-patches@gnu.org; Fri, 12 Jan 2024 07:52:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rOH10-0004Da-GI for guix-patches@gnu.org; Fri, 12 Jan 2024 07:52: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: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 12 Jan 2024 12:52: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: 68163@debbugs.gnu.org Cc: antlers , dev@jpoiret.xyz, othacehe@gnu.org, ludo@gnu.org, me@tobias.gr, rekado@elephly.net, david@daviwil.com, guix@cbaines.net X-Debbugs-Original-To: antlers via Guix-patches via , 68163@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170506390516193 (code B ref -1); Fri, 12 Jan 2024 12:52:02 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jan 2024 12:51:45 +0000 Received: from localhost ([127.0.0.1]:35168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOH0j-0004D1-6V for submit@debbugs.gnu.org; Fri, 12 Jan 2024 07:51:45 -0500 Received: from lists.gnu.org ([2001:470:142::17]:45062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOH0V-0004BC-0U for submit@debbugs.gnu.org; Fri, 12 Jan 2024 07:51:32 -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 1rOH0M-0004yh-PE for guix-patches@gnu.org; Fri, 12 Jan 2024 07:51:22 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rOH0H-00043j-9m; Fri, 12 Jan 2024 07:51:19 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-33751fdc2a5so840125f8f.0; Fri, 12 Jan 2024 04:51:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705063873; x=1705668673; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=FIYJlleZFLUugN0UCBjQV0XGg2+bBSMPU9J6nCqmRzs=; b=Mpwp9Dcvw+NLZnoHdi6kU6Xw7AYAnkxJe9oAnxg70RGA23ocS6mZEK+vVnadysTgnd 3w2Rw1wTFI1oDXVK3dXAlnH/9ns9qyaJrJ9Sw+LV+wDmZppyckrHKLHq7ssi/h/DHYlg tygt6klRENaiabsW/URfHuDb5xyKdOd68dz77/hgw8YAfPmgNZI/43o31MDRAof6uL+J iroV2gKPMn7FnhxqgOrU9E/SWCdgYp9rq/v7skhjwx7wZ6MiYc0HHotFkfd78xShQscp ldCy8niBF+Z4F7GPb5VpDRLMCdmar9VBZGGsGSBdFeP6+L+CudO5gaKnhpeZZ2zb74QO T4TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705063873; x=1705668673; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FIYJlleZFLUugN0UCBjQV0XGg2+bBSMPU9J6nCqmRzs=; b=FnNUJ3cuDjqK8jJd9jXpXkwQB/hKo2Z23/LfnQXgWk70TGjEA7Km2R6NyLjx4tp6tN kvTdTkhjDWHl1pJsfvUznlOr0wzmzVYyWeQYRYjG2UY/yDwumo4rwNd90r6gMRMN0RiS o01RQpkHgC8Pg6v2hQ3z0NWDUAyp/xiYQbY4fCCQPlsdcDNAcCTS2Odrls4ket0ymIi2 WE5dEXiYTiHcT0I4lnqAUzn1fauUN1dzCyfVhcuWWcqjygAGUiQmtOftydWNfsvTiqar 6l5NhqEFEBedSwfhEc067CTqQGRBz6qeIzfknuHQe+5cyiReN8HDbI3VbY0ZTZNejIuT jeUg== X-Gm-Message-State: AOJu0Ywp6jAi6cg9FL1kzEvPoUYn+YNvhNUWXOUDe7Mc/SJeESxVKsih Fa9PNNLspyM1D0u+CiwC+XA= X-Google-Smtp-Source: AGHT+IGGTzXYMMvjGKaZ0qh5Ut5bAX09kHy1sWtk7SytgRJbWnC1inDFrhrfV4hm7kzSg/xMwBq7XQ== X-Received: by 2002:a5d:4ec5:0:b0:337:39c7:189 with SMTP id s5-20020a5d4ec5000000b0033739c70189mr940908wrv.0.1705063872844; Fri, 12 Jan 2024 04:51:12 -0800 (PST) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id k5-20020adfe8c5000000b003377c5b8a43sm3775612wrn.93.2024.01.12.04.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 04:51:12 -0800 (PST) From: Simon Tournier In-Reply-To: References: Date: Thu, 11 Jan 2024 19:24:17 +0100 Message-ID: <87mstbzq26.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=zimon.toutoune@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_12_24=1.049, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , 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-Spam-Score: 2.31 X-Migadu-Queue-Id: 75E8862670 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: 2.31 X-TUID: oCIbi8GpBnB4 Hi, (For what it is worth, I have also read the rest of the thread. :-)) On Sun, 31 Dec 2023 at 06:06, antlers via Guix-patches via wrote: > -(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-pa= th)' > + (let ((packages (lambda () > + ((mlambda (_%package-module-path) > + (fold-packages (lambda (p r) > + (vhash-cons (package-name p) p r= )) > + vlist-null)) > + (%package-module-path)))) I am not sure by this change. 1. Instead, I would push to =E2=80=99extract-emacs-packages=E2=80=99 the b= its. 2. I miss what makes your use case fails. First, about #1. Somehow, =E2=80=99fold-packages=E2=80=99 accepts a list of modules as argum= ent and it would be the way you should go: in addition to the argument =E2=80=99file-p= ath=E2=80=99, you should also pass to =E2=80=99extract-emacs-packages=E2=80=99 another ar= gument capturing this locally extended %package-module-path. Concretely, considering your example [1]: extract the list of packages based on Emacs configuration (use-package) to then pass for =E2=80=9Cbuildi= ng your home=E2=80=9D using Guix. From my understanding, the core reads: --8<---------------cut here---------------start------------->8--- 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 ;; =3D> (list # ...) ``` 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-mod= ule)))) . "antlers/packages") (%package-module-path)))) (append (extract-emacs-packages "./home/files/emacs/init.el") (extract-emacs-packages "./home/files/emacs/early-init.el")))) ``` --8<---------------cut here---------------end--------------->8--- I guess, the procedure =E2=80=99extract-emacs-packages=E2=80=99 extracts th= e package name represented as string from =E2=80=99use-package=E2=80=99 keyword =E2= =80=99:guix=E2=80=99 and then passes it to =E2=80=99specification->package=E2=80=99 in order to build a l= ist of =E2=80=99=E2=80=99 records. Right? If yes, I suggest to tweak that part instead of =E2=80=99specification->package=E2=80=99. When doing this conversion, from= string to , it seems doable to: a) Pass a list of all modules to =E2=80=99fold-packages=E2=80=99, i.e., ge= t all the packages, included your custom ones; =20 b) Filter based on package name (and/or other information tracked under use-package keyword :guix). Somehow, do not rely on =E2=80=99specification->package=E2=80=99 in =E2=80=99extract-emacs-packages=E2=80=99. Last, about #2. What I do not understand is why is required: =C2=AB This enables `specification->package' to be parameterized to resolve packages from within the module-under-compilation. =C2=BB When you run =E2=80=9Cguix pull=E2=80=9D, it builds the Guix channel and al= l the other custom channels, therefore all the packages should be visible from =E2=80=99specification->package=E2=80=99. Aren=E2=80=99t they? Then, when running =E2=80=9Cguix home =E2=80=A6=E2=80=9D, I miss why it fai= ls. Other said, i) Could you provide some details about the tree of your channel? ii) Could you explain when it fails exactly and running which Guix command-line? Cheers, simon 1: [bug#68163] [PATCH] gnu: Prevent stale cache use when `%package-module-p= ath' is parameterized. antlers via Guix-patches via Mon, 08 Jan 2024 23:04:41 +0000 id:21937d23-9a81-4090-979d-584f40880a51@app.fastmail.com https://issues.guix.gnu.org/68163 https://issues.guix.gnu.org/msgid/21937d23-9a81-4090-979d-584f40880a51@app.= fastmail.com https://yhetil.org/guix/21937d23-9a81-4090-979d-584f40880a51@app.fastmail.c= om