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 KDPNDqReWGGK+QAAgWs5BA (envelope-from ) for ; Sat, 02 Oct 2021 15:29: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 mp1 with LMTPS id uI1VCqReWGGQbgAAbx9fmQ (envelope-from ) for ; Sat, 02 Oct 2021 13:29: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 EFABA2DCEC for ; Sat, 2 Oct 2021 15:29:07 +0200 (CEST) Received: from localhost ([::1]:37156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWf4d-0005QG-5E for larch@yhetil.org; Sat, 02 Oct 2021 09:29:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWf4Y-0005Ps-3j for guix-patches@gnu.org; Sat, 02 Oct 2021 09:29:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46753) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWf4X-0007Ak-Sm for guix-patches@gnu.org; Sat, 02 Oct 2021 09:29:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWf4X-0002Mi-NL for guix-patches@gnu.org; Sat, 02 Oct 2021 09:29:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50960] [PATCH 09/10] cache: Gracefully handle non-existent cache. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 02 Oct 2021 13:29: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: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 50960@debbugs.gnu.org Received: via spool by 50960-submit@debbugs.gnu.org id=B50960.16331813409085 (code B ref 50960); Sat, 02 Oct 2021 13:29:01 +0000 Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 13:29:00 +0000 Received: from localhost ([127.0.0.1]:58299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWf4W-0002MT-K2 for submit@debbugs.gnu.org; Sat, 02 Oct 2021 09:29:00 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:57824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWf4U-0002MJ-IO for 50960@debbugs.gnu.org; Sat, 02 Oct 2021 09:28:59 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by xavier.telenet-ops.be with bizsmtp id 11Uw260070mfAB4011UwV9; Sat, 02 Oct 2021 15:28:57 +0200 Message-ID: <5686bf529c9ea7fe5e8a34d9116dfc317c7f1745.camel@telenet.be> From: Maxime Devos Date: Sat, 02 Oct 2021 15:28:51 +0200 In-Reply-To: <20211002102240.27815-9-ludo@gnu.org> References: <20211002102240.27815-1-ludo@gnu.org> <20211002102240.27815-9-ludo@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-E+Ms8J0BLT+itdLIQQJh" 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=1633181337; bh=Qn5SAtfmx/cZZNftRStB/KsMUP7ZoS265V7uRhs0CH0=; h=Subject:From:To:Date:In-Reply-To:References; b=gsMk0UOYJk3ok5A/TtkjsJdlhjmOF4hvBres41jhN92Nj3A3YIc43+hm7l1xb8ARK 1tcwqMaVWnAqo+VDPuqZBbbQp+5hjlaC4Ixs7Ao10OA8I1j6/afp0TfiGJrOlS7PGv R/QO8Z/Qk6tM5glpnjeigNGLIH2IU93GCn6B31ICqDjRexI0py5bdQsWCIgoKcMEyA roQtoZcJ65JfOZfALdqN0jW13b+oq/HxbqzuCoPdFMlSOrAAn4UqhFXxOWeqDNVRnY df7/17zfKF2jM8ClRJg0lAJugP026Xhn4i/seS5xJIvgfMS41yxATE1PDdXkhNd7Dc bgSexW700SiAA== 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=1633181348; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=Qn5SAtfmx/cZZNftRStB/KsMUP7ZoS265V7uRhs0CH0=; b=jwoxea8E3JYDWpJLmjIMf7HQpZh2MUYzeaxikRywahdf7+MwZ/DFotGhPyWEfbSOzfrkpu PUjDbpJY9DCvS56SO0HC79/ZmIHIDJDnPVq73dD4V3khrb9EWxJErYp3u5pI5MiyoJtPE1 9TIHXUHCxrS0/PVN+5ccwiiDGnu52BRuNl9COGHMsKvouUvoTnbaPoKhoj6iBn7d3LpNe5 rTnxjLp5y8SkW5M10MyuHcgvOjE2rLEqIlpMs3Udk5LyZJWF7S3pa/kGkg2i1IkNKH3vSE eFXxkXCG5aaqPdZg7WSYVQsldmCP5kXJFVhZtOkerTroiZSg58pViVpm4d4r4Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633181348; a=rsa-sha256; cv=none; b=OJsGIHloLJgyyGgx8hrYwFL+RImZhXNj4PJE4cUXYp/CIu4mEowC/YvBClcUjbYYjoZxBI 4WpxUGe1CBGO1X2HzrovzWvzgj8G7fDCkmgakS4Rqz2FSV+Yl0/vI2ru5q/i0fTjo5Q4R3 1fb5R/PaIEurL5GEhkROah/+j/p/CWCQ8aFasE1NjPCMXdZ6AOn9V+GIvgWTfwFBSmKFdf Af85xDfqAxUcRDCV6IoGYrEYS3Fv8MPhFuv+Xb/gHnzzz0RyOzdezl5NHcA2pItGdfbVmP 7IOvIum8YHdzpGBpEodNVIE7+VwJCaQx/bXCFN669ARtb0CAkVxvcee3Ug4utQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=gsMk0UOY; 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.40 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=gsMk0UOY; 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: EFABA2DCEC X-Spam-Score: -3.40 X-Migadu-Scanner: scn0.migadu.com X-TUID: 2NSNE0AofN1E --=-E+Ms8J0BLT+itdLIQQJh Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op za 02-10-2021 om 12:22 [+0200]: > * guix/cache.scm (maybe-remove-expired-cache-entries): Ignore ENOENT > when writing EXPIRY-FILE. > --- > guix/cache.scm | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) >=20 > diff --git a/guix/cache.scm b/guix/cache.scm > index 0401a9d428..51009809bd 100644 > --- a/guix/cache.scm > +++ b/guix/cache.scm > @@ -101,7 +101,13 @@ CLEANUP-PERIOD denotes the minimum time between two = cache cleanups." > #:now now > #:entry-expiration entry-expiration > #:delete-entry delete-entry) > - (call-with-output-file expiry-file > - (cute write (time-second now) <>)))) > + (catch 'system-error > + (lambda () > + (call-with-output-file expiry-file > + (cute write (time-second now) <>))) > + (lambda args > + ;; ENOENT means CACHE does not exist. > + (unless (=3D ENOENT (system-error-errno args)) And EROFS perhaps, such that "guix shell" works even if the root file syste= m was remounted read-only for some reason and all the necessary derivations have = already been built. Greetings, Maxime. --=-E+Ms8J0BLT+itdLIQQJh 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+4iGRcl7gUCYVhekxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7nAEAPwKOGXBXLXxya7HiaIWjRAUbp0K b1b/0zFzzMF4Hn2e+QEA72Q2UB9KwoJfTVA3rKwqH7wa4BmQLmEhvgucBUxZRAw= =HxkF -----END PGP SIGNATURE----- --=-E+Ms8J0BLT+itdLIQQJh--