me
/
guix
Archived
1
0
Fork 0

svn-download: Add dependency on tar+gzip for SWH retrieval.

Fixes a bug whereby ‘swh-download-directory-by-nar-hash’ would fail due
to ‘tar’ not being found in $PATH:

  $ GUIX_DOWNLOAD_METHODS=swh guix build -S texlive-geometry --check
  In execvp of tar: No such file or directory
  SWH: found directory with nar-sha256 hash 217e1c8d33aa6fd063f205453a946509b059b85fa7e8d32b7e80054d5e6e5c26 at 'swh:1:dir:ccb56476fb36b2ba0298e57f2b2e69c735ac0a2f'
  […]

* guix/svn-download.scm (svn-fetch)[tar+gzip]: New variable.
[build]: Use it.
(svn-multi-fetch): Likewise.

Change-Id: I37ba9824a5feb6d38f85743519cbd2b2c3e1a9e8
master
Ludovic Courtès 2024-05-01 12:22:04 +02:00
parent e2ba58a67f
commit 5d2d081af0
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 21 additions and 0 deletions

View File

@ -90,6 +90,12 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
(define guile-gnutls
(module-ref (resolve-interface '(gnu packages tls)) 'guile-gnutls))
(define tar+gzip ;for (guix swh)
(list (module-ref (resolve-interface '(gnu packages compression))
'gzip)
(module-ref (resolve-interface '(gnu packages base))
'tar)))
(define build
(with-imported-modules
(source-module-closure '((guix build svn)
@ -104,9 +110,14 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
((guix build download)
#:select (download-method-enabled?))
(guix build download-nar)
(guix build utils)
(guix swh)
(ice-9 match))
;; Add tar and gzip to $PATH so
;; 'swh-download-directory-by-nar-hash' can invoke them.
(set-path-environment-variable "PATH" '("bin") '(#+@tar+gzip))
(or (and (download-method-enabled? 'upstream)
(svn-fetch (getenv "svn url")
(string->number (getenv "svn revision"))
@ -185,6 +196,12 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
(define guile-gnutls
(module-ref (resolve-interface '(gnu packages tls)) 'guile-gnutls))
(define tar+gzip ;for (guix swh)
(list (module-ref (resolve-interface '(gnu packages compression))
'gzip)
(module-ref (resolve-interface '(gnu packages base))
'tar)))
(define build
(with-imported-modules
(source-module-closure '((guix build svn)
@ -204,6 +221,10 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
(srfi srfi-1)
(ice-9 match))
;; Add tar and gzip to $PATH so
;; 'swh-download-directory-by-nar-hash' can invoke them.
(set-path-environment-variable "PATH" '("bin") '(#+@tar+gzip))
(or (every
(lambda (location)
;; The directory must exist if we are to fetch only a