From patchwork Tue Jan 25 19:22:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pukkamustard X-Patchwork-Id: 36811 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 5040027BBEA; Tue, 25 Jan 2022 19:26:45 +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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 CD46927BBE9 for ; Tue, 25 Jan 2022 19:26:44 +0000 (GMT) Received: from localhost ([::1]:49762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCRSm-0005XT-0U for patchwork@mira.cbaines.net; Tue, 25 Jan 2022 14:26:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCRPD-00047a-VQ for guix-patches@gnu.org; Tue, 25 Jan 2022 14:23:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nCRPD-0000BE-Lv for guix-patches@gnu.org; Tue, 25 Jan 2022 14:23:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nCRPD-0001Ew-JG for guix-patches@gnu.org; Tue, 25 Jan 2022 14:23:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52555] [RFC PATCH v2 4/5] publish: Add support for storing ERIS encoded blocks to IPFS. Resent-From: pukkamustard Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 25 Jan 2022 19:23: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 , ~pukkamustard/eris@lists.sr.ht Received: via spool by 52555-submit@debbugs.gnu.org id=B52555.16431385634686 (code B ref 52555); Tue, 25 Jan 2022 19:23:03 +0000 Received: (at 52555) by debbugs.gnu.org; 25 Jan 2022 19:22:43 +0000 Received: from localhost ([127.0.0.1]:50150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCROt-0001DQ-8v for submit@debbugs.gnu.org; Tue, 25 Jan 2022 14:22:43 -0500 Received: from mout02.posteo.de ([185.67.36.66]:59993) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCROd-0001CH-SK for 52555@debbugs.gnu.org; Tue, 25 Jan 2022 14:22:28 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 4C66F240103 for <52555@debbugs.gnu.org>; Tue, 25 Jan 2022 20:22:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1643138542; bh=WjdsN5qtP47bgM3Qv/+NX+Fy8ZzMEmAQi9X/KFRZPLo=; h=From:To:Cc:Subject:Date:From; b=QlZsIs6HZgRLJycSuQJN9og4N1nW8ttJnDB8/C1w9CfdkTH18W0i6o1cj1enMolVg psxeNyntX7MBIcBMHLjeFdKe0d8JYP+pmvcLNn2FKoiS5XP+Xnl+TYjQYfylPHUo65 iX+hB9mXQVP1XmxFngAb4CwoYji/B3RQ/p/FrlkBjlsGgjM8noz0jfq8g5nBg2rfmN WvkKaLA8lTM9oHN6OOPU4JibOgz5IqF+d0OWx8G3+5w4OlVG44iC70tsYYVinRHFl3 tjmeTxbM6FT8TMZ4tZj8YXOaTo/Gz/btZ3qd8srheuo5Wr4No9TYT8reev2mVywF+r XbIa2SwyoD0Cg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4JjxZ54K7cz9rxS; Tue, 25 Jan 2022 20:22:21 +0100 (CET) From: pukkamustard Date: Tue, 25 Jan 2022 19:22:00 +0000 Message-Id: <20220125192201.7582-5-pukkamustard@posteo.net> In-Reply-To: <20220125192201.7582-1-pukkamustard@posteo.net> References: <20220125192201.7582-1-pukkamustard@posteo.net> 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" X-getmail-retrieved-from-mailbox: Patches * guix/scripts/publish.scm (bake-narinfo+nar): Use guix-eris-block-reducer from (guix eris). --- guix/scripts/publish.scm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm index 9c83f5183d..556107ab7d 100644 --- a/guix/scripts/publish.scm +++ b/guix/scripts/publish.scm @@ -41,6 +41,7 @@ (define-module (guix scripts publish) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (srfi srfi-37) + #:use-module (srfi srfi-71) #:use-module (web http) #:use-module (web request) #:use-module (web response) @@ -58,6 +59,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 (eris) #:use-module (zlib) #:autoload (lzlib) (call-with-lzip-output-port @@ -644,8 +646,14 @@ (define (eris-encode-nar compressions) (stat (stat nar #f))) (and stat (call-with-input-file nar - (cut eris-encode->string <> - #:block-size %eris-block-size-large)))))) + (lambda (port) + (let ((eris-urn _ + (eris-encode port + #:block-size + %eris-block-size-large + #:block-reducer + guix-eris-block-reducer))) + (uri->string eris-urn)))))))) (let ((compression (actual-compressions item compressions)))