From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KDRMIGxpWGG5DAEAgWs5BA (envelope-from ) for ; Sat, 02 Oct 2021 16:15:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id MDEKHGxpWGHMZwAA1q6Kng (envelope-from ) for ; Sat, 02 Oct 2021 14:15: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 2BCF62DAB8 for ; Sat, 2 Oct 2021 16:15:08 +0200 (CEST) Received: from localhost ([::1]:54502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWfn9-0004h7-7d for larch@yhetil.org; Sat, 02 Oct 2021 10:15:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWfn4-0004eq-DS for guix-patches@gnu.org; Sat, 02 Oct 2021 10:15:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48590) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWfn4-00030d-4l for guix-patches@gnu.org; Sat, 02 Oct 2021 10:15:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWfn3-00047b-Qu for guix-patches@gnu.org; Sat, 02 Oct 2021 10:15:01 -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:15:01 +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.163318406815784 (code B ref 50960); Sat, 02 Oct 2021 14:15:01 +0000 Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 14:14:28 +0000 Received: from localhost ([127.0.0.1]:60136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWfmV-00046W-Oz for submit@debbugs.gnu.org; Sat, 02 Oct 2021 10:14:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39994) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWfmU-00046J-3a for 50960@debbugs.gnu.org; Sat, 02 Oct 2021 10:14:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53676) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWfmO-0002ZY-WC; Sat, 02 Oct 2021 10:14:21 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36482 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWfmO-0004bc-Mj; Sat, 02 Oct 2021 10:14:20 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211002102240.27815-1-ludo@gnu.org> <20211002102240.27815-10-ludo@gnu.org> <6c199526d88150c31461e3b7f9e76909217e658c.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:14:18 +0200 In-Reply-To: <6c199526d88150c31461e3b7f9e76909217e658c.camel@telenet.be> (Maxime Devos's message of "Sat, 02 Oct 2021 15:52:35 +0200") Message-ID: <87ee93y0n9.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=1633184108; 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=5U6Uiw4b+dTRlUbn2DQpsWp66PLANA3t2e0l0WP3OK8=; b=V3ST3uoyAqd9aw5pmWYWPmDuCvY/m5qEJxdCPq6N6zSXmqGfS2MNKKoqdvmZUL0W8OYoGb sWOEEO7Z8Yn8v2BMA7+tIWP4ueaooBvdOtI44C+/hAd/gY5EG36OgiNMRCYYbJKsiWS84h u7Va9PokBlV3qJ13bRHVvdj9RwgAhRno/bC9BpPs1mz/kpXRjcv11mgHNJXKuoO1yAlhco X+7OBfupY1iHJ6N6VcH0aT9ULC7qJ0orkYrDjEnKjwaTYzhROFngrcG3ukbJ/v8KYJOUW1 bwXMJsLZTMS8kjz8ClL6dE69dSTNvdyoJg9xpANUueslGtTh72pH2m7pNw7O5w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633184108; a=rsa-sha256; cv=none; b=JKSOiIk9cB2P4LXMjI/JqJugOo21/AHzEadbG8HwrSNyYAUulkEPcL2JIkeIbdq/sBBoGm eINxhj1dKAODiFRM0s4l5aMa+SPsP5VJP/MeVhgITlkwXO2VaiZCEeWAZUdNX6ZPxvY0pP 2lTlOx+Q8ot7Rx0BtXwfjaUv7f3PDGIUPhaA+ghlLu3SaAlXSfeKTXgu7jYvium6cTiAos rIFkEvDi2H8helNmLqEwdbrwDpGFVfzkCxiiLTfG9JJ4dk2Pc//ElN62hI12qUtVUuXT8J DCyefB/bcky9SLATFsbFHR10XU+v4VXYehH0mxzJ6z4GENAV1AYB3NKgsWN93A== 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: -3.70 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: 2BCF62DAB8 X-Spam-Score: -3.70 X-Migadu-Scanner: scn1.migadu.com X-TUID: HCIE/34M8QJ+ Maxime Devos skribis: > Ludovic Court=C3=A8s schreef op za 02-10-2021 om 12:22 [+0200]: >> +(define (profile-cache-key file) >> + "Return the cache key for the profile corresponding to FILE, a 'guix.= scm' or >> +'manifest.scm' file, or #f if we lack channel information." >> + (match (current-channels) >> + (() #f) >> + (((=3D channel-commit commits) ...) >> + (let ((stat (stat file))) >> + (bytevector->base32-string >> + (sha256 (string->utf8 >> + (string-append (string-join commits) ":" >> + (basename file) ":" >> + (number->string (stat:dev stat)) ":" >> + (number->string (stat:ino stat)))))))))) > > Why only use the 'basename' of a file name instead of the full name? > (Consider the case where a user has multiple "guix.scm" or "manifest.scm"= .) > This turns out to be unproblematic, because stat:dev and stat:ino is incl= uded > as well, though including (a part of) the file name is superfluous because > stat:dev and stat:ino are included. > > Could you document the rationale for including the file name, and why only > the basename is included instead of the full file name? Actually it=E2=80=99s probably not useful to include the file (base)name. I think initially I thought about distinguishing between guix.scm and manifest.scm, since they return different kinds of objects, but dev/ino is probably enough. WDYT? Ludo=E2=80=99.