From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id sIavLSL95mWvqwAAe85BDQ:P1 (envelope-from ) for ; Tue, 05 Mar 2024 12:08:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id sIavLSL95mWvqwAAe85BDQ (envelope-from ) for ; Tue, 05 Mar 2024 12:08:18 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=cKBldQrQ; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709636898; 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: content-transfer-encoding:content-transfer-encoding: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:dkim-signature; bh=G6BugkD26wUOoZWh1+LBXLc9ti+OqXPrxU6iVh4uZ90=; b=UJcUE3+iTf1KCBTOFMcUh/MhWlDnPYeyILN284nQkyFUYgu5fxF2FSdcUEzmSIVT97G3L6 EI/6CljWGKvAbkkJQZtaJGKJwy+bbjmwFo/wZR+paPvzjIpIeBaVPhUSkh/A8cTCuwbXoP FFtLUWjixDL6e9SvT6I4VsQS0dFjd+k5bUgPFQOFSjQdLrZ3/cmpLu2wtOxZJ/O9ezSMk/ 5XF2GKKEbaym0IQEpfnKk0/V7uGKEQiq/lZbAOOVGMccrzgWM4Q/LdikideirIohfb0JTq IN9GqpuE8JasHyY21/0i7BXfyMKt/8QqQVf6t8pDobIxhwteCgreeKd+AVmIqg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=cKBldQrQ; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709636898; a=rsa-sha256; cv=none; b=sPt4ldNm1gNIPxkAD3wvPCtTfcju2vfpEcVovt6yOca/pY7F9Y9hT8Fat9zCXQt7H72WcD IVoxV/UX/fLp5J6jyEyv+3IGWFQaSo2kGmWYTxWyJj03lGWitjuh4YhNv0TM3KmC7K/QAb ckJuWWrVRJ3BmGxsuQMsfoF0AeYvGRzLxHI+V5E3zTkl+te0LduAZ/SWfDNpnex7H1xU72 j4muAble59L9CAtGWFN7GmEImpzesIArt1VWtCur4IHv93xOLSDklIHTmoqychJ+IKScfe B2C/yxBcryuA06HhsW4AnowKlhs/Q89DGUtFbTAz741ZnIdct/+lB32LNRPTPQ== 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 7101925763 for ; Tue, 5 Mar 2024 12:08:18 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhSeJ-0002P6-Vr; Tue, 05 Mar 2024 06:07:58 -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 1rhSe4-0002Ds-3T for guix-patches@gnu.org; Tue, 05 Mar 2024 06:07:40 -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 1rhSe1-00033Z-JK; Tue, 05 Mar 2024 06:07:37 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rhSeU-00008L-2d; Tue, 05 Mar 2024 06:08:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69328] [PATCH v2 09/12] bzr-download: Implement nar fallback. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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: Tue, 05 Mar 2024 11:08:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69328 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69328@debbugs.gnu.org Cc: Timothy Sample , Ludovic =?UTF-8?Q?Court=C3=A8s?= , 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 69328-submit@debbugs.gnu.org id=B69328.1709636880414 (code B ref 69328); Tue, 05 Mar 2024 11:08:06 +0000 Received: (at 69328) by debbugs.gnu.org; 5 Mar 2024 11:08:00 +0000 Received: from localhost ([127.0.0.1]:46405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhSeO-00006b-9V for submit@debbugs.gnu.org; Tue, 05 Mar 2024 06:08:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhSeL-00004v-2G for 69328@debbugs.gnu.org; Tue, 05 Mar 2024 06:07:57 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhSdl-0002x1-7b; Tue, 05 Mar 2024 06:07:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=G6BugkD26wUOoZWh1+LBXLc9ti+OqXPrxU6iVh4uZ90=; b=cKBldQrQbI3tjad25y4V mfeKs9DGVP5RVwbv4aLIdyRbhEfvVamdllpNglxnclhz+k5vml6S75YtQEYMzQu2BKQsJzwv3O9LU G7rAmXVl7Qmy6r3nx6+dKkwCElZZ9paFUep4szxltEp6NMPMQti0cpce798xWhX75Y+QgLbtSrpe9 our+/4kz2TrT5UY8PmYBnsr26KcWF1+pN7Azow2NmK/vxM+9x9Bge2rLGk3RE7TLvhCUozTDi6Q8j Q+mhiUPbXoAtq8us86M2+u6b684rlCCZTBPP9ddKBz2Bty7xQcTr0l3xLDBSiqgyaVnuifmQQGsP+ kyB6P26dFVTNEQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Tue, 5 Mar 2024 12:06:57 +0100 Message-ID: <09b424cf6c561426047790d7bca50055b5caad21.1709636144.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <87o7btc5du.fsf@gnu.org> References: <87o7btc5du.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -4.68 X-Spam-Score: -4.68 X-Migadu-Queue-Id: 7101925763 X-TUID: rJRXsEH68OWu * guix/bzr-download.scm (bzr-fetch)[guile-json, guile-lzlib, guile-gnutls]: New variables. [build]: Add ‘with-extensions’ and import more modules. Invoke ‘download-nar’ when ‘bzr-fetch’ returns #f. * guix/build/bzr.scm (bzr-fetch): Actually return #t on success. Change-Id: Id5d4ebd0f9ddc3c44b6456d3b46c0000cc7b9997 --- guix/build/bzr.scm | 3 ++- guix/bzr-download.scm | 43 ++++++++++++++++++++++++++++++++----------- 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/guix/build/bzr.scm b/guix/build/bzr.scm index a0f5e15880..dede5e031a 100644 --- a/guix/build/bzr.scm +++ b/guix/build/bzr.scm @@ -37,6 +37,7 @@ (define* (bzr-fetch url revision directory (invoke bzr-command "-Ossl.cert_reqs=none" "checkout" "--lightweight" "-r" revision url directory) (with-directory-excursion directory - (delete-file-recursively ".bzr"))) + (delete-file-recursively ".bzr")) + #t) ;;; bzr.scm ends here diff --git a/guix/bzr-download.scm b/guix/bzr-download.scm index d97f84838e..01c12fd54d 100644 --- a/guix/bzr-download.scm +++ b/guix/bzr-download.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2022 Maxim Cournoyer +;;; Copyright © 2024 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -51,20 +52,40 @@ (define (bzr-package) (module-ref distro 'breezy))) (define* (bzr-fetch ref hash-algo hash - #:optional name - #:key (system (%current-system)) (guile (default-guile)) - (bzr (bzr-package))) + #:optional name + #:key (system (%current-system)) (guile (default-guile)) + (bzr (bzr-package))) "Return a fixed-output derivation that fetches REF, a object. The output is expected to have recursive hash HASH of type HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f." + (define guile-json + (module-ref (resolve-interface '(gnu packages guile)) 'guile-json-4)) + + (define guile-lzlib + (module-ref (resolve-interface '(gnu packages guile)) 'guile-lzlib)) + + (define guile-gnutls + (module-ref (resolve-interface '(gnu packages tls)) 'guile-gnutls)) + (define build - (with-imported-modules (source-module-closure - '((guix build bzr))) - #~(begin - (use-modules (guix build bzr)) - (bzr-fetch - (getenv "bzr url") (getenv "bzr reference") #$output - #:bzr-command (string-append #+bzr "/bin/brz"))))) + (with-extensions (list guile-gnutls guile-lzlib guile-json) + (with-imported-modules (source-module-closure + '((guix build bzr) + (guix build utils) + (guix build download-nar))) + #~(begin + (use-modules (guix build bzr) + (guix build download-nar) + (guix build utils) + (srfi srfi-34)) + + (or (guard (c ((invoke-error? c) + (report-invoke-error c) + #f)) + (bzr-fetch (getenv "bzr url") (getenv "bzr reference") + #$output + #:bzr-command (string-append #+bzr "/bin/brz"))) + (download-nar #$output)))))) (mlet %store-monad ((guile (package->derivation guile system))) (gexp->derivation (or name "bzr-branch") build @@ -79,7 +100,7 @@ (define* (bzr-fetch ref hash-algo hash "LC_ALL" "LC_MESSAGES" "LANG" "COLUMNS") #:system system - #:local-build? #t ;don't offload repo branching + #:local-build? #t ;don't offload repo branching #:hash-algo hash-algo #:hash hash #:recursive? #t -- 2.41.0