diff options
author | Andreas Enge <andreas@enge.fr> | 2023-03-20 18:21:47 +0100 |
---|---|---|
committer | Andreas Enge <andreas@enge.fr> | 2023-03-20 18:49:06 +0100 |
commit | ccb62d8feb50e2859d7c41429a9e3d9e0fe30bfe (patch) | |
tree | 4ab573cee33f277828ad553a22579175b1dda22d /guix/build | |
parent | 098bd280f82350073e8280e37d56a14162eed09c (diff) | |
parent | f80215c7c4ae5ea0c316f4766e6c05ae4218ede3 (diff) | |
download | guix-patches-ccb62d8feb50e2859d7c41429a9e3d9e0fe30bfe.tar guix-patches-ccb62d8feb50e2859d7c41429a9e3d9e0fe30bfe.tar.gz |
Merge remote-tracking branch 'origin/master' into core-updates
Diffstat (limited to 'guix/build')
-rw-r--r-- | guix/build/android-ndk-build-system.scm | 5 | ||||
-rw-r--r-- | guix/build/chicken-build-system.scm | 1 | ||||
-rw-r--r-- | guix/build/clojure-utils.scm | 1 | ||||
-rw-r--r-- | guix/build/download-nar.scm | 74 | ||||
-rw-r--r-- | guix/build/gnu-dist.scm | 5 | ||||
-rw-r--r-- | guix/build/linux-module-build-system.scm | 4 | ||||
-rw-r--r-- | guix/build/svn.scm | 1 |
7 files changed, 28 insertions, 63 deletions
diff --git a/guix/build/android-ndk-build-system.scm b/guix/build/android-ndk-build-system.scm index 3c8f726d1d..0298292ac9 100644 --- a/guix/build/android-ndk-build-system.scm +++ b/guix/build/android-ndk-build-system.scm @@ -18,14 +18,9 @@ (define-module (guix build android-ndk-build-system) #:use-module ((guix build gnu-build-system) #:prefix gnu:) - #:use-module (guix build syscalls) #:use-module (guix build utils) - #:use-module (ice-9 popen) - #:use-module (ice-9 rdelim) - #:use-module (ice-9 ftw) #:use-module (ice-9 format) #:use-module (ice-9 match) - #:use-module (rnrs io ports) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (%standard-phases diff --git a/guix/build/chicken-build-system.scm b/guix/build/chicken-build-system.scm index a669822dad..8f9f59cc25 100644 --- a/guix/build/chicken-build-system.scm +++ b/guix/build/chicken-build-system.scm @@ -18,7 +18,6 @@ (define-module (guix build chicken-build-system) #:use-module ((guix build gnu-build-system) #:prefix gnu:) - #:use-module (guix build union) #:use-module (guix build utils) #:use-module (ice-9 match) #:use-module (ice-9 ftw) diff --git a/guix/build/clojure-utils.scm b/guix/build/clojure-utils.scm index c5322141d3..57081d30f7 100644 --- a/guix/build/clojure-utils.scm +++ b/guix/build/clojure-utils.scm @@ -20,7 +20,6 @@ #:use-module (guix build utils) #:use-module (ice-9 ftw) #:use-module (ice-9 match) - #:use-module (ice-9 regex) #:use-module (srfi srfi-1) #:use-module (srfi srfi-8) #:use-module (srfi srfi-26) diff --git a/guix/build/download-nar.scm b/guix/build/download-nar.scm index 867f3c10bb..1b5b5503eb 100644 --- a/guix/build/download-nar.scm +++ b/guix/build/download-nar.scm @@ -18,9 +18,8 @@ (define-module (guix build download-nar) #:use-module (guix build download) - #:use-module (guix build utils) #:use-module ((guix serialization) #:hide (dump-port*)) - #:autoload (zlib) (call-with-gzip-input-port) + #:autoload (lzlib) (call-with-lzip-input-port) #:use-module (guix progress) #:use-module (web uri) #:use-module (srfi srfi-11) @@ -42,52 +41,21 @@ "Return the fallback nar URL for ITEM--e.g., \"/gnu/store/cabbag3…-foo-1.2-checkout\"." ;; Here we hard-code nar URLs without checking narinfos. That's probably OK - ;; though. Use berlin.guix.gnu.org instead of its ci.guix.gnu.org front end to - ;; avoid sending these requests to CDN providers without user consent. + ;; though. ;; TODO: Use HTTPS? The downside is the extra dependency. - (let ((bases '("http://berlin.guix.gnu.org")) + (let ((bases '("http://bordeaux.guix.gnu.org" + "http://ci.guix.gnu.org")) (item (basename item))) - (append (map (cut string-append <> "/nar/gzip/" item) bases) + (append (map (cut string-append <> "/nar/lzip/" item) bases) (map (cut string-append <> "/nar/" item) bases)))) -(define (restore-gzipped-nar port item size) - "Restore the gzipped nar read from PORT, of SIZE bytes (compressed), to +(define (restore-lzipped-nar port item size) + "Restore the lzipped nar read from PORT, of SIZE bytes (compressed), to ITEM." - ;; Since PORT is typically a non-file port (for instance because 'http-get' - ;; returns a delimited port), create a child process so we're back to a file - ;; port that can be passed to 'call-with-gzip-input-port'. - (match (pipe) - ((input . output) - (match (primitive-fork) - (0 - (dynamic-wind - (const #t) - (lambda () - (close-port output) - (close-port port) - (catch #t - (lambda () - (call-with-gzip-input-port input - (cut restore-file <> item))) - (lambda (key . args) - (print-exception (current-error-port) - (stack-ref (make-stack #t) 1) - key args) - (primitive-exit 1)))) - (lambda () - (primitive-exit 0)))) - (child - (close-port input) - (dump-port* port output - #:reporter (progress-reporter/file item size - #:abbreviation - store-path-abbreviation)) - (close-port output) - (newline) - (match (waitpid child) - ((_ . status) - (unless (zero? status) - (error "nar decompression failed" status))))))))) + (call-with-lzip-input-port port + (lambda (decompressed-port) + (restore-file decompressed-port + item)))) (define (download-nar item) "Download and extract the normalized archive for ITEM. Return #t on @@ -109,17 +77,25 @@ success, #f otherwise." (values #f #f))))) (if (not port) (loop rest) - (begin + (let* ((reporter (progress-reporter/file + url + size + (current-error-port) + #:abbreviation nar-uri-abbreviation)) + (port-with-progress + (progress-report-port reporter port + #:download-size size))) (if size (format #t "Downloading from ~a (~,2h MiB)...~%" url (/ size (expt 2 20.))) (format #t "Downloading from ~a...~%" url)) - (if (string-contains url "/gzip") - (restore-gzipped-nar port item size) + (if (string-contains url "/lzip") + (restore-lzipped-nar port-with-progress + item + size) (begin - ;; FIXME: Add progress report. - (restore-file port item) - (close-port port))) + (restore-file port-with-progress + item))) #t)))) (() #f)))) diff --git a/guix/build/gnu-dist.scm b/guix/build/gnu-dist.scm index fce1cd0759..cc48d3bdbf 100644 --- a/guix/build/gnu-dist.scm +++ b/guix/build/gnu-dist.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2015, 2020 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2015, 2020, 2023 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org> ;;; ;;; This file is part of GNU Guix. @@ -52,6 +52,7 @@ (delete 'strip) (replace 'install install-dist) (add-after 'build 'build-dist build) - (delete 'build))) + (delete 'build) + (delete 'install-license-files))) ;don't create 'OUT/share/doc' ;;; gnu-dist.scm ends here diff --git a/guix/build/linux-module-build-system.scm b/guix/build/linux-module-build-system.scm index 18ccf7cd8b..b93c5eaf93 100644 --- a/guix/build/linux-module-build-system.scm +++ b/guix/build/linux-module-build-system.scm @@ -21,10 +21,6 @@ (define-module (guix build linux-module-build-system) #:use-module ((guix build gnu-build-system) #:prefix gnu:) #:use-module (guix build utils) - #:use-module (ice-9 ftw) - #:use-module (ice-9 match) - #:use-module (srfi srfi-1) - #:use-module (srfi srfi-26) #:export (%standard-phases linux-module-build)) diff --git a/guix/build/svn.scm b/guix/build/svn.scm index 44d77a968f..2d960cb364 100644 --- a/guix/build/svn.scm +++ b/guix/build/svn.scm @@ -22,7 +22,6 @@ (define-module (guix build svn) #:use-module (guix build utils) #:use-module (srfi srfi-34) - #:use-module (ice-9 format) #:export (svn-fetch)) ;;; Commentary: |