From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WFWLA0lc+mGEjgAAgWs5BA (envelope-from ) for ; Wed, 02 Feb 2022 11:26:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id WEYLOEhc+mEEhAEAG6o9tA (envelope-from ) for ; Wed, 02 Feb 2022 11:26:16 +0100 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 B15343635A for ; Wed, 2 Feb 2022 11:26:16 +0100 (CET) Received: from localhost ([::1]:54862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFCq7-0002EK-Ta for larch@yhetil.org; Wed, 02 Feb 2022 05:26:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFCpB-0002DA-IB for guix-patches@gnu.org; Wed, 02 Feb 2022 05:25:18 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57625) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nFCow-0007qt-9e for guix-patches@gnu.org; Wed, 02 Feb 2022 05:25:16 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nFCow-0000US-2Z for guix-patches@gnu.org; Wed, 02 Feb 2022 05:25:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52555] [RFC PATCH v2 2/5] publish: Add ERIS URN to narinfo Resent-From: pukkamustard Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 02 Feb 2022 10:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52555 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: ~pukkamustard/eris@lists.sr.ht, 52555@debbugs.gnu.org Received: via spool by 52555-submit@debbugs.gnu.org id=B52555.16437974491812 (code B ref 52555); Wed, 02 Feb 2022 10:25:02 +0000 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 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-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 X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643797576; 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:dkim-signature; bh=UOhjC0KttpNA8mAhJqiaMnwgrexqZo95QiEyeXWntSI=; b=Y5kX7FG5dOonViSxWVlhBs8DfqzMHHpzMoHjLCWKU2o8wDE7nJ3Cb66+43x17MYIYTAgQB R9AGcZs5qb/J3CEa4BUIAjf2OFNWgJKWYiBgI2uIZiX5/BYIvW5HVs4FK1+qcVwx/3cg0w nDtF5gJ1c4/WpaZ03lgs6Vn4KQpt/0RqpOXrvhmPRn3qy7Firr3jusMsVSX8me4cQ0YxZf OcsK6UVhNcDuIcpiDYJb+lvNHbCnHz/5At4OFnculavu+68JxVm8wChGVmQuKP3I33+4mk THU/ieJ+HOUTwOxMXRyKIfZgc1l8c3Pj5yhgo+2JKsjS/qcZaV7eIiHYqJWWiA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643797576; a=rsa-sha256; cv=none; b=HMx7TKalIBXv8tRvhesya5ZPfyIYR4urG7DwyAVTdcg15g0i9RTrf3lPY+AXGPGXIeqe1v edOIBU6j/RSef3UE1mMDhz1oDuCVe86qxKCKVzbz9HWvoPzkRQT8ejtQsxnZxuR3tLF7xr E9uVc9j7e5dQ8U0QybRURpKA+jOQMZ7fyhgeT9KhYqNz0ITG1DniEhTzygN2boC64FbuOC N3pfnJioJSt0zNEofz8JtaftU7SDvW0TxvOoNHfAf45cd7eBZ4Le3XryAT8cgNH3t1cT4D e/AYDZS6TS4FA8vAM6LDZ6P+lzuc6ZimyGLHdZuDWV3USCR7N1TRKoH3hXY0iQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=QLxFHD+Y; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.03 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=QLxFHD+Y; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: B15343635A X-Spam-Score: -3.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9RH7YOa1HQzt 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