summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2026-02-02 15:45:30 +0900
committerChristopher Baines <mail@cbaines.net>2026-02-02 09:57:37 +0100
commit21a22211dff5d3f3e54bae672e0e02c2ce752a5d (patch)
tree0c1807f29343941dddaf71e7866bb7338f462c7f
parent82d22e717c4c99f939dd7ebd9faf8ab248e354ce (diff)
build: Revert misadaptation to http-client's http-fetch.
(guix build download) defines its own http-fetch and does not use (guix http-client). (guix build download-nar) also uses http-fetch from the former module. * guix/build/download.scm (url-fetch): Revert usage of http-fetch to that of the procedure defined in the module. * guix/build/download-nar.scm (download-nar): Revert usage of http-fetch to the one in (guix build download-nar). Fixes: 392cf48739f0 ("http-client: Alter http-fetch to return the response.") Change-Id: Iaccd9d8ed038e5b25a9cae4c1f4c1a6f809d1c6d Signed-off-by: Christopher Baines <mail@cbaines.net>
-rw-r--r--guix/build/download-nar.scm5
-rw-r--r--guix/build/download.scm11
2 files changed, 5 insertions, 11 deletions
diff --git a/guix/build/download-nar.scm b/guix/build/download-nar.scm
index eb358d69d9e..f26ad28cd09 100644
--- a/guix/build/download-nar.scm
+++ b/guix/build/download-nar.scm
@@ -22,7 +22,6 @@
#:autoload (lzlib) (call-with-lzip-input-port)
#:use-module (guix progress)
#:use-module (web uri)
- #:use-module (web response)
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-26)
#:use-module (ice-9 format)
@@ -70,7 +69,7 @@ item. Return #t on success, #f otherwise."
((url rest ...)
(format #t "Trying content-addressed mirror at ~a...~%"
(uri-host (string->uri url)))
- (let-values (((port response)
+ (let-values (((port size)
(catch #t
(lambda ()
(http-fetch (string->uri url)))
@@ -82,7 +81,7 @@ item. Return #t on success, #f otherwise."
(values #f #f)))))
(if (not port)
(loop rest)
- (let ((size (response-content-length response)))
+ (begin
(if size
(format #t "Downloading from ~a (~,2h MiB)...~%" url
(/ size (expt 2 20.)))
diff --git a/guix/build/download.scm b/guix/build/download.scm
index 53a09971644..509dcc08c72 100644
--- a/guix/build/download.scm
+++ b/guix/build/download.scm
@@ -22,7 +22,6 @@
(define-module (guix build download)
#:use-module (web uri)
#:use-module (web http)
- #:use-module (web response)
#:use-module ((web client) #:hide (open-socket-for-uri))
#:use-module (web response)
#:use-module (guix base64)
@@ -753,7 +752,7 @@ otherwise simply ignore them."
(case (uri-scheme uri)
((http https)
(false-if-exception*
- (let-values (((port response)
+ (let-values (((port size)
(http-fetch uri
#:verify-certificate? verify-certificate?
#:timeout timeout)))
@@ -763,13 +762,9 @@ otherwise simply ignore them."
#:buffer-size %http-receive-buffer-size
#:reporter (if print-build-trace?
(progress-reporter/trace
- file (uri->string uri)
- (response-content-length
- response))
+ file (uri->string uri) size)
(progress-reporter/file
- (uri-abbreviation uri)
- (response-content-length
- response))))
+ (uri-abbreviation uri) size)))
(newline)))
(close-port port)
file)))