From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MN6vFILWw2AbJAAAgWs5BA (envelope-from ) for ; Fri, 11 Jun 2021 23:32:50 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id Chv3D4LWw2CLXAAAbx9fmQ (envelope-from ) for ; Fri, 11 Jun 2021 21:32:50 +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 AA16B1FD31 for ; Fri, 11 Jun 2021 23:32:49 +0200 (CEST) Received: from localhost ([::1]:51828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrolk-00080n-8y for larch@yhetil.org; Fri, 11 Jun 2021 17:32:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrolH-0007yM-R2 for guix-devel@gnu.org; Fri, 11 Jun 2021 17:32:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47398) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrolH-0005O6-Hs; Fri, 11 Jun 2021 17:32:19 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55098 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrolH-00087b-AK; Fri, 11 Jun 2021 17:32:19 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zimoun Subject: Re: "guix pull" expiry channels References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 23 Prairial an 229 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: Fri, 11 Jun 2021 23:32:17 +0200 In-Reply-To: (zimoun's message of "Wed, 9 Jun 2021 14:51:54 +0200") Message-ID: <87y2bg3x5q.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Guix Devel Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1623447169; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=iNnjgZSvRNMMiyHuqMR0RgMvfkTtuguKMh32U7Er13A=; b=Y6jt3LsNUcWjcw+PpZZIJnwEL5xLPAzoanCjbg9LG8lAFixD1DNKGF/iO9tI5AjK+wdGzS zMsfhU4aqGv5kgoIhQ2MIEEBB5m6fXlZXAurQUvoAvbfzjzgVPZa84PZU8Zkt2TsRwB5sa w+BiRETqdFuAOccZgLf0XBAC0Xlg+IIbseuzfjsaVdTN9D8j8UqUWpTLD3BM1xMDCJeuRD 1T8i3y3FUM0PGJRVHgr12gvJC/ir1uRsalYnYZK1mlkTa4OjTehsPDOzBRtHo/UtkjYZlS z3g7vjqLg489xwLdqRYKjHQui+Ql+gCLTYc37O0DPZWR4FbshQ8+kkHnNczBaw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623447169; a=rsa-sha256; cv=none; b=cYO8IcUXpFnMmD/3EqyRD7hiLfU2J5mz06aSBZDCD90Bftd3/iRhr9uYFqVhOWQW9NvLQP yDo3uW/xa3J5xZqPg2MkL/+xB0q3zaokWaJ41ZHkDLoiuRVIkmKrxY5x8bcQlJblbjZ8oS iUiUdzys/vZ8JHyLzIlSC6ZvHstr3GLABMSBYKlyNZ56zj397OqITvE2CiY8QNLQaaxVoZ QlXsEvEjmTIO7FUtEZsI0OwS84ltvKEXhlZwlkDYCsVz6cip6PyCCMf3ylltqrPqvJT/+J Hp2j1Yp3NVQRJ++jXlBRH0k6Ev7ZCaZsLchlReJ1DNKYWB78Futt7DR1eR1XDw== 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-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: AA16B1FD31 X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: G9r+G33HXcao --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, zimoun skribis: > I do not know if it is not a bug. From f8acd1a (pulled April, 21rst), I = get: > > Updating channel 'guix' from Git repository at > 'https://git.savannah.gnu.org/git/guix.git'... > guix pull: error: Git error: failed to resolve path > '/home/simon/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr= 27shj7apsnalwq': > No such file or directory > > > Indeed, after the error, I have this: > > $ ls ~/.cache/guix/checkouts/ > f5uvstgmyyeyhl66lla3yxbp26x25xwt7rbwah3kahh724xwzisa last-expiry-cleanup > > Then if I run again "guix pull", it works as expected. > > It is hard to reproduce. ;-) I suspect a bug in > 'maybe-remove-expired-cache-entries' or 'update-cache-checkout'. Sounds plausible! The code in (guix git) determines expiration based on the mtime of sub-directories in ~/.cache/guix/checkouts. But that=E2=80=99s bogus, no? Yes, and the Internet confirms: a directory=E2=80=99s mtime is only changed= when a file inside it is renamed, added, or deleted.) Oops! So it would depend on how frequently you pull, and perhaps on the file system you use, go figure. The patch below should fix it. Will push shortly, thank you! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/git.scm b/guix/git.scm index 57fa2ca1ee..9c6f326c36 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -424,6 +424,14 @@ it unchanged." ;; REPOSITORY as soon as possible. (repository-close! repository) + ;; Update CACHE-DIRECTORY's mtime to so the cache logic sees it. + (match (gettimeofday) + ((seconds . microseconds) + (let ((nanoseconds (* 1000 microseconds))) + (utime cache-directory + seconds seconds + nanoseconds nanoseconds)))) + ;; When CACHE-DIRECTORY is a sub-directory of the default cache ;; directory, remove expired checkouts that are next to it. (let ((parent (dirname cache-directory))) --=-=-=--