From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 02 05:24:09 2022 Received: (at 52555) by debbugs.gnu.org; 2 Feb 2022 10:24:09 +0000 Received: from localhost ([127.0.0.1]:51522 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFCo5-0000TA-6T for submit@debbugs.gnu.org; Wed, 02 Feb 2022 05:24:09 -0500 Received: from mout01.posteo.de ([185.67.36.65]:58289) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFCo3-0000Sf-FJ for 52555@debbugs.gnu.org; Wed, 02 Feb 2022 05:24:08 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 2576F240028 for <52555@debbugs.gnu.org>; Wed, 2 Feb 2022 11:24:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1643797441; bh=rp6NqHJ5LqbUHJ89ygY77J91IX+CrsOiM8WOteMtTTE=; h=From:To:Cc:Subject:Date:From; b=QLxFHD+YFOOKlXJqaYCOubZ/fRujoADsSISKGY/AXVque2hyQN4Wtha2R90cbKixL lrZQzHCdRkFa1orooW3TksBUYCevZhFMUjBKYTcc5/NQd2Y/Mbz4ldWnQ4jjjN8RIi bcMpIQREXJXqVGMtG6JZ/JNK5jOmED/XtSI1n3hJGfavCxlBYHeKiG9d2zQixxGHeV db1iBr3Vm5YqxoiFiqydhArqaCeV5Pyal+CflF9+s6EZL2ph+YrYaHAGd5ZS4f60U9 QkOXSMvCWj1CxqxHU1Ky59ubMj/v4VfjAqwkdGp2UCz83noMJJYYLtEb3FArGeD6Nf /lTGJtoNjjniA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4JpdFC1N1Jz6vGj; Wed, 2 Feb 2022 11:23:58 +0100 (CET) References: <20220125192201.7582-1-pukkamustard@posteo.net> <20220125192201.7582-3-pukkamustard@posteo.net> <46558e7148b91f12cdaa92f32adb91bbcb3080bd.camel@telenet.be> From: pukkamustard To: Maxime Devos Subject: Re: [bug#52555] [RFC PATCH v2 2/5] publish: Add ERIS URN to narinfo Date: Wed, 02 Feb 2022 10:16:12 +0000 In-reply-to: <46558e7148b91f12cdaa92f32adb91bbcb3080bd.camel@telenet.be> Message-ID: <86wnidh8ht.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 52555 Cc: ~pukkamustard/eris@lists.sr.ht, 52555@debbugs.gnu.org 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: -3.3 (---) Maxime Devos writes: > pukkamustard schreef op di 25-01-2022 om 19:21 [+0000]: >> +=C2=A0 (define (eris-encode-nar compressions) >> +=C2=A0=C2=A0=C2=A0 (and (member %eris-zstd-compression compressions) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let* ((nar (nar-cache= -file cache item >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #:= compression %eris-zstd-compression)) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 (stat (stat nar #f))) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (and stat >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 (call-with-input-file nar >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (cut eris-encode->string <> >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #:block-siz= e %eris-block-size-large)))))) > > Why are exceptions turned into #f (in (stat nar #f))? > Should this be done for all I/O errors, including, say, EOVERFLOW, > ENOMEM or ENAMETOOLONG, or only for ENOENT? > > Is a race condition possible here? If so, maybe consider doing > something like > > (catch 'system-error > (lambda () (call-with-input-file ...)) > (lambda exception > (and it-is-a-ENOENT > (apply throw exception)))) > > to avoid it? A valid question. But (stat nar #f) is not something I introduced. It is already in guix/scripts/publish.scm like that. To me turning all exceptions to #f makes sense. Here we only want to know if the file is readable. As the NAR is baked in the background by another thread the case where the compressed NAR does exist yet will happen. In that case we don't worry, we just don't publish the `FileSize` and `ERIS` fields in the narinfo. -pukkamustard