diff options
Diffstat (limited to 'build-aux')
-rw-r--r-- | build-aux/build-self.scm | 1 | ||||
-rw-r--r-- | build-aux/compile-all.scm | 55 | ||||
-rw-r--r-- | build-aux/test-env.in | 7 | ||||
-rw-r--r-- | build-aux/update-NEWS.scm | 18 |
4 files changed, 46 insertions, 35 deletions
diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index 853a2f328f..f100ff4aae 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -250,6 +250,7 @@ interface (FFI) of Guile.") (match-lambda (('guix 'config) #f) (('guix 'channels) #f) + (('guix 'build 'download) #f) ;autoloaded by (guix download) (('guix _ ...) #t) (('gnu _ ...) #t) (_ #f))) diff --git a/build-aux/compile-all.scm b/build-aux/compile-all.scm index ad75e33a85..9ffbce43ad 100644 --- a/build-aux/compile-all.scm +++ b/build-aux/compile-all.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com> -;;; Copyright © 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2016, 2017, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -98,26 +98,36 @@ to 'make'." (exit 1))) (match (command-line) - ((_ . files) + ((_ "--total" (= string->number grand-total) + "--completed" (= string->number processed) + . files) + ;; GRAND-TOTAL is the total number of .scm files in the project; PROCESSED + ;; is the total number of .scm files already compiled in previous + ;; invocations of this script. (catch #t (lambda () - (compile-files srcdir (getcwd) - (filter file-needs-compilation? files) - #:workers (parallel-job-count*) - #:host host - #:report-load (lambda (file total completed) - (when file - (format #t "[~3d%] LOAD ~a~%" - (% (+ 1 completed) (* 2 total)) - file) - (force-output))) - #:report-compilation (lambda (file total completed) - (when file - (format #t "[~3d%] GUILEC ~a~%" - (% (+ total completed 1) - (* 2 total)) - (scm->go file)) - (force-output))))) + (let* ((to-build (filter file-needs-compilation? files)) + (processed (+ processed + (- (length files) (length to-build))))) + (compile-files srcdir (getcwd) to-build + #:workers (parallel-job-count*) + #:host host + #:report-load (lambda (file total completed) + (when file + (format #t "[~3d%] LOAD ~a~%" + (% (+ 1 completed + (* 2 processed)) + (* 2 grand-total)) + file) + (force-output))) + #:report-compilation (lambda (file total completed) + (when file + (format #t "[~3d%] GUILEC ~a~%" + (% (+ total completed 1 + (* 2 processed)) + (* 2 grand-total)) + (scm->go file)) + (force-output)))))) (lambda _ (primitive-exit 1)) (lambda args @@ -132,11 +142,8 @@ to 'make'." (false-if-exception (module-ref ui 'report-load-error))))) (if report - ;; In Guile <= 2.2.5, 'current-load-port' was not exported. - (let ((load-port ((module-ref (resolve-module '(ice-9 ports)) - 'current-load-port)))) - (report (or (and=> load-port port-filename) "?.scm") - args frame)) + (report (or (and=> (current-load-port) port-filename) "?.scm") + args frame) (begin (print-exception (current-error-port) frame (car args) (cdr args)) diff --git a/build-aux/test-env.in b/build-aux/test-env.in index 59ab58cc94..7efc43206c 100644 --- a/build-aux/test-env.in +++ b/build-aux/test-env.in @@ -1,7 +1,7 @@ #!/bin/sh # GNU Guix --- Functional package management for GNU -# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> +# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org> # # This file is part of GNU Guix. # @@ -91,14 +91,11 @@ then # Place for the substituter's cache. XDG_CACHE_HOME="$GUIX_STATE_DIRECTORY/cache-$$" - # For the (guix import snix) tests. - NIXPKGS="@NIXPKGS@" - export NIX_IGNORE_SYMLINK_STORE NIX_STORE_DIR \ GUIX_LOG_DIRECTORY GUIX_STATE_DIRECTORY GUIX_DATABASE_DIRECTORY \ GUIX_BINARY_SUBSTITUTE_URL \ GUIX_ALLOW_UNAUTHENTICATED_SUBSTITUTES \ - GUIX_CONFIGURATION_DIRECTORY XDG_CACHE_HOME NIXPKGS + GUIX_CONFIGURATION_DIRECTORY XDG_CACHE_HOME # Launch the daemon without chroot support because is may be # unavailable, for instance if we're not running as root. diff --git a/build-aux/update-NEWS.scm b/build-aux/update-NEWS.scm index a05ecad091..c029d2f0da 100644 --- a/build-aux/update-NEWS.scm +++ b/build-aux/update-NEWS.scm @@ -95,7 +95,7 @@ paragraph." (with-atomic-file-replacement news-file (lambda (input output) (rewrite-org-section input output - (make-regexp "^(\\*+) (.*) new packages") + (make-regexp "^(\\*+).*new packages") (lambda (match port) (let ((stars (match:substring match 1))) (format port @@ -141,7 +141,7 @@ paragraph." (with-atomic-file-replacement news-file (lambda (input output) (rewrite-org-section input output - (make-regexp "^(\\*+) (.*) package updates") + (make-regexp "^(\\*+).*package updates") (lambda (match port) (let ((stars (match:substring match 1)) (lst (map (match-lambda @@ -166,16 +166,22 @@ paragraph." (string-append data-directory "/packages-" version ".txt")) + (define (package<? p1 p2) + (string<? (package-full-name p1) (package-full-name p2))) + (let-values (((previous-version new-version) (call-with-input-file news-file NEWS->versions))) (format (current-error-port) "Updating NEWS for ~a to ~a...~%" previous-version new-version) (let* ((old (call-with-input-file (package-file previous-version) read)) - (new (fold-packages (lambda (p r) - (alist-cons (package-name p) (package-version p) - r)) - '()))) + (all-packages/sorted (sort (fold-packages (lambda (p r) + (cons p r)) + '()) + package<?)) + (new (map (lambda (p) + (cons (package-name p) (package-version p))) + all-packages/sorted))) (call-with-output-file (package-file new-version) (lambda (port) (pretty-print new port))) |