From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 02 09:29:00 2021 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> Subject: Re: [bug#50960] [PATCH 09/10] cache: Gracefully handle non-existent cache. From: Maxime Devos To: Ludovic =?ISO-8859-1?Q?Court=E8s?= , 50960@debbugs.gnu.org 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-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 50960 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-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--