From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6N2eLPRoWGF7DAEAgWs5BA (envelope-from ) for ; Sat, 02 Oct 2021 16:13:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EBJMKPRoWGG1aAAA1q6Kng (envelope-from ) for ; Sat, 02 Oct 2021 14:13:08 +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 DDC482E740 for ; Sat, 2 Oct 2021 16:13:07 +0200 (CEST) Received: from localhost ([::1]:53016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWflD-0003bv-3D for larch@yhetil.org; Sat, 02 Oct 2021 10:13:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWfl8-0003bY-P8 for guix-patches@gnu.org; Sat, 02 Oct 2021 10:13:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48586) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWfl8-0001l2-Hl for guix-patches@gnu.org; Sat, 02 Oct 2021 10:13:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWfl8-00044L-DJ for guix-patches@gnu.org; Sat, 02 Oct 2021 10:13:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50960] [PATCH 10/10] shell: Maintain a profile cache. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 02 Oct 2021 14:13: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: Maxime Devos Cc: 50960@debbugs.gnu.org Received: via spool by 50960-submit@debbugs.gnu.org id=B50960.163318396415618 (code B ref 50960); Sat, 02 Oct 2021 14:13:02 +0000 Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 14:12:44 +0000 Received: from localhost ([127.0.0.1]:60132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWfkq-00043q-CN for submit@debbugs.gnu.org; Sat, 02 Oct 2021 10:12:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWfkp-00043c-Bd for 50960@debbugs.gnu.org; Sat, 02 Oct 2021 10:12:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53630) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWfkj-0001Tr-9K; Sat, 02 Oct 2021 10:12:37 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36480 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWfki-0004P8-W9; Sat, 02 Oct 2021 10:12:37 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211002102240.27815-1-ludo@gnu.org> <20211002102240.27815-10-ludo@gnu.org> <91012c32e4f8b04beae71378d44787a81055391a.camel@telenet.be> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 11 =?UTF-8?Q?Vend=C3=A9miaire?= an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 02 Oct 2021 16:12:35 +0200 In-Reply-To: <91012c32e4f8b04beae71378d44787a81055391a.camel@telenet.be> (Maxime Devos's message of "Sat, 02 Oct 2021 15:43:27 +0200") Message-ID: <87ilyfy0q4.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 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: , 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=1633183988; 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; bh=+uPWzjMgSW8HM+FMbESzsiRvYEGNY6p83cyl0CFYgto=; b=jKiMaiLECHJRsEvfTVTlE9r/JD43x2k4goO0r+1atwDeGCNinCpmjDJzYqK8ThJ0Ge9X7W mxztH2visuPkL+Dauljf9JTcgp/Nr4VXqO+ELixhU94XjUTZgpoFjHW1Pv2m9kE+kMixdr JYlq/CE8r2fHd7vAbTg0FksmuYpe9p8piyNR6fB0cZnuKWUCTzfaiMVGZVHmKZIqCmoUyj D+ysRwDkhHOsNitZWKZiIbF1CzHte9NjIpjQUCUL3Pg4NCmcy36zCKZeGQLhwaS2aRcb5J JHwZafopIIIOZkUhR7WdB94HVvkXLSKHgz4J54/qOrTXZnrAThXiWrmRWHENig== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633183988; a=rsa-sha256; cv=none; b=EQL2WhhKHYue14HZeeDdEg6IKRejyv/HCbEwAtBbsb4na/80e9G4xjPhfCGvIZphqFFCVR 859/QSjhfN7lTferhrKYuAZVGKtB/bmrMqhgNXRCSOglL0Ctrvys1Tbj0tmtfn69kJwemf k7/HgBrwB6PEuw1G3/NZ72Np7lfLmLlYGJP/InMe0zqi7wnYzl7Ly7yw6vA2PDH0ZTi2zk f0Vr6JCJu1mO3sXG2wCBwzzUR7BQaBKKhIwYaf141M6SOWCAxff3trblgHdOOYnE8GHo9s GWsL/XpzNqZ0/fO4v8GXPTuzPzp5v7Ue2T9vhjR9Et+VPLkullZ/xv3Km6VGmQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: -2.90 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: DDC482E740 X-Spam-Score: -2.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: kDG83u5cIqID Maxime Devos skribis: > Ludovic Court=C3=A8s schreef op za 02-10-2021 om 12:22 [+0200]: >> With this change, running "guix shell" (no arguments) is equivalent to: >>=20 >> guix environment -r ~/.cache/guix/profiles/some-root -l guix.scm >>=20 >> This is the cache miss. On cache hit, it's equivalent to: >>=20 >> guix environment -p ~/.cache/guix/profiles/some-root >>=20 > > What if guix.scm is something like > > ;; Load custom package definitions > (include "a-package.scm") > (include "b-package.scm") > (include "c-package.scm") > (list a-package b-package c-package bash ...) > > and a-package.scm, b-package.scm or c-package.scm is modified? > Then the cached profile should be rebuild, no? It should, but it won=E2=80=99t; that=E2=80=99s a weakness of this mtime-ba= sed caching strategy. I=E2=80=99m not sure how to address it. We=E2=80=99d need a cache key that= =E2=80=99s more precise than inode/mtime, yet cheap to compute. Perhaps we need to live with that limitation, document it, and provide a flag to force a rebuild? > So I think the cache should also check if these dependencies have been mo= dified. > To keep track of the dependencies, something like the =E2=80=98compile-al= l,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 shel= l -Lextra-modules-directory ..." > is done) macros would need to be replaced. 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 macro that reads files at expansion time. So I=E2=80=99m inclined to not even tr= y. Thanks, Ludo=E2=80=99.