[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#69328] [PATCH 11/12] perform-download: Allow use of ‘download-nar’
From: |
Ludovic Courtès |
Subject: |
[bug#69328] [PATCH 11/12] perform-download: Allow use of ‘download-nar’ for ‘--check’ builds. |
Date: |
Fri, 23 Feb 2024 16:48:15 +0100 |
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
- [bug#69328] [PATCH 00/12] Better source code recovery from SWH, Ludovic Courtès, 2024/02/23
- [bug#69328] [PATCH 05/12] swh: ‘origin-visits’ takes an optional ‘max’ parameter., Ludovic Courtès, 2024/02/23
- [bug#69328] [PATCH 09/12] bzr-download: Implement nar fallback., Ludovic Courtès, 2024/02/23
- [bug#69328] [PATCH 11/12] perform-download: Allow use of ‘download-nar’ for ‘--check’ builds.,
Ludovic Courtès <=
- [bug#69328] [PATCH 08/12] svn-download: Use ‘swh-download-directory-by-nar-hash’., Ludovic Courtès, 2024/02/23
- [bug#69328] [PATCH 12/12] download: Honor ‘GUIX_DOWNLOAD_SEQUENCE’ environment variable., Ludovic Courtès, 2024/02/23
- [bug#69328] [PATCH 06/12] swh: ‘lookup-origin-revision’ handles branches pointing to directories., Ludovic Courtès, 2024/02/23
- [bug#69328] [PATCH 04/12] swh: Add ‘type’ field to <visit>., Ludovic Courtès, 2024/02/23
- [bug#69328] [PATCH 01/12] lint: Switch to SRFI-71., Ludovic Courtès, 2024/02/23
- [bug#69328] [PATCH 02/12] lint: archival: Fix crash in non-Git case., Ludovic Courtès, 2024/02/23
- [bug#69328] [PATCH 10/12] download-nar: Distinguish ‘output’ and ‘item’ parameter., Ludovic Courtès, 2024/02/23
- [bug#69328] [PATCH 03/12] lint: archival: Trigger “Save Code Now” for VCSes other than Git., Ludovic Courtès, 2024/02/23
- [bug#69328] [PATCH 07/12] hg-download: Use ‘swh-download-directory-by-nar-hash’., Ludovic Courtès, 2024/02/23
- [bug#69328] [PATCH 00/12] Better source code recovery from SWH, Ludovic Courtès, 2024/02/23