From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id zgo3I7jM2GXpgAEAqHPOHw:P1 (envelope-from ) for ; Fri, 23 Feb 2024 17:50:00 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id zgo3I7jM2GXpgAEAqHPOHw (envelope-from ) for ; Fri, 23 Feb 2024 17:50:00 +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=gaybBXie; 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=1708707000; 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=Xd3ynKgR2neJ0oh4LY9MYvQqEdzV/095+EAdboz2Jv8=; b=cB+F4pDFPV4i+4MKLnEG70+/UiKATt5GZLlobBF13qwXm2FHCXB4x+B+oDzxZ+GvmJnJt2 +hi4nkf2i+m9gt4/ajVOJmmqWRRNjfaWYuZsEDg8MrYcm/WkB58eF9FZ/NL7xKVWffud1l ZQ1+bkGERNklgBTUK2AWYi9bQt8C5P4bQGEXzwqEbAEVqYcRu+bZCgyMA85FB5vFmLyHZ4 q7j8iT3P1WcYRBgPuYBpOQ8p5T11xitp5cNQKu+f/1qKhDXZQLW9bFNXjXKzYJ2rSfTxxh kTMOavvIt2dkIXLQs7ZSZ1kNLd7ItexaqxbvHBpvNYnpafKW/LB3Tt7GasRSxw== 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=gaybBXie; 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=1708707000; a=rsa-sha256; cv=none; b=I1qeSmFr5xCTruElNgZcPGqi7x1UCjT+91WDQMBsE0pyn5Pcm9Bvqtmjxik9EIh3yAwRMv J8eXuWLiMu5479JYt30F80G8fUjmi0G5CDpt7M158QkwK24B/q+qA2uxwqi12fpZcA8EH4 ADlbwaMpEU8gUpA4OeyPqNLYscOd0v3axABie47ToXOyKYAxox91vNrsEZhWW2hS4HZpox Qdjavw4+cAvyrVeMCKR25WoYiHF2HuxvuiXRAnToKVzByCmSdHzG7/ONROzOkIlIysvmQt miVhIA9JpU2VKvUPLBm1VbtOmnW7/dUaHkc0dNedlffG2juYUBlFxbwyzKsm5g== 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 6A4B2730EF for ; Fri, 23 Feb 2024 17:50:00 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdY2G-0000gy-Jq; Fri, 23 Feb 2024 11:04:28 -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 1rdXo1-00047w-0M for guix-patches@gnu.org; Fri, 23 Feb 2024 10:49:45 -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 1rdXo0-0007FU-G6; Fri, 23 Feb 2024 10:49:44 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rdXoK-0002AW-9p; Fri, 23 Feb 2024 10:50:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69328] [PATCH 11/12] perform-download: Allow use of =?UTF-8?Q?=E2=80=98download-nar=E2=80=99?= for =?UTF-8?Q?=E2=80=98--check=E2=80=99?= builds. 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: Fri, 23 Feb 2024 15:50:04 +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: 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.17087033668067 (code B ref 69328); Fri, 23 Feb 2024 15:50:04 +0000 Received: (at 69328) by debbugs.gnu.org; 23 Feb 2024 15:49:26 +0000 Received: from localhost ([127.0.0.1]:49229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdXne-00025Y-9j for submit@debbugs.gnu.org; Fri, 23 Feb 2024 10:49:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdXnQ-00021h-TU for 69328@debbugs.gnu.org; Fri, 23 Feb 2024 10:49:15 -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 1rdXn1-00079G-Ns; Fri, 23 Feb 2024 10:48:43 -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=Xd3ynKgR2neJ0oh4LY9MYvQqEdzV/095+EAdboz2Jv8=; b=gaybBXieY41rlaAQ9G6h GdPX8y8RukHmZyRe9ccr20cSBNIjHGJUWy/zsyF+GRO/EwsMXwECMT5r96LLSFIiLT9+zc+ZSSccP ki+rrEpfhpkP7Z/aewBp3Cn2i8EhcJ5wcXS4BWnaBiQ/nCnGcscZtHHMI0zjLj2Iuj4gNqNTiLsc5 bZODqxh44zPD/4bEsI9Cy2Dn3SDE9kD11IJ52EGt8wK8Nc6DW5z8hWxL59I62NdbWF7Kx+84nO1Ge R+9ajt3cspX6zyv4nfe2nIYJnUydYcBf9j0bd866xpp3ORAdMYsNwgRriZzwkqUddm4Cq63+pCaPa cW121hwXBsqpPQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Fri, 23 Feb 2024 16:48:15 +0100 Message-ID: <25d47583dc9bf21ef918ae400de80fa58e09602c.1708697539.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -1.31 X-Spam-Score: -1.31 X-Migadu-Queue-Id: 6A4B2730EF X-TUID: XD5c/VV9nl8m Previously, the nar fallback would always fail on ‘--check’ build because the output directory in that case is different from the store file name. This change fixes that. * guix/build/git.scm (git-fetch-with-fallback): Add #:item parameter and pass it to ‘download-nar’. * guix/scripts/perform-download.scm (perform-git-download): Pass #:item to ‘git-fetch-with-fallback’. Change-Id: I30fc948718e99574005150bba5215a51ef153c49 --- guix/build/git.scm | 14 ++++++++------ guix/scripts/perform-download.scm | 3 +++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/guix/build/git.scm b/guix/build/git.scm index 4c69365a7b..a135026fae 100644 --- a/guix/build/git.scm +++ b/guix/build/git.scm @@ -92,19 +92,21 @@ (define* (git-fetch url commit directory (define* (git-fetch-with-fallback url commit directory - #:key (git-command "git") + #:key (item directory) + (git-command "git") hash hash-algorithm lfs? recursive?) "Like 'git-fetch', fetch COMMIT from URL into DIRECTORY, but fall back to -alternative methods when fetching from URL fails: attempt to download a nar, -and if that also fails, download from the Software Heritage archive. When -HASH and HASH-ALGORITHM are provided, they are interpreted as the nar hash of -the directory of interested and are used as its content address at SWH." +alternative methods when fetching from URL fails: attempt to download a nar +for ITEM, and if that also fails, download from the Software Heritage archive. +When HASH and HASH-ALGORITHM are provided, they are interpreted as the nar +hash of the directory of interested and are used as its content address at +SWH." (or (git-fetch url commit directory #:lfs? lfs? #:recursive? recursive? #:git-command git-command) - (download-nar directory) + (download-nar item directory) ;; As a last resort, attempt to download from Software Heritage. ;; Disable X.509 certificate verification to avoid depending diff --git a/guix/scripts/perform-download.scm b/guix/scripts/perform-download.scm index e7eb3b2a1f..b96959a09e 100644 --- a/guix/scripts/perform-download.scm +++ b/guix/scripts/perform-download.scm @@ -114,10 +114,13 @@ (define* (perform-git-download drv output ;; on ambient authority, hence the PATH value below. (setenv "PATH" "/run/current-system/profile/bin:/bin:/usr/bin") + ;; Note: When doing a '--check' build, DRV-OUTPUT and OUTPUT are + ;; different, hence the #:item argument below. (git-fetch-with-fallback url commit output #:hash hash #:hash-algorithm algo #:recursive? recursive? + #:item (derivation-output-path drv-output) #:git-command %git)))) (define (assert-low-privileges) -- 2.41.0