From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iNOiM02JlF82OgAA0tVLHw (envelope-from ) for ; Sat, 24 Oct 2020 20:06:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id mDNzL02JlF9dLgAAbx9fmQ (envelope-from ) for ; Sat, 24 Oct 2020 20:06:37 +0000 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 AE2D99402A2 for ; Sat, 24 Oct 2020 20:06:36 +0000 (UTC) Received: from localhost ([::1]:53124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWPoA-0002VC-8X for larch@yhetil.org; Sat, 24 Oct 2020 16:06:34 -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 Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-cym94nEco87kqPs05rNI" 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-Spam-Score: -1.6 (-) 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-Spam-Score: -2.6 (--) 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -3.11 X-TUID: 0VNS8fI/iw+g --=-cym94nEco87kqPs05rNI Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=20 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 --=-cym94nEco87kqPs05rNI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iJcEABYIAD8WIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX5SExSEcbWF4aW1lLmRl dm9zQHN0dWRlbnQua3VsZXV2ZW4uYmUACgkQSePuIhkXJe6KWgD/XLInJPzNEYjD OiuygHn8NgX38z9JpXfNIEqViy6tcUUA/i+j27oA9KBQW0vS2kqbqj2Gwrsx4gM3 bfWHKzh9oGwA =L9RV -----END PGP SIGNATURE----- --=-cym94nEco87kqPs05rNI--