From patchwork Sat Oct 24 19:47:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Devos X-Patchwork-Id: 24794 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 91A4C27BBF1; Sat, 24 Oct 2020 21:06:37 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 027A527BBF2 for ; Sat, 24 Oct 2020 21:06:34 +0100 (BST) Received: from localhost ([::1]:53124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWPo9-0002VC-3D for patchwork@mira.cbaines.net; Sat, 24 Oct 2020 16:06:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWPYA-0008EJ-Iy for guix-patches@gnu.org; Sat, 24 Oct 2020 15:50:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51883) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kWPYA-0007cT-8s for guix-patches@gnu.org; Sat, 24 Oct 2020 15:50:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kWPYA-0002YI-7p for guix-patches@gnu.org; Sat, 24 Oct 2020 15:50:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#44199] [PATCH 0/1] An origin method for GNUnet FS URI's Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 24 Oct 2020 19:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44199 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 44199@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16035689669746 (code B ref -1); Sat, 24 Oct 2020 19:50:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Oct 2020 19:49:26 +0000 Received: from localhost ([127.0.0.1]:35193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWPXa-0002X7-Cq for submit@debbugs.gnu.org; Sat, 24 Oct 2020 15:49:26 -0400 Received: from lists.gnu.org ([209.51.188.17]:44032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kWPWa-0002V2-Qe for submit@debbugs.gnu.org; Sat, 24 Oct 2020 15:48:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWPWa-0007P6-IM for guix-patches@gnu.org; Sat, 24 Oct 2020 15:48:24 -0400 Received: from rhcavuit01.kulnet.kuleuven.be ([134.58.240.129]:37111) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWPWW-0007XG-Oc for guix-patches@gnu.org; Sat, 24 Oct 2020 15:48:24 -0400 X-KULeuven-Envelope-From: maxime.devos@student.kuleuven.be X-KULeuven-Scanned: Found to be clean X-KULeuven-ID: 63FE2120002.ACE01 X-KULeuven-Information: Katholieke Universiteit Leuven Received: from icts-p-smtps-2.cc.kuleuven.be (icts-p-smtps-2e.kulnet.kuleuven.be [134.58.240.34]) by rhcavuit01.kulnet.kuleuven.be (Postfix) with ESMTP id 63FE2120002 for ; Sat, 24 Oct 2020 21:47:52 +0200 (CEST) Received: from butterfly.local (178-119-10-153.access.telenet.be [178.119.10.153]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by icts-p-smtps-2.cc.kuleuven.be (Postfix) with ESMTPSA id 41E76200A1 for ; Sat, 24 Oct 2020 21:47:52 +0200 (CEST) Message-ID: <5c72bcb9c86934deda97d952eb5cd459e615b313.camel@student.kuleuven.be> X-Kuleuven: This mail passed the K.U.Leuven mailcluster From: Maxime Devos Date: Sat, 24 Oct 2020 21:47:17 +0200 User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Received-SPF: pass client-ip=134.58.240.129; envelope-from=maxime.devos@student.kuleuven.be; helo=rhcavuit01.kulnet.kuleuven.be X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/24 15:48:19 X-ACL-Warn: Detected OS = Linux 2.6.x [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 24 Oct 2020 15:49:25 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sat, 24 Oct 2020 16:06:20 -0400 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 This patch defines a `gnunet-fetch' method, allowing for downloading files from GNUnet by their GNUnet chk-URI. This patch does not provide: - a service configuration - downloading substitutes from GNUnet - fall-back to non-P2P (e.g. http://) or other P2P (e.g. ipfs://) systems - downloading directories over GNUnet - actual packages definitions using this method Some issues and questions: - (guix build gnunet) would call call-with-temporary-output-file from (guix utils), which isn't available when building derivations, so it has been copied to (guix build gnunet). Is there any particular reason for call-with-temporary-output-file to be in (guix utils) and not (guix build utils)? - Would it be possible somehow for url-fetch to support gnunet://fs/chk URIs? That way we could fall-back unto non-P2P URLs, which would be useful to bootstrap a P2P distribution from a non-P2P system. - No timeouts have been implemented, so gnunet-download may spin forever if a source isn't available on GNUnet FS. Some problematic points: - (guix gnunet-download) calls gnunet-config from $PATH, to figure out connection details for (guix build gnunet) - (guix build gnunet) requires the GNUnet FS daemon to bind to loopback, whereas a standard GNUnet setup would have the daemon bound to a Unix socket. Example usage: First make the GNUnet FS daemon accessible to Guix: $ guix install gnunet $ gnunet-config -s fs -o port -V 2094 $ gnunet-arm -s Then publish the source tarball of the package to the GNUnet FS system: $ guix environment --ad-hoc wget -- wget https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz $ gnunet-publish hello-2.10.tar.gz The output should look like this: > Publishing `$PWD/hello-2.10.tar.gz' done. > URI is > `gnunet://fs/chk/TY48PGS5RVX643NT2B7GDNFCBT4DWG692PF4YNHERR96K6MSFRZ4 > ZWRPQ4KVKZV29MGRZTWAMY9ETTST4B6VFM47JR2JS5PWBTPVXB0.8A9HRYABJ7HDA7B0P > 37VG6D593> The following test package can now be compiled: $ cat > example.scm < (file-name "gnunet-hello-2.10.tar.gz") (sha256 (base32 "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i") ))) (build-system gnu-build-system) (synopsis "Hello, GNUnet world! An example of a package with a GNUnet chk-URI origin") (description "GNU Hello prints the message \"Hello, world!\" and then exits. It serves as an example of standard GNU coding practices. As such, it supports command-line arguments, multiple languages, and so on.") (home-page "https://www.gnu.org/software/hello/") (license gpl3+))) hello/gnunet EOF $ ./pre-inst-env guix build -f example.scm Maxime Devos (1): guix: Add (guix gnunet-download). Makefile.am | 2 + doc/guix.texi | 7 +++ guix/build/gnunet.scm | 113 +++++++++++++++++++++++++++++++++++++++ guix/gnunet-download.scm | 89 ++++++++++++++++++++++++++++++ 4 files changed, 211 insertions(+) create mode 100644 guix/build/gnunet.scm create mode 100644 guix/gnunet-download.scm