From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WBb2Jy9limCmxwAAgWs5BA (envelope-from ) for ; Thu, 29 Apr 2021 09:50:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mCp+Iy9limAvUgAAB5/wlQ (envelope-from ) for ; Thu, 29 Apr 2021 07:50:07 +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 52BA418F47 for ; Thu, 29 Apr 2021 09:50:07 +0200 (CEST) Received: from localhost ([::1]:42742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lc1R0-0007lx-75 for larch@yhetil.org; Thu, 29 Apr 2021 03:50:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lc1Qw-0007lj-0i for guix-patches@gnu.org; Thu, 29 Apr 2021 03:50:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43206) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lc1Qv-0000JA-PO for guix-patches@gnu.org; Thu, 29 Apr 2021 03:50:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lc1Qv-00048J-O6 for guix-patches@gnu.org; Thu, 29 Apr 2021 03:50:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47336] Disarchive as a fallback for downloads Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 29 Apr 2021 07:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47336 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Timothy Sample Cc: 47336@debbugs.gnu.org Received: via spool by 47336-submit@debbugs.gnu.org id=B47336.161968254815808 (code B ref 47336); Thu, 29 Apr 2021 07:50:01 +0000 Received: (at 47336) by debbugs.gnu.org; 29 Apr 2021 07:49:08 +0000 Received: from localhost ([127.0.0.1]:54752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lc1Q4-00046u-0A for submit@debbugs.gnu.org; Thu, 29 Apr 2021 03:49:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lc1Q2-00046e-VE for 47336@debbugs.gnu.org; Thu, 29 Apr 2021 03:49:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37902) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lc1Px-0008Ar-M5; Thu, 29 Apr 2021 03:49:01 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=60830 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lc1Pw-0006jK-HO; Thu, 29 Apr 2021 03:49:00 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87eeg6o50b.fsf@ngyro.com> <20210323045213.9419-1-samplet@ngyro.com> <87a6qo2835.fsf_-_@gnu.org> <87v989e5oc.fsf_-_@gnu.org> <87o8dzkunk.fsf_-_@ngyro.com> <87h7jqlwnw.fsf@ngyro.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 10 =?UTF-8?Q?Flor=C3=A9al?= an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 29 Apr 2021 09:48:59 +0200 In-Reply-To: <87h7jqlwnw.fsf@ngyro.com> (Timothy Sample's message of "Wed, 28 Apr 2021 03:01:55 -0400") Message-ID: <874kfpo7is.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619682607; 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: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; bh=SSsoou6NxbFznf/Aq554W6YE0tQt/Pp1bBfDJ4id02c=; b=pL4Z1kg6XsVOyjNJaiCmW7mA1BzDLq8VY8jkIs3JaPmc4vHlB6jRk5DgX6lT6g4ARnt1wj M3FANbIcZXEaGIqL4gmc24HugqdJGCeRbsF+M0DJatP8tdDW6C5Y8KTdx1/qPK6x7Db8ui Nqd14CJ2hI0pR3PYWFMaUqzP4lVjL6xaddXjAbICb9YEqMRnppfeoQggHBCQt+pTA3xPfV CIPqmiCp/lTSKPdmulO4ETNBV2VPbNSAwia4WrOf4k7iVgFFFfxaQOMZMau+mMFYXEd/p0 u4fMZgSl46HTS7Kf8YY8sf88alcg58qsLlBSWONuRfgICpkIIFLneTQ3hUzThw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619682607; a=rsa-sha256; cv=none; b=cAyI0nDM1hTq49joPNciZ5feiilZENEVjv1A4XQ8Hy5SVL3+07SPS5pp2gV2wvZxBONJ7i B9zv3qGJYrpH6t7z8j08kzpuAum/yux1uAA8BfzQ0pLub7SGTAQyzmKgAnZ1N6rX/O3Zcf VWZXXBZ1KC6bg7Cg22kmrDxsacsg8RH8dhI6v74A+UzYYdDNM6/+0CXl2knxXUjEHmR6/I zC0AzQG3NVPbxXWngkQm+LpACwjeZ25xuyR2eyBlD8b71DTqWjfv3zgm2C+YQzu2ybPVm0 n+8D5EPNA9vdvIOC4Q7fD+zsHb+79Ed6WNSIRnrpJb+mTDuKOENw/o6CBcLMxg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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-Migadu-Spam-Score: -2.95 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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-Migadu-Queue-Id: 52BA418F47 X-Spam-Score: -2.95 X-Migadu-Scanner: scn0.migadu.com X-TUID: IbXdxRSjO1Mt --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! Timothy Sample skribis: > And broke =E2=80=9Cguix pull=E2=80=9D!! (I somehow fooled myself into th= inking that I > had already tested with =E2=80=9Cguix pull --url=3D...=E2=80=9D locally.)= I reverted the > offending commit. You can test with =E2=80=98guix pull=E2=80=99 (you need to make sure to spe= cify the right file:// URL *and* branch), or you can run =E2=80=9Cmake as-derivation= =E2=80=9D. > It turns out that adding a reference from =E2=80=9C(guix build download)= =E2=80=9D to > =E2=80=9C(guix swh)=E2=80=9D breaks =E2=80=9Ccompute-guix-derivation=E2= =80=9D in > =E2=80=9Cbuild-aux/build-self.scm=E2=80=9D. This is because =E2=80=9C(gu= ix swh)=E2=80=9D references > =E2=80=9C(json)=E2=80=9D, which is not available in the =E2=80=9Ccompute-= guix-derivation=E2=80=9D > environment. I tried mimicking the =E2=80=9Cfake-git=E2=80=9D trick, but= it didn=E2=80=99t work > (I guess it needs the =E2=80=9Cdefine-json-mapping=E2=80=9D macro at comp= ile time). > > Everything works if I remove the #:autoload for =E2=80=9C(guix swh)=E2=80= =9D and put > > ;; If we import (guix swh) directly, we introduce a compile-time > ;; dependency on Guile-JSON. This breaks the "build-self" code, which > ;; needs to build this module without Guile-JSON. Hence, we track > ;; down the following procedure at runtime. > (define swh-download-directory > (module-ref (resolve-module '(guix swh)) 'swh-download-directory)) > > inside of =E2=80=9Cdisarchive-fetch/any=E2=80=9D (just before it=E2=80=99= s needed). Does this > approach look okay? That=E2=80=99s one possibility. The patch below takes another approach. I think it aesthetically slightly more pleasant because we don=E2=80=99t have to play =E2=80=98resol= ve-module=E2=80=99 tricks for obscure reasons. WDYT? (It also fixes a format string argument mismatch.) Thanks! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index 853a2f328f..f100ff4aae 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -250,6 +250,7 @@ interface (FFI) of Guile.") (match-lambda (('guix 'config) #f) (('guix 'channels) #f) + (('guix 'build 'download) #f) ;autoloaded by (guix download) (('guix _ ...) #t) (('gnu _ ...) #t) (_ #f))) diff --git a/guix/build/download.scm b/guix/build/download.scm index 5431d7c682..ce31038b05 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -650,7 +650,7 @@ and write the output to FILE." (('swhid swhid) (match (string-split swhid #\:) (("swh" "1" "dir" id) - (format #t "Downloading from Software Heritage...~%" file) + (format #t "Downloading ~a from Software Heritage...~%" file) (false-if-exception* (swh-download-directory id output))) (_ #f))) diff --git a/guix/self.scm b/guix/self.scm index 3154d180ac..7181205610 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -878,7 +878,8 @@ itself." ("guix/store/schema.sql" ,(local-file "../guix/store/schema.sql"))) - #:extensions (list guile-gcrypt) + #:extensions (list guile-gcrypt + guile-json) ;for (guix swh) #:guile-for-build guile-for-build)) (define *extra-modules* --=-=-=--