guix: Improve download-nar.

Previously download-nar worked with gzipped nars and queried
berlin.guix.gnu.org (also known as ci.guix.gnu.org). ci.guix.gnu.org no longer
serves gzipped nars so this is of limited use.

This commit changes download-nar to query both the default substitute servers,
and queries for lzipped rather than gzipped nars, since those are available
from both.

* guix/build/download-nar.scm (urls-for-item): Return urls for lzip rather
than gzip compression, and from both default substitute servers. The comment
about CDN's is no longer relevant.
(restore-gzipped-nar): Rename to restore-lzipped-nar and reimplement
accordingly.
(download-nar): Add progress reporting and switch to use lzip rather than
gzip.
* guix/cvs-download.scm (cvs-fetch): Replace guile-zlib with guile-lzlib.
* guix/git-download.scm (git-fetch): Replace guile-zlib with guile-lzlib.
* guix/hg-download.scm (hg-fetch): Replace guile-zlib with guile-lzlib.
* guix/android-repo-download.scm (android-repo-fetch): Add guile-lzlib for
download-nar.

Signed-off-by: Christopher Baines <mail@cbaines.net>
This commit is contained in:
Christopher Baines 2023-03-11 19:43:29 +00:00
parent b68d4118e7
commit b59f89cf18
No known key found for this signature in database
GPG key ID: 5E28A33B0B84F577
5 changed files with 39 additions and 58 deletions

View file

@ -72,8 +72,8 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
("tar" ,(module-ref (resolve-interface '(gnu packages base))
'tar))))
(define guile-zlib
(module-ref (resolve-interface '(gnu packages guile)) 'guile-zlib))
(define guile-lzlib
(module-ref (resolve-interface '(gnu packages guile)) 'guile-lzlib))
(define guile-json
(module-ref (resolve-interface '(gnu packages guile)) 'guile-json-4))
@ -90,7 +90,7 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
(define build
(with-imported-modules modules
(with-extensions (list guile-json gnutls ;for (guix swh)
guile-zlib)
guile-lzlib)
#~(begin
(use-modules (guix build hg)
(guix build utils) ;for `set-path-environment-variable'