From patchwork Thu Dec 28 09:40:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pukkamustard X-Patchwork-Id: 58127 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E968227BBE9; Thu, 28 Dec 2023 09:41:26 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0721227BBE2 for ; Thu, 28 Dec 2023 09:41:26 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rImt0-0007d2-W5; Thu, 28 Dec 2023 04:41:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rImsy-0007cG-Rp for guix-patches@gnu.org; Thu, 28 Dec 2023 04:41:04 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rImsy-00082a-DZ; Thu, 28 Dec 2023 04:41:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rImsw-0005kz-5p; Thu, 28 Dec 2023 04:41:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52555] [PATCH v4 1/7] narinfo: Add ERIS field. Resent-From: pukkamustard Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Thu, 28 Dec 2023 09:41: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: 52555@debbugs.gnu.org Cc: pukkamustard , ludo@gnu.org, maximedevos@telenet.be, Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 52555-submit@debbugs.gnu.org id=B52555.170375643421998 (code B ref 52555); Thu, 28 Dec 2023 09:41:02 +0000 Received: (at 52555) by debbugs.gnu.org; 28 Dec 2023 09:40:34 +0000 Received: from localhost ([127.0.0.1]:38506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rImsT-0005ii-Rn for submit@debbugs.gnu.org; Thu, 28 Dec 2023 04:40:34 -0500 Received: from mout01.posteo.de ([185.67.36.65]:57653) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rImsS-0005iI-5p for 52555@debbugs.gnu.org; Thu, 28 Dec 2023 04:40:32 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 5DEC0240029 for <52555@debbugs.gnu.org>; Thu, 28 Dec 2023 10:40:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703756427; bh=C7DasrBu7qWaF2tHB6A9GffXP4Z1A0kR60CwJnxDNe0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=SnRJsjZWTZnX+OFGY84Y2sD5Sa/2AC9vIlebn3mbp3btoGkFL/6QFEKAfGMHOr57F 5YFV7U5q1rIr81U/aVUVYY7+J/PaPIIYLODitg6MgyraMyM0UW59HEgIWEoihhO3Y2 OMXG858yL56E9Dw6gJMcz4/H28YbnZMzcDP2jCub9Xnq+CZ8MH+pT4bWyaJ9XhPxc9 wwxiKJH/9bCAk19sK82p3KDrs4tjGPUc6hd+HRBmWEIuP2MheyCzQ5i5fVRFqmzCBI Yc7s71wIEXWFNBLgLz42xXTRBvFwCgTQJjgpqjOH4y0A28MKuuMvIqQ29gj7WDZueW lWbwomaJFs03g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T13Qf40s3z6tn4; Thu, 28 Dec 2023 10:40:26 +0100 (CET) From: pukkamustard Date: Thu, 28 Dec 2023 09:40:04 +0000 Message-ID: <7c1c7108a369b608e8cebbe09c4cbfe24d032067.1703316055.git.pukkamustard@posteo.net> In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/narinfo.scm ()[eris-urn]: New field. (narinfo-maker): Handle new field. (read-narifno): Handle new field. (equivalent-narinfo?): Require ERIS field to be equal. --- guix/narinfo.scm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/guix/narinfo.scm b/guix/narinfo.scm index a149d9a901..5f5ed8be6f 100644 --- a/guix/narinfo.scm +++ b/guix/narinfo.scm @@ -45,6 +45,7 @@ (define-module (guix narinfo) narinfo-file-sizes narinfo-hash narinfo-size + narinfo-eris-urn narinfo-references narinfo-deriver narinfo-system @@ -69,7 +70,7 @@ (define-module (guix narinfo) (define-record-type (%make-narinfo path uri-base uris compressions file-sizes file-hashes - nar-hash nar-size references deriver system + nar-hash nar-size eris-urn references deriver system signature contents) narinfo? (path narinfo-path) @@ -80,6 +81,7 @@ (define-record-type (file-hashes narinfo-file-hashes) (nar-hash narinfo-hash) (nar-size narinfo-size) + (eris-urn narinfo-eris-urn) (references narinfo-references) (deriver narinfo-deriver) (system narinfo-system) @@ -136,7 +138,7 @@ (define (narinfo-maker str cache-url) "Return a narinfo constructor for narinfos originating from CACHE-URL. STR must contain the original contents of a narinfo file." (lambda (path urls compressions file-hashes file-sizes - nar-hash nar-size references deriver system + nar-hash nar-size eris-urn references deriver system signature) "Return a new object." (define len (length urls)) @@ -158,6 +160,7 @@ (define (narinfo-maker str cache-url) ((lst ...) (map string->number lst))) nar-hash (and=> nar-size string->number) + (if eris-urn (string->uri eris-urn) #f) (string-tokenize references) (match deriver ((or #f "") #f) @@ -185,7 +188,7 @@ (define* (read-narinfo port #:optional url (narinfo-maker str url) '("StorePath" "URL" "Compression" "FileHash" "FileSize" "NarHash" "NarSize" - "References" "Deriver" "System" + "ERIS" "References" "Deriver" "System" "Signature") '("URL" "Compression" "FileSize" "FileHash")))) @@ -271,7 +274,13 @@ (define (equivalent-narinfo? narinfo1 narinfo2) (narinfo-references narinfo2)) (= (narinfo-size narinfo1) - (narinfo-size narinfo2)))) + (narinfo-size narinfo2)) + + ;; When downloading substitutes with ERIS the hash is not checked. To + ;; avoid malicious substitutes we must ensure that the ERIS URN is equal. + ;; See also . + (equal? (narinfo-eris-urn narinfo1) + (narinfo-eris-urn narinfo2)))) (define %compression-methods ;; Known compression methods and a thunk to determine whether they're From patchwork Thu Dec 28 09:40:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pukkamustard X-Patchwork-Id: 58126 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 91FB427BBEA; Thu, 28 Dec 2023 09:41:20 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id F2D6227BBE2 for ; Thu, 28 Dec 2023 09:41:19 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rImsz-0007cb-Rm; Thu, 28 Dec 2023 04:41:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rImsx-0007bs-PT for guix-patches@gnu.org; Thu, 28 Dec 2023 04:41:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rImsx-00082H-GI for guix-patches@gnu.org; Thu, 28 Dec 2023 04:41:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rImsw-0005l9-Kd for guix-patches@gnu.org; Thu, 28 Dec 2023 04:41:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52555] [PATCH v4 2/7] gnu: Add guile-coap. Resent-From: pukkamustard Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 28 Dec 2023 09:41: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: 52555@debbugs.gnu.org Cc: pukkamustard , ludo@gnu.org, maximedevos@telenet.be Received: via spool by 52555-submit@debbugs.gnu.org id=B52555.170375643822042 (code B ref 52555); Thu, 28 Dec 2023 09:41:02 +0000 Received: (at 52555) by debbugs.gnu.org; 28 Dec 2023 09:40:38 +0000 Received: from localhost ([127.0.0.1]:38518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rImsY-0005jM-8W for submit@debbugs.gnu.org; Thu, 28 Dec 2023 04:40:38 -0500 Received: from mout01.posteo.de ([185.67.36.65]:51185) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rImsT-0005iM-1r for 52555@debbugs.gnu.org; Thu, 28 Dec 2023 04:40:33 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 4079A240028 for <52555@debbugs.gnu.org>; Thu, 28 Dec 2023 10:40:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703756428; bh=Sdoht0UFA996/7WsDDl+9pl/JxEuhWozmUYjXqLx+KA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=F5S5865GWY6wpb9BsgumdfWcpLT/JSdnBxBYehvjigQ0Es+mWoX3GHK5lbh6D/9v5 eEApxQ/VBNnh9BgGzZaU8bRKJ5gOLZuznJV+L4cB99D5raaLayLhyaOjov+O4Ffywg yWW4SvIkqbVh6lDTXKkB4A/g8ORhsGedgBLtFlYF3h16Av6zZsxkgdDjzCFoZvcg5A osluOxx3dlZktf3neOQXMI19VzP4lzqZm2XJxT0828Av23ukqND1uSd7oNjiYKU61a 8dYasXuyUoxCEPJL5GMjCz8u0oA8DaZI37udGssLILEdZg7QkYvWagbpIeNvQ1IACD jNAD/AEOvX9CA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T13Qg34Gdz6tn4; Thu, 28 Dec 2023 10:40:27 +0100 (CET) From: pukkamustard Date: Thu, 28 Dec 2023 09:40:05 +0000 Message-ID: In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/guile-xyz.scm (guile-coap): New variable. --- gnu/packages/guile-xyz.scm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index 7b44dc3167..2fc6d079a1 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -1457,6 +1457,38 @@ (define-public guile-aws the Guile compiler tower to generate the DSL from AWS JSON specifications.") (license license:gpl3+)))) +(define-public guile-coap + (let ((commit "1218d4f98210a14b52cf8185c9a7d39ed8b28643") + (revision "0")) + (package + (name "guile-coap") + (version (git-version "0.2.0-dev" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://codeberg.org/eris/guile-coap.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 (base32 "0mk9s4vzsi5y3sk8rs4a0jdcn6qj54nh7nwicdrsj77b9nghqwb3")))) + (build-system gnu-build-system) + (native-inputs + (list autoconf + automake + pkg-config + texinfo)) + (inputs (list guile-3.0)) + (propagated-inputs (list guile-fibers)) + (synopsis "Guile implementation of the Constrained Application Protocol (CoAP)") + (description "Gulie-CoAP is a Guile implementation of the Constrained +Application Protocol (CoAP). CoAP is a network transport protocol specialized +for use with constrained nodes and constrained networks (e.g. low-power, +lousy). This library implements basic serialization of CoAP messages over UDP +(RFC 7252) and TCP (RFC 8323) as well as an asynchronous TCP client (using +@code{guile-fibers})." ) + (home-page "https://codeberg.org/eris/guile-coap") + (license license:gpl3+)))) + (define-public guile-simple-zmq (let ((commit "d25d1865e3378d93c44e2b4f5246a70b078a489d") (revision "11")) From patchwork Thu Dec 28 09:40:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pukkamustard X-Patchwork-Id: 58128 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9AD4F27BBE9; Thu, 28 Dec 2023 09:41:32 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 37A0527BBE2 for ; Thu, 28 Dec 2023 09:41:31 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rImt0-0007cf-85; Thu, 28 Dec 2023 04:41:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rImsy-0007c6-A9 for guix-patches@gnu.org; Thu, 28 Dec 2023 04:41:04 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rImsx-00082P-U4 for guix-patches@gnu.org; Thu, 28 Dec 2023 04:41:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rImsx-0005lH-1v for guix-patches@gnu.org; Thu, 28 Dec 2023 04:41:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52555] [PATCH v4 3/7] gnu: guile-eris: Update to 1.2.0-dev. Resent-From: pukkamustard Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 28 Dec 2023 09:41:03 +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: 52555@debbugs.gnu.org Cc: pukkamustard , ludo@gnu.org, maximedevos@telenet.be Received: via spool by 52555-submit@debbugs.gnu.org id=B52555.170375643922049 (code B ref 52555); Thu, 28 Dec 2023 09:41:03 +0000 Received: (at 52555) by debbugs.gnu.org; 28 Dec 2023 09:40:39 +0000 Received: from localhost ([127.0.0.1]:38520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rImsY-0005jT-Lj for submit@debbugs.gnu.org; Thu, 28 Dec 2023 04:40:39 -0500 Received: from mout01.posteo.de ([185.67.36.65]:56471) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rImsT-0005iO-Uv for 52555@debbugs.gnu.org; Thu, 28 Dec 2023 04:40:34 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 28B8524002A for <52555@debbugs.gnu.org>; Thu, 28 Dec 2023 10:40:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703756429; bh=X4U62uiPV2fS1TrDtg+aGlCOageg3D6NqcSBwK+JJF4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=lBt5N7FYl5dGkZ+rSegXVOlKqbIcp/uDdHKIBSeS7TFnbYU4Wc9p9YjxAwW4xXmw1 pvAidI3RHN8Hngcqs2ldDcM1frUCuiM6HY9CLPIGMFza622ewXuCNYM9Kn2SnR1PGc 5xnkOj+7jCnX0sJRdtFB6MINL1iWuegRW+WorJ5VzqI4kTgrLTwhFXdg/K6ILZrin1 mDMz1fFKxbIhecZOv72F/bsdSDbK0Sl1UxjQtVyl0A8YEu7/sdLXUFEgoxrrxrVhdu tRu2E851Aeoob+XQ3jYWYecIO5JQJEoflURngObIM1D4sX6vJfCt4okfsyFSI7KHPX lUVWquPxeQCeg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T13Qh2qvSz6tn4; Thu, 28 Dec 2023 10:40:28 +0100 (CET) From: pukkamustard Date: Thu, 28 Dec 2023 09:40:06 +0000 Message-ID: In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/guile-xyz.scm (guile-eris): Update to 1.2.0-dev. [propagated-inputs]: Add guile-coap, guile-fibers, guile-sqlite3, guile-zstd and guile-cbor. --- gnu/packages/guile-xyz.scm | 66 +++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index 2fc6d079a1..a66a6d8ad5 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -5152,38 +5152,46 @@ (define-public guile-sodium (license license:gpl3+))) (define-public guile-eris - (package - (name "guile-eris") - (version "1.0.0") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://codeberg.org/eris/guile-eris.git") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 (base32 "0d4wbjwwaxk0zn5gjhl86qhvk1aisgzp1vnvy4xbvrv5ydqpgyqm")))) - (build-system gnu-build-system) - (arguments '()) - (native-inputs - (list autoconf - automake - pkg-config - texinfo - ;; test dependency - guile-srfi-180 - guile-quickcheck)) - (inputs (list guile-3.0)) - (propagated-inputs - (list guile-sodium)) - (synopsis "Guile implementation of the Encoding for Robust Immutable Storage (ERIS)") - (description - "Guile-ERIS is a Guile implementation of the @url{http://purl.org/eris, + (let ((commit "98ec63cc04c7c59be8d09beed99a0ab1975829ce") + (revision "0")) + (package + (name "guile-eris") + (version (git-version "1.2.0-dev" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://codeberg.org/eris/guile-eris.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 (base32 "0n4crjqhj0ndni02xyrhwpzd325668vjbj3c1asy8wh2j50rvcs7")))) + (build-system gnu-build-system) + (arguments '()) + (native-inputs + (list autoconf + automake + pkg-config + texinfo + ;; test dependency + guile-srfi-180 + guile-quickcheck)) + (inputs (list guile-3.0)) + (propagated-inputs + (list guile-sodium + guile-coap + guile-fibers + guile-sqlite3 + guile-zstd + guile-cbor)) + (synopsis "Guile implementation of the Encoding for Robust Immutable +Storage (ERIS)") + (description + "Guile-ERIS is a Guile implementation of the @url{http://purl.org/eris, Encoding for Robust Immutable Storage (ERIS)}. ERIS allows arbitrary content to be encoded into uniformly sized, encrypted blocks that can be reassembled using a short read-capability.") - (home-page "https://codeberg.org/eris/guile-eris") - (license license:gpl3+))) + (home-page "https://codeberg.org/eris/guile-eris") + (license license:gpl3+)))) (define-public guile-r6rs-protobuf (package From patchwork Thu Dec 28 09:40:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: pukkamustard X-Patchwork-Id: 58129 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1FF0127BBEA; Thu, 28 Dec 2023 09:41:38 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2DCF127BBE2 for ; Thu, 28 Dec 2023 09:41:36 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rImt2-0007eA-De; Thu, 28 Dec 2023 04:41:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rImt1-0007d9-6O for guix-patches@gnu.org; Thu, 28 Dec 2023 04:41:07 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rImt0-000834-T1; Thu, 28 Dec 2023 04:41:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rImsx-0005lO-Hs; Thu, 28 Dec 2023 04:41:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52555] [PATCH v4 4/7] publish: Add ERIS URN to narinfo. Resent-From: pukkamustard Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Thu, 28 Dec 2023 09:41:03 +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: 52555@debbugs.gnu.org Cc: pukkamustard , ludo@gnu.org, maximedevos@telenet.be, Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 52555-submit@debbugs.gnu.org id=B52555.170375644022058 (code B ref 52555); Thu, 28 Dec 2023 09:41:03 +0000 Received: (at 52555) by debbugs.gnu.org; 28 Dec 2023 09:40:40 +0000 Received: from localhost ([127.0.0.1]:38522 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rImsZ-0005ja-5k for submit@debbugs.gnu.org; Thu, 28 Dec 2023 04:40:40 -0500 Received: from mout02.posteo.de ([185.67.36.66]:35927) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rImsU-0005iQ-VW for 52555@debbugs.gnu.org; Thu, 28 Dec 2023 04:40:36 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 2E175240105 for <52555@debbugs.gnu.org>; Thu, 28 Dec 2023 10:40:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703756430; bh=D1gabgpydjsdJrKn5ayoFzKFjF17cQX7Sn4fJkp+bHs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=fRVwKOzvGNfuAZTgVCe16rym1DbWmhdUhT1wMBo19eEOHq/YBv2HUtYoIPAY8Ag9S srbP3pWjMdCwOxaFBco1jZPUsNMEt+ewE7/07LqhpvdRg75pqG23/sclD3+5KMtBfc 7t/qdApgVyZwOmR3MCom6fQhsz+AdxT34b2iQSfEwuR4RSnk68jvlrNkf2d/0ogOkd 2VMuQMvWdcTl+5pSCPLB9WP8nkAmLWr9nxqnLGcKv8ZVp6avlX2Qe2wbjR1MNFUYiV 35zbj6ObC17W/5xNjubZBGwAY4dchvhPwHA9bfvoetjY4A+e6iu+c+GlzaLMPrzAyc 9ZU8Ey2hEvN0Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T13Qj2LFSz6tyf; Thu, 28 Dec 2023 10:40:29 +0100 (CET) From: pukkamustard Date: Thu, 28 Dec 2023 09:40:07 +0000 Message-ID: <000b47eb98b4f22a24f246cc12bb405c65efdf57.1703316055.git.pukkamustard@posteo.net> In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/scripts/publish.scm (bake-narinfo+nar): Encode store item using ERIS. (show-help, %options): Add '--eris'. (guix-publish): Honor '--eris'. * gnu/packages/package-management.scm (guix): Add guile-eris to native-inputs. * guix/eris.scm: New file. * Makefile.am (MODULES): Add new file. --- Makefile.am | 1 + configure.ac | 5 ++ gnu/packages/package-management.scm | 1 + guix/eris.scm | 73 +++++++++++++++++++++++++++++ guix/scripts/publish.scm | 51 ++++++++++++++------ 5 files changed, 117 insertions(+), 14 deletions(-) create mode 100644 guix/eris.scm diff --git a/Makefile.am b/Makefile.am index b64dcaa77c..86da4560e4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -136,6 +136,7 @@ MODULES = \ guix/least-authority.scm \ guix/read-print.scm \ guix/ipfs.scm \ + guix/eris.scm \ guix/platform.scm \ guix/platforms/arm.scm \ guix/platforms/avr.scm \ diff --git a/configure.ac b/configure.ac index ecbd596a34..7e25099c4c 100644 --- a/configure.ac +++ b/configure.ac @@ -173,6 +173,11 @@ GUILE_MODULE_AVAILABLE([have_guile_avahi], [(avahi)]) AM_CONDITIONAL([HAVE_GUILE_AVAHI], [test "x$have_guile_avahi" = "xyes"]) +dnl Check for Guile-ERIS. +GUILE_MODULE_AVAILABLE([have_guile_eris], [(eris)]) +AM_CONDITIONAL([HAVE_GUILE_ERIS], + [test "x$have_guile_eris" = "xyes"]) + dnl Guile-newt is used by the graphical installer. GUILE_MODULE_AVAILABLE([have_guile_newt], [(newt)]) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 97ea41df66..9c0afb70dd 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -478,6 +478,7 @@ (define-public guix ("guile-zstd" ,guile-zstd) ("guile-ssh" ,guile-ssh) ("guile-git" ,guile-git) + ("guile-eris" ,guile-eris) ;; XXX: Keep the development inputs here even though ;; they're unnecessary, just so that 'guix environment diff --git a/guix/eris.scm b/guix/eris.scm new file mode 100644 index 0000000000..d98a9a62bd --- /dev/null +++ b/guix/eris.scm @@ -0,0 +1,73 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 pukkamustard +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix eris) + + #:use-module (eris) + #:use-module (eris fs) + #:use-module (eris sqlite) + #:use-module (eris read-capability) + + #:use-module (web uri) + #:use-module (ice-9 match) + #:use-module (srfi srfi-171) + + #:export (%eris-store-url + eris-encode-store-item)) + +(define %eris-store-url + (make-parameter + (getenv "ERIS_STORE_URL") + (lambda (val) + (cond + ((uri? val) val) + ((string? val) (string->uri val)) + (else #f))))) + +(define %guix-eris-convergence-secret + (make-parameter %null-convergence-secret)) + +(define (guix-eris-block-reducer) + "Returns an ERIS block reducer." + (if (uri? (%eris-store-url)) + (match (uri-scheme (%eris-store-url)) + + ;; Store blocks in an SQLite database (see + ;; https://eris.codeberg.page/eer/sqlite.xml) + ('sqlite + (eris-sqlite-block-reducer (uri-path (%eris-store-url)))) + + ;; TODO + ;; ('coap+unix #f) + ;; ('coap+tcp #f) + + (_ (error "Don't know how to handle ERIS store URL " + (uri->string (%eris-store-url))))) + + ;; If no ERIS store URL is provided we just compute the ERIS URN without + ;; storing the blocks anywhere. As dummy block-reducer we use `rcount` from + ;; SRFI-171 that counts the number of blocks. + rcount)) + +(define* (eris-encode-store-item item) + "Encodes the store item ITEM using ERIS and returns the read capability as +string." + (eris-read-capability->string + (eris-fs-encode item + #:convergence-secret (%guix-eris-convergence-secret) + #:block-reducer (guix-eris-block-reducer)))) diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm index 4457be1fce..2e7138f3c7 100644 --- a/guix/scripts/publish.scm +++ b/guix/scripts/publish.scm @@ -53,6 +53,7 @@ (define-module (guix scripts publish) #:use-module (guix workers) #:use-module (guix store) #:use-module ((guix serialization) #:select (write-file)) + #:use-module (guix eris) #:use-module (zlib) #:autoload (lzlib) (call-with-lzip-output-port make-lzip-output-port) @@ -96,6 +97,8 @@ (define (show-help) (display (G_ " --cache-bypass-threshold=SIZE serve store items below SIZE even when not cached")) + (display (G_ " + --eris[=STORE] encode items using ERIS and publish blocks to STORE")) (display (G_ " --workers=N use N workers to bake items")) (display (G_ " @@ -218,6 +221,9 @@ (define %options (lambda (opt name arg result) (alist-cons 'workers (string->number* arg) result))) + (option '("eris") #f #t + (lambda (opt name arg result) + (alist-cons 'eris (or arg #t) result))) (option '("ttl") #t #f (lambda (opt name arg result) (let ((duration (string->duration arg))) @@ -319,7 +325,8 @@ (define* (store-item->recutils store-item (define* (narinfo-string store store-path #:key (compressions (list %no-compression)) - (nar-path "nar") (file-sizes '())) + (nar-path "nar") (file-sizes '()) + eris-urn) "Generate a narinfo key/value string for STORE-PATH; an exception is raised if STORE-PATH is invalid. Produce a URL that corresponds to COMPRESSION. The narinfo is signed with KEY. NAR-PATH specifies the prefix for nar URLs. @@ -341,10 +348,10 @@ (define* (narinfo-string store store-path "\ StorePath: ~a NarHash: sha256:~a -NarSize: ~d +NarSize: ~d~@[~%ERIS: ~a~] References: ~a~%" store-path - hash size references)) + hash size eris-urn references)) ;; Do not render a "Deriver" line if we are rendering info for a ;; derivation. Also do not render a "System" line that would be ;; expensive to compute and is currently unused. @@ -530,7 +537,7 @@ (define (bypass-cache? store item) (define* (render-narinfo/cached store request hash #:key ttl (compressions (list %no-compression)) (nar-path "nar") negative-ttl - cache pool) + cache pool eris?) "Respond to the narinfo request for REQUEST. If the narinfo is available in CACHE, then send it; otherwise, return 404 and \"bake\" that nar and narinfo requested using POOL." @@ -575,7 +582,8 @@ (define* (render-narinfo/cached store request hash (bake-narinfo+nar cache item #:ttl ttl #:compressions compressions - #:nar-path nar-path))) + #:nar-path nar-path + #:eris? eris?))) (when ttl (single-baker 'cache-cleanup @@ -636,7 +644,8 @@ (define (compress-nar cache item compression) (define* (bake-narinfo+nar cache item #:key ttl (compressions (list %no-compression)) - (nar-path "/nar")) + (nar-path "/nar") + (eris? #f)) "Write the narinfo and nar for ITEM to CACHE." (define (compressed-nar-size compression) (let* ((nar (nar-cache-file cache item #:compression compression)) @@ -644,7 +653,10 @@ (define* (bake-narinfo+nar cache item (and stat (cons compression (stat:size stat))))) - (let ((compression (actual-compressions item compressions))) + (let ((compression (actual-compressions item compressions)) + (eris-urn (if eris? + (eris-encode-store-item item) + #f))) (for-each (cut compress-nar cache item <>) compressions) @@ -662,7 +674,8 @@ (define* (bake-narinfo+nar cache item (display (narinfo-string store item #:nar-path nar-path #:compressions compressions - #:file-sizes sizes) + #:file-sizes sizes + #:eris-urn eris-urn) port))) ;; Make the cached narinfo world-readable, contrary to what @@ -1060,7 +1073,8 @@ (define* (make-request-handler store cache pool narinfo-ttl narinfo-negative-ttl (nar-path "nar") - (compressions (list %no-compression))) + (compressions (list %no-compression)) + (eris? #f)) (define compression-type? string->compression-type) @@ -1092,7 +1106,8 @@ (define* (make-request-handler store #:ttl narinfo-ttl #:negative-ttl narinfo-negative-ttl #:nar-path nar-path - #:compressions compressions) + #:compressions compressions + #:eris? eris?) (render-narinfo store request hash #:ttl narinfo-ttl #:negative-ttl narinfo-negative-ttl @@ -1162,7 +1177,7 @@ (define* (run-publish-server socket store advertise? port (compressions (list %no-compression)) (nar-path "nar") narinfo-ttl narinfo-negative-ttl - cache pool) + cache pool eris?) (when advertise? (let ((name (service-name))) ;; XXX: Use a callback from Guile-Avahi here, as Avahi can pick a @@ -1178,7 +1193,8 @@ (define* (run-publish-server socket store #:nar-path nar-path #:narinfo-ttl narinfo-ttl #:narinfo-negative-ttl narinfo-negative-ttl - #:compressions compressions) + #:compressions compressions + #:eris? eris?) concurrent-http-server `(#:socket ,socket))) @@ -1262,6 +1278,7 @@ (define-command (guix-publish . args) (repl-port (assoc-ref opts 'repl)) (cache (assoc-ref opts 'cache)) (workers (assoc-ref opts 'workers)) + (eris? (assoc-ref opts 'eris)) ;; Read the key right away so that (1) we fail early on if we can't ;; access them, and (2) we can then drop privileges. @@ -1281,7 +1298,8 @@ (define-command (guix-publish . args) (%private-key private-key) (cache-bypass-threshold (or (assoc-ref opts 'cache-bypass-threshold) - (cache-bypass-threshold)))) + (cache-bypass-threshold))) + (%eris-store-url (assoc-ref opts 'eris))) (if (eq? style 'systemd) (info (G_ "publishing (started via socket activation)~%")) (info (G_ "publishing ~a on ~a, port ~d~%") @@ -1289,6 +1307,10 @@ (define-command (guix-publish . args) (inet-ntop (sockaddr:fam address) (sockaddr:addr address)) (sockaddr:port address))) + (when (string? (assoc-ref opts 'eris)) + (info (G_ "publishing ERIS blocks to ~a~%") + (assoc-ref opts 'eris))) + (for-each (lambda (compression) (info (G_ "using '~a' compression method, level ~a~%") (compression-type compression) @@ -1312,7 +1334,8 @@ (define-command (guix-publish . args) #:nar-path nar-path #:compressions compressions #:narinfo-negative-ttl negative-ttl - #:narinfo-ttl ttl)))))) + #:narinfo-ttl ttl + #:eris? eris?)))))) ;;; Local Variables: ;;; eval: (put 'single-baker 'scheme-indent-function 1) From patchwork Thu Dec 28 09:40:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pukkamustard X-Patchwork-Id: 58130 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8596527BBE2; Thu, 28 Dec 2023 09:41:44 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A557C27BBEA for ; Thu, 28 Dec 2023 09:41:43 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rImt3-0007eD-Cq; Thu, 28 Dec 2023 04:41:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rImt1-0007d5-4z for guix-patches@gnu.org; Thu, 28 Dec 2023 04:41:07 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rImt0-000838-RU; Thu, 28 Dec 2023 04:41:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rImsy-0005lZ-17; Thu, 28 Dec 2023 04:41:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52555] [PATCH v4 5/7] eris: Connect with an ERIS Store over CoAP+Unix. Resent-From: pukkamustard Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Thu, 28 Dec 2023 09:41:03 +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: 52555@debbugs.gnu.org Cc: pukkamustard , ludo@gnu.org, maximedevos@telenet.be, Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 52555-submit@debbugs.gnu.org id=B52555.170375644022065 (code B ref 52555); Thu, 28 Dec 2023 09:41:03 +0000 Received: (at 52555) by debbugs.gnu.org; 28 Dec 2023 09:40:40 +0000 Received: from localhost ([127.0.0.1]:38524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rImsa-0005jj-4K for submit@debbugs.gnu.org; Thu, 28 Dec 2023 04:40:40 -0500 Received: from mout02.posteo.de ([185.67.36.66]:38673) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rImsW-0005iS-3U for 52555@debbugs.gnu.org; Thu, 28 Dec 2023 04:40:36 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 16657240104 for <52555@debbugs.gnu.org>; Thu, 28 Dec 2023 10:40:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703756431; bh=MpsZR+/mCFO0Zar2E/8aRpMlNeo5yh3syt0Ter6cMiw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=B87bev7hDLjGtYTHgZDQzkIxu1aVihuiG90xoP16QlBpSGABWOsK3zKNacwdSSvKz f6zbwqZ0xRl4YPuviLTiF/hOmmm3AGa749vIV19QMQ0RqhjM6pV/cq93VYpRQOiqKY xsQHOzMxPfhBHpDsq6N+HzlUzgfLt74CScBrnoQ0rdL80zcCTC8e5C4lA4R4wLauGo v2AEDh+26Rccv4yC2MpMfsfArCYlve1V5VYqTPsEBGEpQem4FH7NmSNA/bZOPxOv56 PqSa95Raz1ppzndV7QziSOlD7DaB+XvgeXodWzSysweyYtkF4lPSGq/T1yu50O9PjV zeH6ghbQTxucw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T13Qk21ZPz6tn4; Thu, 28 Dec 2023 10:40:30 +0100 (CET) From: pukkamustard Date: Thu, 28 Dec 2023 09:40:08 +0000 Message-ID: In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/eris.scm (open-coap-unix-socket): New procedure. (guix-eris-block-reducer): Handle coap+unix URIs. * guix/publish.scm (bake-narinfo+nar): Start a fibers scheduler when encoding item with ERIS. --- guix/eris.scm | 63 ++++++++++++++++++++++++++++++---------- guix/scripts/publish.scm | 9 +++++- 2 files changed, 56 insertions(+), 16 deletions(-) diff --git a/guix/eris.scm b/guix/eris.scm index d98a9a62bd..3fbedd0cb7 100644 --- a/guix/eris.scm +++ b/guix/eris.scm @@ -21,8 +21,11 @@ (define-module (guix eris) #:use-module (eris) #:use-module (eris fs) #:use-module (eris sqlite) + #:use-module (eris coap) #:use-module (eris read-capability) + #:use-module (coap tcp) + #:use-module (web uri) #:use-module (ice-9 match) #:use-module (srfi srfi-171) @@ -42,27 +45,57 @@ (define %eris-store-url (define %guix-eris-convergence-secret (make-parameter %null-convergence-secret)) +(define (open-coap-unix-socket path) + (let ((sock (socket PF_UNIX SOCK_STREAM 0))) + ;; Release FD on exec + (fcntl sock F_SETFD FD_CLOEXEC) + ;; Set to non-blocking + (fcntl sock F_SETFL (logior O_NONBLOCK (fcntl sock F_GETFL))) + ;; Connect + (connect sock AF_UNIX path) + + ;; Initialize the CoAP connection + (open-socket-for-uri #f + #:socket sock + ;; Allow up to 64 in-flight requests + #:nstart 64))) + (define (guix-eris-block-reducer) "Returns an ERIS block reducer." - (if (uri? (%eris-store-url)) - (match (uri-scheme (%eris-store-url)) + (let ((store-url (%eris-store-url))) + (if (uri? store-url) + (match (uri-scheme store-url) + + ;; Store blocks in an SQLite database (see + ;; https://eris.codeberg.page/eer/sqlite.xml) + ('sqlite + (eris-sqlite-block-reducer (uri-path store-url))) - ;; Store blocks in an SQLite database (see - ;; https://eris.codeberg.page/eer/sqlite.xml) - ('sqlite - (eris-sqlite-block-reducer (uri-path (%eris-store-url)))) + ;; Connect to a CoAP ERIS store over a Unix socket + ('coap+unix + ;; Wrap the eris-coap-block-reducer to close the provided connection. + (let ((ecbr (eris-coap-block-reducer + (build-uri 'coap #:path ".well-known/eris") + #:nstart 64 + #:connection (open-coap-unix-socket + (uri-path store-url))))) + (case-lambda + (() (ecbr)) + ((conn ref-block) (ecbr conn ref-block)) + ((conn) + (ecbr conn) + (close-port conn))))) - ;; TODO - ;; ('coap+unix #f) - ;; ('coap+tcp #f) + ;; TODO + ;; ('coap+tcp #f) - (_ (error "Don't know how to handle ERIS store URL " - (uri->string (%eris-store-url))))) + (_ (error "Don't know how to handle ERIS store URL " + (uri->string (%eris-store-url))))) - ;; If no ERIS store URL is provided we just compute the ERIS URN without - ;; storing the blocks anywhere. As dummy block-reducer we use `rcount` from - ;; SRFI-171 that counts the number of blocks. - rcount)) + ;; If no ERIS store URL is provided we just compute the ERIS URN without + ;; storing the blocks anywhere. As dummy block-reducer we use `rcount` from + ;; SRFI-171 that counts the number of blocks. + rcount))) (define* (eris-encode-store-item item) "Encodes the store item ITEM using ERIS and returns the read capability as diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm index 2e7138f3c7..0b61354327 100644 --- a/guix/scripts/publish.scm +++ b/guix/scripts/publish.scm @@ -54,6 +54,7 @@ (define-module (guix scripts publish) #:use-module (guix store) #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix eris) + #:use-module (fibers) #:use-module (zlib) #:autoload (lzlib) (call-with-lzip-output-port make-lzip-output-port) @@ -655,7 +656,13 @@ (define* (bake-narinfo+nar cache item (let ((compression (actual-compressions item compressions)) (eris-urn (if eris? - (eris-encode-store-item item) + ;; Encode with fibers. + ;; XXX: There seems to be some buggy interactions when + ;; running a fibers scheduler and connecting to the + ;; store. + (run-fibers (lambda () + (eris-encode-store-item item)) + #:drain? #t) #f))) (for-each (cut compress-nar cache item <>) compressions) From patchwork Thu Dec 28 09:40:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pukkamustard X-Patchwork-Id: 58132 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id DC8AE27BBEA; Thu, 28 Dec 2023 09:41:53 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 863C927BBE2 for ; Thu, 28 Dec 2023 09:41:52 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rImt5-0007go-1I; Thu, 28 Dec 2023 04:41:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rImt1-0007d4-2M for guix-patches@gnu.org; Thu, 28 Dec 2023 04:41:07 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rImt0-000833-Kb; Thu, 28 Dec 2023 04:41:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rImsy-0005li-DE; Thu, 28 Dec 2023 04:41:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52555] [PATCH v4 6/7] substitute: Decode substitutes using ERIS. Resent-From: pukkamustard Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Thu, 28 Dec 2023 09:41:04 +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: 52555@debbugs.gnu.org Cc: pukkamustard , ludo@gnu.org, maximedevos@telenet.be, Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 52555-submit@debbugs.gnu.org id=B52555.170375645022089 (code B ref 52555); Thu, 28 Dec 2023 09:41:04 +0000 Received: (at 52555) by debbugs.gnu.org; 28 Dec 2023 09:40:50 +0000 Received: from localhost ([127.0.0.1]:38526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rImsj-0005kC-MQ for submit@debbugs.gnu.org; Thu, 28 Dec 2023 04:40:50 -0500 Received: from mout01.posteo.de ([185.67.36.65]:38393) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rImsW-0005iV-TB for 52555@debbugs.gnu.org; Thu, 28 Dec 2023 04:40:37 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 194E124002B for <52555@debbugs.gnu.org>; Thu, 28 Dec 2023 10:40:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703756432; bh=obLvOQtF5pnpzyIIgP+dO7Dj0TpeECFmi/zdZjg9Wu8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=gPxVCDii+qC1pOBD8e9XRILtkrUjS2GmPTnEKwXdcMaCWRppCj4SpmrDn/dFJVR+a cLDpKAZT6zEFLTXoD2k+cLdT07Ttkvrafc1oaVLa89Y1SnJFrWge85Jf7nC4qZF7qX qmu+KxYWYrBOJcde+FqO3Ep7z8LCK0Psb3u2h/Y02cBTwdV6JTjK6ltY2YKkeceLbt CGfkf1ikY3LrpwnWpo6Gt6PrKOWXhlHKDiBTsvHLGAIr0wd3u/eMbgG6oe2/XWv4Q9 Hc9xZ0eUMPQoQg4ffKTdvwHwW7EVHrJ92WPcHqOB8QqCWZe0vCC+Hrru9khkXWmEC0 eFKhL4DOrZCcw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T13Ql1R7mz6tyZ; Thu, 28 Dec 2023 10:40:31 +0100 (CET) From: pukkamustard Date: Thu, 28 Dec 2023 09:40:09 +0000 Message-ID: In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/scripts/substitute.scm: Decode substitutes using ERIS. * guix/eris.scm (eris-decode-store-item): New function. * nix/nix-daemon/guix-daemon.cc (options): Add eris-store-url option. --- guix/eris.scm | 45 +++++++++++++++++---- guix/scripts/substitute.scm | 76 +++++++++++++++++++++++++++-------- nix/nix-daemon/guix-daemon.cc | 5 +++ 3 files changed, 102 insertions(+), 24 deletions(-) diff --git a/guix/eris.scm b/guix/eris.scm index 3fbedd0cb7..1aa52e69dd 100644 --- a/guix/eris.scm +++ b/guix/eris.scm @@ -21,6 +21,7 @@ (define-module (guix eris) #:use-module (eris) #:use-module (eris fs) #:use-module (eris sqlite) + #:use-module (sqlite3) #:use-module (eris coap) #:use-module (eris read-capability) @@ -31,7 +32,8 @@ (define-module (guix eris) #:use-module (srfi srfi-171) #:export (%eris-store-url - eris-encode-store-item)) + eris-encode-store-item + eris-decode-store-item)) (define %eris-store-url (make-parameter @@ -83,8 +85,7 @@ (define (guix-eris-block-reducer) (() (ecbr)) ((conn ref-block) (ecbr conn ref-block)) ((conn) - (ecbr conn) - (close-port conn))))) + (ecbr conn))))) ;; TODO ;; ('coap+tcp #f) @@ -97,10 +98,40 @@ (define (guix-eris-block-reducer) ;; SRFI-171 that counts the number of blocks. rcount))) +(define (call-with-guix-eris-block-ref proc) + (let ((store-url (%eris-store-url))) + (if (uri? store-url) + (match (uri-scheme store-url) + + ('sqlite + (let ((db (eris-sqlite-open (uri-path store-url)))) + (proc (lambda (ref) (eris-sqlite-ref db ref))) + (sqlite-close db))) + + ('coap+unix + (let ((conn (open-coap-unix-socket (uri-path store-url))) + (req-uri (build-uri 'coap #:path ".well-known/eris"))) + (proc + (lambda (ref) + (eris-coap-block-ref req-uri ref #:connection conn))) + (close-port conn))) + + (_ (error "Don't know how to handle ERIS store URL " + (uri->string (%eris-store-url))))) + + (error "No ERIS store to get blocks.")))) + (define* (eris-encode-store-item item) "Encodes the store item ITEM using ERIS and returns the read capability as string." - (eris-read-capability->string - (eris-fs-encode item - #:convergence-secret (%guix-eris-convergence-secret) - #:block-reducer (guix-eris-block-reducer)))) + (eris-fs-encode item + #:convergence-secret (%guix-eris-convergence-secret) + #:block-reducer (guix-eris-block-reducer))) + +(define* (eris-decode-store-item eris-urn destination) + "Decode a store item with read-capability ERIS-URN to DESTINATION." + (call-with-guix-eris-block-ref + (lambda (block-ref) + (eris-fs-decode eris-urn destination + #:block-ref block-ref) + #t))) diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 37cd08e289..3c060f1c89 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -45,6 +45,8 @@ (define-module (guix scripts substitute) . guix:open-connection-for-uri))) #:autoload (gnutls) (error/invalid-session error/again error/interrupted) #:use-module (guix progress) + #:use-module (guix eris) + #:use-module (fibers) #:use-module ((guix build syscalls) #:select (set-thread-name)) #:use-module (ice-9 rdelim) @@ -656,9 +658,11 @@ (define* (process-substitution/fallback port narinfo destination (() (loop rest))))))) + (define* (process-substitution port store-item destination #:key cache-urls acl - deduplicate? print-build-trace?) + deduplicate? print-build-trace? + (eris? #f)) "Substitute STORE-ITEM (a store file name) from CACHE-URLS, and write it to DESTINATION as a nar file. Verify the substitute against ACL, and verify its hash against what appears in the narinfo. When DEDUPLICATE? is true, and if @@ -674,20 +678,56 @@ (define* (process-substitution port store-item destination (leave (G_ "no valid substitute for '~a'~%") store-item)) - (guard (c ((network-error? c) - (format (current-error-port) - (G_ "retrying download of '~a' with other substitute URLs...~%") - store-item) - (process-substitution/fallback port narinfo destination - #:cache-urls cache-urls - #:acl acl - #:deduplicate? deduplicate? - #:print-build-trace? - print-build-trace?))) - (download-nar narinfo destination - #:status-port port - #:deduplicate? deduplicate? - #:print-build-trace? print-build-trace?))) + (if (and eris? + (%eris-store-url) + (narinfo-eris-urn narinfo)) + + (unless + + ;; Attempt to fetch substitute via ERIS + (let ((eris-urn (narinfo-eris-urn narinfo))) + (format (current-error-port) + (G_ "Downloading ~a...~%") (uri->string eris-urn)) + (run-fibers + (lambda () + (guard + (c (else + (format (current-error-port) + (G_ "failed to decode substitute from ERIS URN ~a: ~a" + (uri->string eris-urn) + c)) + #f)) + (eris-decode-store-item eris-urn destination) + ;; Tell the daemon that we're done. + (format port "success ~a ~a~%" + (narinfo-hash narinfo) (narinfo-size narinfo)))))) + + ;; Retry without ERIS on failure. + (process-substitution port store-item destination + #:cache-urls cache-urls + #:acl acl + #:deduplicate? deduplicate? + #:print-build-trace? print-build-trace? + #:eris? #f)) + + (guard (c ((network-error? c) + (format (current-error-port) + (G_ "retrying download of '~a' with other substitute URLs...~%") + store-item) + (process-substitution/fallback port narinfo destination + #:cache-urls cache-urls + #:acl acl + #:deduplicate? deduplicate? + #:print-build-trace? + print-build-trace?))) + (download-nar narinfo destination + #:status-port port + #:deduplicate? deduplicate? + #:print-build-trace? print-build-trace?)))) + + + + ;;; @@ -876,7 +916,8 @@ (define-command (guix-substitute . args) ;; Download STORE-PATH and store it as a Nar in file DESTINATION. ;; Specify the number of columns of the terminal so the progress ;; report displays nicely. - (parameterize ((current-terminal-columns (client-terminal-columns))) + (parameterize ((current-terminal-columns (client-terminal-columns)) + (%eris-store-url (find-daemon-option "eris-store-url"))) (let loop () (match (read-line) ((? eof-object?) @@ -887,7 +928,8 @@ (define-command (guix-substitute . args) #:acl (current-acl) #:deduplicate? deduplicate? #:print-build-trace? - print-build-trace?) + print-build-trace? + #:eris? #t) (loop)))))) (opts (leave (G_ "~a: unrecognized options~%") opts)))))) diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc index d7ab9c5e64..d6b054bc6c 100644 --- a/nix/nix-daemon/guix-daemon.cc +++ b/nix/nix-daemon/guix-daemon.cc @@ -90,6 +90,7 @@ builds derivations on behalf of its clients."); #define GUIX_OPT_MAX_SILENT_TIME 19 #define GUIX_OPT_LOG_COMPRESSION 20 #define GUIX_OPT_DISCOVER 21 +#define GUIX_OPT_ERIS_STORE_URL 22 static const struct argp_option options[] = { @@ -132,6 +133,8 @@ static const struct argp_option options[] = n_("use the specified compression type for build logs") }, { "discover", GUIX_OPT_DISCOVER, "yes/no", OPTION_ARG_OPTIONAL, n_("use substitute servers discovered on the local network") }, + { "eris-store-url", GUIX_OPT_ERIS_STORE_URL, n_("URL"), 0, + n_("use URL to retrieve blocks of ERIS encoded substitutes") }, /* '--disable-deduplication' was known as '--disable-store-optimization' up to Guix 0.7 included, so keep the alias around. */ @@ -270,6 +273,8 @@ parse_opt (int key, char *arg, struct argp_state *state) useDiscover = string_to_bool (arg); settings.set ("discover", useDiscover ? "true" : "false"); break; + case GUIX_OPT_ERIS_STORE_URL: + settings.set ("eris-store-url", arg); case GUIX_OPT_DEBUG: verbosity = lvlDebug; break; From patchwork Thu Dec 28 09:40:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pukkamustard X-Patchwork-Id: 58131 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A861827BBEA; Thu, 28 Dec 2023 09:41:50 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0F83E27BBE2 for ; Thu, 28 Dec 2023 09:41:50 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rImt5-0007gs-71; Thu, 28 Dec 2023 04:41:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rImt1-0007d3-2L for guix-patches@gnu.org; Thu, 28 Dec 2023 04:41:07 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rImt0-000830-DU for guix-patches@gnu.org; Thu, 28 Dec 2023 04:41:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rImsz-0005m4-Fd for guix-patches@gnu.org; Thu, 28 Dec 2023 04:41:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52555] [PATCH v4 7/7] gnu: Add kapla. Resent-From: pukkamustard Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 28 Dec 2023 09:41:05 +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: 52555@debbugs.gnu.org Cc: pukkamustard , ludo@gnu.org, maximedevos@telenet.be Received: via spool by 52555-submit@debbugs.gnu.org id=B52555.170375645422106 (code B ref 52555); Thu, 28 Dec 2023 09:41:05 +0000 Received: (at 52555) by debbugs.gnu.org; 28 Dec 2023 09:40:54 +0000 Received: from localhost ([127.0.0.1]:38530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rImsn-0005kP-UD for submit@debbugs.gnu.org; Thu, 28 Dec 2023 04:40:54 -0500 Received: from mout01.posteo.de ([185.67.36.65]:43011) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rImsX-0005iW-My for 52555@debbugs.gnu.org; Thu, 28 Dec 2023 04:40:38 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E21EB24002A for <52555@debbugs.gnu.org>; Thu, 28 Dec 2023 10:40:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1703756432; bh=BaKFYDJu4ULVIQh8x14HeCuiNBEsdyfHK1VKAfGcSRQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=ZDS+64x5FmBxy9KX6larfsaV+hfgNcsJR918beWkdTQeuIV9IR/0nd7kiGGLST0pG GWklRPzwAwzBg8RWv+9vgxPhuZKvzuid4Q9V3G1EJ/T2DCdE2BrXgzrCczED5gmQPw mHuLpeyo63S51fmcyzNYtLZEy3zHJwWcKZ+6raSSDa1bxj73NrpOJ2hj0Hp4pZBxZw v6KD2m6wOt73QBZ+DZPIHDgy4/5cwN7wsySPaLEiILGOhOolSoimh1MJKWZVEv64mI qbhT/cKVL+moFFjXCS45tMFpcgWGb6rjlH7T/lgY4fvS/3HQ91L7IZgPZF3raroxju yfT3pmVbrrOfw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T13Qm1Ml5z6twc; Thu, 28 Dec 2023 10:40:32 +0100 (CET) From: pukkamustard Date: Thu, 28 Dec 2023 09:40:10 +0000 Message-ID: <80c5a32fbbe24b50cb5c6e2eedd29f8d0bbac44a.1703316055.git.pukkamustard@posteo.net> In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/guile-xyz.scm (kapla): New variable. --- gnu/packages/guile-xyz.scm | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index a66a6d8ad5..f3d97cca37 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -102,6 +102,7 @@ (define-module (gnu packages guile-xyz) #:use-module (gnu packages multiprecision) #:use-module (gnu packages ncurses) #:use-module (gnu packages networking) + #:use-module (gnu packages ninja) #:use-module (gnu packages noweb) #:use-module (gnu packages nss) #:use-module (gnu packages package-management) @@ -5193,6 +5194,51 @@ (define-public guile-eris (home-page "https://codeberg.org/eris/guile-eris") (license license:gpl3+)))) +(define-public kapla + (let ((commit "fa72bcb116ed6ea20f76206145766cb46fa4f30d") + (revision "0")) + (package + (name "kapla") + (version (git-version "0.1.0-dev" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://codeberg.org/eris/kapla.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 (base32 "15g9dg6i93n5wkkma983hvcl5mgvw13yxxrv8ka5n5mvslk9f0wa")))) + (build-system gnu-build-system) + (arguments + (list + #:phases + #~(modify-phases + %standard-phases + (delete 'patch-source-shebangs) + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (invoke "guile" + "--no-auto-compile" + "configure" + (string-append "--prefix=" #$output)))) + (replace 'build (lambda _ (invoke "ninja"))) + (delete 'check) + (delete 'install)))) + (native-inputs (list ninja)) + (inputs (list guile-3.0)) + (propagated-inputs + (list guile-coap + guile-sqlite3 + guile-eris + guile-lib + guile-fibers)) + (synopsis "Block storage and transport for ERIS encoded content") + (description "Kapla is a tool for encoding content with ERIS and +managing blocks of ERIS encoded content. It allows blocks to be stored in a +local database and be shared over the network.") + (home-page "https://codeberg.org/eris/kapla") + (license license:agpl3+)))) + (define-public guile-r6rs-protobuf (package (name "guile-r6rs-protobuf")