From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cIDjNSlxWGFFHgEAgWs5BA (envelope-from ) for ; Sat, 02 Oct 2021 16:48:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id kLFuMSlxWGFmVgAAB5/wlQ (envelope-from ) for ; Sat, 02 Oct 2021 14:48:09 +0000 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 9BF132E177 for ; Sat, 2 Oct 2021 16:48:09 +0200 (CEST) Received: from localhost ([::1]:52902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWgJ6-0001FV-Nb for larch@yhetil.org; Sat, 02 Oct 2021 10:48:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49736) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWgJ0-0001EK-S4 for guix-patches@gnu.org; Sat, 02 Oct 2021 10:48:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48663) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWgJ0-0001ZU-Ku for guix-patches@gnu.org; Sat, 02 Oct 2021 10:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWgJ0-00057I-Ii for guix-patches@gnu.org; Sat, 02 Oct 2021 10:48:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50960] [PATCH 10/10] shell: Maintain a profile cache. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 02 Oct 2021 14:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50960 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 50960@debbugs.gnu.org Received: via spool by 50960-submit@debbugs.gnu.org id=B50960.163318605019518 (code B ref 50960); Sat, 02 Oct 2021 14:48:02 +0000 Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 14:47:30 +0000 Received: from localhost ([127.0.0.1]:60205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWgIU-00054h-3o for submit@debbugs.gnu.org; Sat, 02 Oct 2021 10:47:30 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:59208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWgIR-00054B-OY for 50960@debbugs.gnu.org; Sat, 02 Oct 2021 10:47:28 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by baptiste.telenet-ops.be with bizsmtp id 12nR2600F0mfAB4012nRb3; Sat, 02 Oct 2021 16:47:26 +0200 Message-ID: From: Maxime Devos Date: Sat, 02 Oct 2021 16:47:20 +0200 In-Reply-To: <87ilyfy0q4.fsf@gnu.org> References: <20211002102240.27815-1-ludo@gnu.org> <20211002102240.27815-10-ludo@gnu.org> <91012c32e4f8b04beae71378d44787a81055391a.camel@telenet.be> <87ilyfy0q4.fsf@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-VXvvPoJ3pi1mJOlysSMZ" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1633186046; bh=UwL2SW5ygJmVbrIgs7F40UAV9B4p7ZQVspYjpR+h3QA=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=k2q0ImimdaxWF+vsSgdhTRujboSKYfGF9AxfsCAaKQzwCpaCzGkVY4bM5+a4Vu0sO 11STxQ/j/p+900gSbP2cqHNDUyavao6z/QJn8X5i5Yt6XMyIGMqmveeGk+t//XA7pi 6NZfu3UEXQfbzgDkkol+88ToqKr08G1+JRAMSdLButx4FQZFFe8R3r65hh3um2Ct/1 U1YvjfbVHCsP41YctmNg+sYy6P99U5fcrLt4RYBOpgTk4RbNf89Yhz93z0wB3LWJRZ 2zzZqyH5uqZL4v/azRrT9RIgJwupuMQpahiYtACXsogEQ7o9mdyhMQiR9BaMjL/9Yi bOSOMk4bNe+jg== 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633186089; 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: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=UwL2SW5ygJmVbrIgs7F40UAV9B4p7ZQVspYjpR+h3QA=; b=R5VizazTbgj/WP+qnlL7Ws8th2CDv+XZ2tUk7IoKIfhe2t/D/h2KTVpZpiCSK9mkNk5htE W4AERExuu3J9YskoeXWJyWH+e/N5I1QBNmknyRzbM0ZUGfspY4LgL7dTSqJJQJPh/2QP1q kWdYfmBdjmxOyFuvKHTXOb/are174rwV0tDBbPI0HeZWRRQfeV8CtjnCmvPFpmjRN9a6YH M/GkMkilaI5x9pMQKZXiUgIUZsSKAEPVM/sY47H8tU5tVxC92N+bpwfNZtO7z7ZNQe9eSw QV5Q+xAZSFocgqPUPKHOjzOFJ/697qg1mWX0SP+ACTulRFuaLLKjXeV9705+Vw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633186089; a=rsa-sha256; cv=none; b=Vv35a5CkT9KAqoRMsCYumCvh+tV+54tuRLle4JfLMJYJv956AOSRP/9tANp9PdR0FPTjOr Vxx+OGuMa0Cg1zI7dSmAYDiq0lJP2IaBLaTwp6EowTl0ENPMviRwXaRIsHgu3wHjpx0089 CkxZx2cUqfQQGtQoHa6pBpNf+BYm/l6tR512VmD+4XCid8RXbshmJ3O3RJBQ+jwh4g0UiZ fT5/OTDUvTL0n1A8NRabWwHVLNnGBsATT903/FRcIE9uqjj+qVyZ8oDP7bCgekF+sEn586 FJG3A49KWN8YFXO0FjrLmWQOjH7CVxSp11G/5tAhAfNvRXmQSWMbMmet1efP8g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=k2q0Imim; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=k2q0Imim; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 9BF132E177 X-Spam-Score: -3.90 X-Migadu-Scanner: scn1.migadu.com X-TUID: UVGQiStfJd9A --=-VXvvPoJ3pi1mJOlysSMZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op za 02-10-2021 om 16:12 [+0200]: [reordered] > > So I think the cache should also check if these dependencies have been = modified. > > To keep track of the dependencies, something like the =E2=80=98compile-= all,compile: > > Keep track of dependencies of compiled modules.=E2=80=99 patch from > > could be used, though the 'include'= , 'load', > > 'include-from-path' and maybe 'use-modules' (if something like "guix sh= ell -Lextra-modules-directory ..." > > is done) macros would need to be replaced. >=20 > Problem is that any attempt to keep track of dependencies is always an > approximation because macros can do anything=E2=80=94I can have my own ma= cro > that reads files at expansion time. So I=E2=80=99m inclined to not even = try. I expect most people use 'include', 'load', 'include-from-path' or 'load-fr= om-path' instead of writing their own macro reading files at expansion time, and if = they do write their own macro, I expect it would be implemented in terms of the for= mer anyway, so I expect replacing these macros and 'use-modules' to be sufficient, espe= cially if the flag proposed below is available as =E2=80=98escape hatch=E2=80=99 f= or when the dependency tracking is insufficient. This is not merely an expansion-time problem, files loaded at 'load' or 'ev= al' time are important as well. E.g., consider the case where the manifest is somet= hing like (list (package (inherit stuff) (source (local-file "stuff" #:recursive? #t))) other-packages ...) then all files inside 'stuff' are important as well. I don't see how depen= dencies could be tracked here without an excessive amount of 'stat' calls, maybe gu= ix should ignore these dependencies (possibly with a warning, and a reference to the = manual documenting which dependencies are tracked and which are not?).=20 Ludovic Court=C3=A8s schreef op za 02-10-2021 om 16:12 [+0200]: > I=E2=80=99m not sure how to address it. We=E2=80=99d need a cache key th= at=E2=80=99s more > precise than inode/mtime, yet cheap to compute. The mtime of the file and the mtime of every dependency (ignoring modules f= rom Guile, Guix and channels to reduce the number of calls to 'stat').=20 > Perhaps we need to live with that limitation, document it, and provide a > flag to force a rebuild? A documented flag to always consider the cache stale seems good, though I t= hink at least the dependencies made with the common macros and procedures 'inclu= de', 'load', 'include-from-path', 'load-from-path', 'use-modules' and non-recurs= ive 'local-file' could be tracked, though this could be left as a TODO for late= r I suppose. Greetings, Maxime. --=-VXvvPoJ3pi1mJOlysSMZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVhw+BccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7q74AP4r7cPOVy4SvOcyF2gpDs/kVWL0 J/RNunvEiCSBtLoTNgD+IbIxStM2PdCQH2WbA9iN27BJ9cfJ3dHkzrDPuYG4/wk= =nG4D -----END PGP SIGNATURE----- --=-VXvvPoJ3pi1mJOlysSMZ--