From c7ca707b59304a978cab8c5c25401259c6c18214 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 30 Dec 2019 22:49:09 +0100 Subject: import: crate: Honor crate version for recursive imports. Fixes . Reported by Valentin Ignatev . * guix/import/crate.scm (crate-recursive-import): Add optional 'version' parameter and honor it. * guix/scripts/import/crate.scm (guix-import-crate): Pass VERSION as 2nd argument to 'crate-recursive-import'. --- guix/import/crate.scm | 9 ++++++--- guix/scripts/import/crate.scm | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/import/crate.scm b/guix/import/crate.scm index 4c3f8000d0..405a26a877 100644 --- a/guix/import/crate.scm +++ b/guix/import/crate.scm @@ -231,10 +231,13 @@ latest version of CRATE-NAME." string->license)) (append cargo-inputs cargo-development-inputs))))) -(define (crate-recursive-import crate-name) +(define* (crate-recursive-import crate-name #:optional version) (recursive-import crate-name #f - #:repo->guix-package (lambda (name repo) - (crate->guix-package name)) + #:repo->guix-package + (lambda (name repo) + (let ((version (and (string=? name crate-name) + version))) + (crate->guix-package name version))) #:guix-name crate-name->package-name)) (define (guix-package->crate-name package) diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm index 92034dab3c..d834518c18 100644 --- a/guix/scripts/import/crate.scm +++ b/guix/scripts/import/crate.scm @@ -100,7 +100,7 @@ Import and convert the crate.io package for PACKAGE-NAME.\n")) `(define-public ,(string->symbol name) ,pkg)) (_ #f)) - (crate-recursive-import name)) + (crate-recursive-import name version)) (let ((sexp (crate->guix-package name version))) (unless sexp (leave (G_ "failed to download meta-data for package '~a'~%") -- cgit v1.2.3 From 09edf136efb570c3a84dd2dc2c043b28515e0c60 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 2 Jan 2020 18:32:10 +0100 Subject: ui: It's 2020 now! * guix/ui.scm (show-version-and-exit): Change year to 2020. --- guix/ui.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/ui.scm b/guix/ui.scm index 540671f3dd..023e604085 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2013, 2018 Mark H Weaver ;;; Copyright © 2013 Nikita Karetnikov ;;; Copyright © 2014 Cyril Roelandt @@ -494,7 +494,7 @@ See the \"Application Setup\" section in the manual, for more info.\n"))))) "Display version information for COMMAND and `(exit 0)'." (simple-format #t "~a (~a) ~a~%" command %guix-package-name %guix-version) - (format #t "Copyright ~a 2019 ~a" + (format #t "Copyright ~a 2020 ~a" ;; TRANSLATORS: Translate "(C)" to the copyright symbol ;; (C-in-a-circle), if this symbol is available in the user's ;; locale. Otherwise, do not translate "(C)"; leave it as-is. */ -- cgit v1.2.3 From ba42da245bdb50aa98eecfeea8d207cefa209d48 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Fri, 3 Jan 2020 11:59:25 +0100 Subject: gnu: uglify-js: Move back next to sbcl-cl-uglify-js definition. This fixes the bug which prevented uglify-js from being defined properly, and cascaded back to all Common Lisp packages. * gnu/packages/bioinformatics.scm: Replace javascript module with lisp-xyz. * gnu/packages/cran.scm: Use lisp-xyz module. * gnu/packages/javascript.scm (uglify-js): Move from here... * gnu/packages/lisp-xyz.scm: ... To here. * gnu/packages/web.scm: Replace javascript module with lisp-xyz. * guix/build-system/minify.scm: Find uglify-js in the lisp-xyz module. --- gnu/packages/bioinformatics.scm | 2 +- gnu/packages/cran.scm | 1 + gnu/packages/javascript.scm | 48 ----------------------------------------- gnu/packages/lisp-xyz.scm | 47 ++++++++++++++++++++++++++++++++++++++++ gnu/packages/web.scm | 2 +- guix/build-system/minify.scm | 4 ++-- 6 files changed, 52 insertions(+), 52 deletions(-) (limited to 'guix') diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index b7b1777c24..613015c67e 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -85,10 +85,10 @@ #:use-module (gnu packages imagemagick) #:use-module (gnu packages java) #:use-module (gnu packages java-compression) - #:use-module (gnu packages javascript) #:use-module (gnu packages jemalloc) #:use-module (gnu packages dlang) #:use-module (gnu packages linux) + #:use-module (gnu packages lisp-xyz) #:use-module (gnu packages logging) #:use-module (gnu packages machine-learning) #:use-module (gnu packages man) diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm index b263b6a425..2c43d3fc5f 100644 --- a/gnu/packages/cran.scm +++ b/gnu/packages/cran.scm @@ -62,6 +62,7 @@ #:use-module (gnu packages imagemagick) #:use-module (gnu packages java) #:use-module (gnu packages javascript) + #:use-module (gnu packages lisp-xyz) #:use-module (gnu packages machine-learning) #:use-module (gnu packages maths) #:use-module (gnu packages mpi) diff --git a/gnu/packages/javascript.scm b/gnu/packages/javascript.scm index 6718274da2..83fa5ede4c 100644 --- a/gnu/packages/javascript.scm +++ b/gnu/packages/javascript.scm @@ -25,7 +25,6 @@ #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (gnu packages compression) - #:use-module (gnu packages lisp) #:use-module (gnu packages lisp-xyz) #:use-module (gnu packages readline) #:use-module (guix packages) @@ -453,50 +452,3 @@ to use, and is very similar to Lua. There is no need to interact with byzantine C++ template mechanisms, or worry about marking and unmarking garbage collection roots, or wrestle with obscure build systems.") (license license:isc))) - -(define-public uglify-js - (package - (inherit sbcl-cl-uglify-js) - (name "uglify-js") - (build-system trivial-build-system) - (arguments - `(#:modules ((guix build utils)) - #:builder - (let* ((bin (string-append (assoc-ref %outputs "out") "/bin/")) - (script (string-append bin "uglify-js"))) - (use-modules (guix build utils)) - (mkdir-p bin) - (with-output-to-file script - (lambda _ - (format #t "#!~a/bin/sbcl --script - (require :asdf) - (push (truename \"~a/lib/sbcl\") asdf:*central-registry*)" - (assoc-ref %build-inputs "sbcl") - (assoc-ref %build-inputs "sbcl-cl-uglify-js")) - ;; FIXME: cannot use progn here because otherwise it fails to - ;; find cl-uglify-js. - (for-each - write - '(;; Quiet, please! - (let ((*standard-output* (make-broadcast-stream)) - (*error-output* (make-broadcast-stream))) - (asdf:load-system :cl-uglify-js)) - (let ((file (cadr *posix-argv*))) - (if file - (format t "~a" - (cl-uglify-js:ast-gen-code - (cl-uglify-js:ast-mangle - (cl-uglify-js:ast-squeeze - (with-open-file (in file) - (parse-js:parse-js in)))) - :beautify nil)) - (progn - (format *error-output* - "Please provide a JavaScript file.~%") - (sb-ext:exit :code 1)))))))) - (chmod script #o755) - #t))) - (inputs - `(("sbcl" ,sbcl) - ("sbcl-cl-uglify-js" ,sbcl-cl-uglify-js))) - (synopsis "JavaScript compressor"))) diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm index 3589640653..96d31118d7 100644 --- a/gnu/packages/lisp-xyz.scm +++ b/gnu/packages/lisp-xyz.scm @@ -823,6 +823,53 @@ compressor. It works on data produced by @code{parse-js} to generate a (define-public cl-uglify-js (sbcl-package->cl-source-package sbcl-cl-uglify-js)) +(define-public uglify-js + (package + (inherit sbcl-cl-uglify-js) + (name "uglify-js") + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (let* ((bin (string-append (assoc-ref %outputs "out") "/bin/")) + (script (string-append bin "uglify-js"))) + (use-modules (guix build utils)) + (mkdir-p bin) + (with-output-to-file script + (lambda _ + (format #t "#!~a/bin/sbcl --script + (require :asdf) + (push (truename \"~a/lib/sbcl\") asdf:*central-registry*)" + (assoc-ref %build-inputs "sbcl") + (assoc-ref %build-inputs "sbcl-cl-uglify-js")) + ;; FIXME: cannot use progn here because otherwise it fails to + ;; find cl-uglify-js. + (for-each + write + '(;; Quiet, please! + (let ((*standard-output* (make-broadcast-stream)) + (*error-output* (make-broadcast-stream))) + (asdf:load-system :cl-uglify-js)) + (let ((file (cadr *posix-argv*))) + (if file + (format t "~a" + (cl-uglify-js:ast-gen-code + (cl-uglify-js:ast-mangle + (cl-uglify-js:ast-squeeze + (with-open-file (in file) + (parse-js:parse-js in)))) + :beautify nil)) + (progn + (format *error-output* + "Please provide a JavaScript file.~%") + (sb-ext:exit :code 1)))))))) + (chmod script #o755) + #t))) + (inputs + `(("sbcl" ,sbcl) + ("sbcl-cl-uglify-js" ,sbcl-cl-uglify-js))) + (synopsis "JavaScript compressor"))) + (define-public sbcl-cl-strings (let ((revision "1") (commit "c5c5cbafbf3e6181d03c354d66e41a4f063f00ae")) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 3a8a04c76d..65038f7c66 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -103,7 +103,6 @@ #:use-module (gnu packages guile) #:use-module (gnu packages guile-xyz) #:use-module (gnu packages java) - #:use-module (gnu packages javascript) #:use-module (gnu packages jemalloc) #:use-module (gnu packages image) #:use-module (gnu packages imagemagick) @@ -111,6 +110,7 @@ #:use-module (gnu packages libidn) #:use-module (gnu packages libunistring) #:use-module (gnu packages linux) + #:use-module (gnu packages lisp-xyz) #:use-module (gnu packages lua) #:use-module (gnu packages markup) #:use-module (gnu packages ncurses) diff --git a/guix/build-system/minify.scm b/guix/build-system/minify.scm index 1418a71091..28a6781c06 100644 --- a/guix/build-system/minify.scm +++ b/guix/build-system/minify.scm @@ -44,8 +44,8 @@ (define (default-uglify-js) "Return the default package to minify JavaScript source files." ;; Lazily resolve the binding to avoid a circular dependency. - (let ((js-mod (resolve-interface '(gnu packages javascript)))) - (module-ref js-mod 'uglify-js))) + (let ((mod (resolve-interface '(gnu packages lisp-xyz)))) + (module-ref mod 'uglify-js))) (define* (lower name #:key source inputs native-inputs outputs system -- cgit v1.2.3 From 52207b3938d3ccbeb661ba8d0af563cf1e0e3333 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 3 Jan 2020 12:39:48 +0100 Subject: gexp: 'gexp->script' marks its result as non-offloadable and non-substitutable. * guix/gexp.scm (gexp->script): Pass #:local-build? and #:substitutable? to 'gexp->derivation'. --- guix/gexp.scm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/gexp.scm b/guix/gexp.scm index 12331052a6..912960fd1d 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2018 Clément Lassieur ;;; Copyright © 2018 Jan Nieuwenhuizen ;;; Copyright © 2019 Mathieu Othacehe @@ -1602,7 +1602,12 @@ imported modules in its search path. Look up EXP's modules in MODULE-PATH." (chmod port #o555)))) #:system system #:target target - #:module-path module-path))) + #:module-path module-path + + ;; These derivations are not worth offloading or + ;; substituting. + #:local-build? #t + #:substitutable? #f))) (define* (gexp->file name exp #:key (set-load-path? #t) -- cgit v1.2.3 From f4cde9ac4aedb516c050a30fd999673da434bfa0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 3 Jan 2020 15:47:12 +0100 Subject: download: Do not leak file descriptors on TLS ports. Fixes . * guix/build/download.scm (%tls-ports, register-tls-record-port): Remove. (tls-wrap): Remove call to 'register-tls-record-port'. Return a custom binary input/output port instead. This is a backport of what Guile 2.2's (web client) module has been doing. (close-connection): Define as an alias for 'close-port'. * guix/http-client.scm (http-fetch): Remove #:keep-alive? parameter, which was ignored and unused. Pass #:keep-alive? #f to 'http-get'. * guix/lint.scm (probe-uri): Use 'close-port' instead of 'close-connection'. * guix/scripts/substitute.scm (http-multiple-get): Likewise. --- guix/build/download.scm | 66 +++++++++++++++++++++++++-------------------- guix/http-client.scm | 13 +++++---- guix/lint.scm | 9 +++---- guix/scripts/substitute.scm | 7 +++-- 4 files changed, 52 insertions(+), 43 deletions(-) (limited to 'guix') diff --git a/guix/build/download.scm b/guix/build/download.scm index 53a144f126..a7bb3b0d6e 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -28,6 +28,7 @@ #:use-module (guix build utils) #:use-module (guix progress) #:use-module (rnrs io ports) + #:use-module ((ice-9 binary-ports) #:select (unget-bytevector)) #:use-module (rnrs bytevectors) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) @@ -160,15 +161,6 @@ out if the connection could not be established in less than TIMEOUT seconds." '(gnutls) '(make-session connection-end/client)) -(define %tls-ports - ;; Mapping of session record ports to the underlying file port. - (make-weak-key-hash-table)) - -(define (register-tls-record-port record-port port) - "Hold a weak reference from RECORD-PORT to PORT, where RECORD-PORT is a TLS -session record port using PORT as its underlying communication port." - (hashq-set! %tls-ports record-port port)) - (define %x509-certificate-directory ;; The directory where X.509 authority PEM certificates are stored. (make-parameter (or (getenv "GUIX_TLS_CERTIFICATE_DIRECTORY") @@ -311,17 +303,40 @@ host name without trailing dot." (apply throw args)))) (let ((record (session-record-port session))) - ;; Since we use `fileno' above, the file descriptor behind PORT would be - ;; closed when PORT is GC'd. If we used `port->fdes', it would instead - ;; never be closed. So we use `fileno', but keep a weak reference to - ;; PORT, so the file descriptor gets closed when RECORD is GC'd. - (register-tls-record-port record port) - - ;; Write HTTP requests line by line rather than byte by byte: - ;; . This is possible with Guile >= 2.2. - (setvbuf record 'line) - - record))) + (define (read! bv start count) + (define read-bv (get-bytevector-some record)) + (if (eof-object? read-bv) + 0 ; read! returns 0 on eof-object + (let ((read-bv-len (bytevector-length read-bv))) + (bytevector-copy! read-bv 0 bv start (min read-bv-len count)) + (when (< count read-bv-len) + (unget-bytevector record bv count (- read-bv-len count))) + read-bv-len))) + (define (write! bv start count) + (put-bytevector record bv start count) + (force-output record) + count) + (define (get-position) + (port-position record)) + (define (set-position! new-position) + (set-port-position! record new-position)) + (define (close) + (unless (port-closed? port) + (close-port port)) + (unless (port-closed? record) + (close-port record))) + + (setvbuf record 'block) + + ;; Return a port that wraps RECORD to ensure that closing it also + ;; closes PORT, the actual socket port, and its file descriptor. + ;; XXX: This wrapper would be unnecessary if GnuTLS could + ;; automatically close SESSION's file descriptor when RECORD is + ;; closed, but that doesn't seem to be possible currently (as of + ;; 3.6.9). + (make-custom-binary-input/output-port "gnutls wrapped port" read! write! + get-position set-position! + close)))) (define (ensure-uri uri-or-string) ;XXX: copied from (web http) (cond @@ -429,16 +444,9 @@ VERIFY-CERTIFICATE? is true, verify HTTPS server certificates." #:verify-certificate? verify-certificate?) s))))) -(define (close-connection port) - "Like 'close-port', but (1) idempotent, and (2) also closes the underlying -port if PORT is a TLS session record port." - ;; FIXME: This is a partial workaround for , - ;; because 'http-fetch' & co. may return a chunked input port whose 'close' - ;; method calls 'close-port', not 'close-connection'. +(define (close-connection port) ;deprecated (unless (port-closed? port) - (close-port port)) - (and=> (hashq-ref %tls-ports port) - close-connection)) + (close-port port))) ;; XXX: This is an awful hack to make sure the (set-port-encoding! p ;; "ISO-8859-1") call in `read-response' passes, even during bootstrap diff --git a/guix/http-client.scm b/guix/http-client.scm index 067002a79a..5a5a33b4c0 100644 --- a/guix/http-client.scm +++ b/guix/http-client.scm @@ -70,14 +70,13 @@ (define* (http-fetch uri #:key port (text? #f) (buffered? #t) - keep-alive? (verify-certificate? #t) + (verify-certificate? #t) (headers '((user-agent . "GNU Guile")))) "Return an input port containing the data at URI, and the expected number of bytes available or #f. If TEXT? is true, the data at URI is considered to be textual. Follow any HTTP redirection. When BUFFERED? is #f, return an -unbuffered port, suitable for use in `filtered-port'. When KEEP-ALIVE? is -true, send a 'Connection: keep-alive' HTTP header, in which case PORT may be -reused for future HTTP requests. HEADERS is an alist of extra HTTP headers. +unbuffered port, suitable for use in `filtered-port'. HEADERS is an alist of +extra HTTP headers. When VERIFY-CERTIFICATE? is true, verify HTTPS server certificates. @@ -100,7 +99,11 @@ Raise an '&http-get-error' condition if downloading fails." (setvbuf port 'none)) (let*-values (((resp data) (http-get uri #:streaming? #t #:port port - #:keep-alive? #t + ;; XXX: When #:keep-alive? is true, if DATA is + ;; a chunked-encoding port, closing DATA won't + ;; close PORT, leading to a file descriptor + ;; leak. + #:keep-alive? #f #:headers headers)) ((code) (response-code resp))) diff --git a/guix/lint.scm b/guix/lint.scm index cd2ea571ed..41ddff584d 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014 Cyril Roelandt ;;; Copyright © 2014, 2015 Eric Bavier -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2015, 2016 Mathieu Lirzin ;;; Copyright © 2016 Danny Milosavljevic ;;; Copyright © 2016 Hartmut Goebel @@ -26,7 +26,7 @@ ;;; along with GNU Guix. If not, see . (define-module (guix lint) - #:use-module ((guix store) #:hide (close-connection)) + #:use-module (guix store) #:use-module (guix base32) #:use-module (guix diagnostics) #:use-module (guix download) @@ -54,8 +54,7 @@ #:use-module ((guix build download) #:select (maybe-expand-mirrors (open-connection-for-uri - . guix:open-connection-for-uri) - close-connection)) + . guix:open-connection-for-uri))) #:use-module (web request) #:use-module (web response) #:use-module (srfi srfi-1) @@ -453,7 +452,7 @@ for connections to complete; when TIMEOUT is #f, wait as long as needed." (force-output port) (read-response port)) (lambda () - (close-connection port)))) + (close-port port)))) (case (response-code response) ((302 ; found (redirection) diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 7eca2c6874..3bf9b8735f 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2014 Nikita Karetnikov ;;; Copyright © 2018 Kyle Meyer ;;; @@ -20,7 +20,7 @@ (define-module (guix scripts substitute) #:use-module (guix ui) - #:use-module ((guix store) #:hide (close-connection)) + #:use-module (guix store) #:use-module (guix utils) #:use-module (guix combinators) #:use-module (guix config) @@ -37,7 +37,6 @@ #:select (uri-abbreviation nar-uri-abbreviation (open-connection-for-uri . guix:open-connection-for-uri) - close-connection store-path-abbreviation byte-count->string)) #:use-module (guix progress) #:use-module ((guix build syscalls) @@ -556,7 +555,7 @@ initial connection on which HTTP requests are sent." ;; Note that even upon "Connection: close", we can read from BODY. (match (assq 'connection (response-headers resp)) (('connection 'close) - (close-connection p) + (close-port p) (connect #f ;try again (append tail (drop requests processed)) result)) -- cgit v1.2.3 From af0aefd8c10701fa32341506e36297e5105f6143 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 3 Jan 2020 16:01:11 +0100 Subject: import: cran: Fix file descriptor leak. Fixes . Reported by Ricardo Wurmus . * guix/import/cran.scm (bioconductor-packages-list): Close the port returned by 'http-fetch/cached'. (fetch-description): Likewise. --- guix/import/cran.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/import/cran.scm b/guix/import/cran.scm index f3f1747e43..13771ec598 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus -;;; Copyright © 2015, 2016, 2017, 2019 Ludovic Courtès +;;; Copyright © 2015, 2016, 2017, 2019, 2020 Ludovic Courtès ;;; Copyright © 2017 Mathieu Othacehe ;;; ;;; This file is part of GNU Guix. @@ -161,7 +161,10 @@ release." ;; alist of attributes. (map (lambda (chunk) (description->alist (string-join chunk "\n"))) - (chunk-lines (read-lines (http-fetch/cached url))))))) + (let* ((port (http-fetch/cached url)) + (lines (read-lines port))) + (close-port port) + (chunk-lines lines)))))) (define* (latest-bioconductor-package-version name #:optional type) "Return the version string corresponding to the latest release of the @@ -206,7 +209,10 @@ from ~s: ~a (~s)~%" (http-get-error-code c) (http-get-error-reason c)) #f)) - (description->alist (read-string (http-fetch url)))))) + (let* ((port (http-fetch url)) + (result (description->alist (read-string port)))) + (close-port port) + result)))) ((bioconductor) ;; Currently, the bioconductor project does not offer a way to access a ;; package's DESCRIPTION file over HTTP, so we determine the version, -- cgit v1.2.3 From f851fd6b2b4f8e23445aba863f2f063a251f2d9a Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 2 Dec 2019 23:59:57 +0100 Subject: build-system/guile: Add #:implicit-inputs?. * guix/build-system/guile.scm (lower): Add implicit-inputs? keyword parameter. [private-keywords]: Add it. Honor it. --- guix/build-system/guile.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/build-system/guile.scm b/guix/build-system/guile.scm index 2c5cc968ce..3693014694 100644 --- a/guix/build-system/guile.scm +++ b/guix/build-system/guile.scm @@ -36,6 +36,7 @@ (define* (lower name #:key source inputs native-inputs outputs system target + (implicit-inputs? #t) #:allow-other-keys #:rest arguments) "Return a bag for NAME." @@ -45,7 +46,8 @@ ;; procedures like 'package-for-guile-2.0' unchanged and simple. (define private-keywords - '(#:target #:inputs #:native-inputs)) + '(#:target #:inputs #:native-inputs + #:implicit-inputs?)) (bag (name name) @@ -56,8 +58,10 @@ `(("source" ,source)) '()) ,@native-inputs - ,@(map (cute assoc <> (standard-packages)) - '("tar" "gzip" "bzip2" "xz" "locales")))) + ,@(if implicit-inputs? + (map (cute assoc <> (standard-packages)) + '("tar" "gzip" "bzip2" "xz" "locales")) + '()))) (outputs outputs) (build (if target guile-cross-build guile-build)) (arguments (strip-keyword-arguments private-keywords arguments)))) -- cgit v1.2.3 From d63ee94d63c667e0c63651d6b775460f4c67497d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 6 Dec 2019 23:12:49 +0100 Subject: gexp: Add 'raw-derivation-file'. * guix/gexp.scm (): New record type. (raw-derivation-file-compiler): New gexp compiler. * tests/gexp.scm ("lower-gexp, raw-derivation-file") ("raw-derivation-file"): New tests. --- guix/gexp.scm | 26 ++++++++++++++++++++++++++ tests/gexp.scm | 31 ++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/gexp.scm b/guix/gexp.scm index 912960fd1d..c4f4e80209 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -79,6 +79,9 @@ file-append-base file-append-suffix + raw-derivation-file + raw-derivation-file? + load-path-expression gexp-modules @@ -265,6 +268,29 @@ The expander specifies how an object is converted to its sexp representation." (with-monad %store-monad (return drv))) +;; Expand to a raw ".drv" file for the lowerable object it wraps. In other +;; words, this gives the raw ".drv" file instead of its build result. +(define-record-type + (raw-derivation-file obj) + raw-derivation-file? + (obj raw-derivation-file-object)) ;lowerable object + +(define-gexp-compiler raw-derivation-file-compiler + compiler => (lambda (obj system target) + (mlet %store-monad ((obj (lower-object + (raw-derivation-file-object obj) + system #:target target))) + ;; Returning the .drv file name instead of the + ;; record ensures that 'lower-gexp' will classify it as a + ;; "source" and not as an "input". + (return (if (derivation? obj) + (derivation-file-name obj) + obj)))) + expander => (lambda (obj lowered output) + (if (derivation? lowered) + (derivation-file-name lowered) + lowered))) + ;;; ;;; File declarations. diff --git a/tests/gexp.scm b/tests/gexp.scm index 8b1596f66d..7c8985d846 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -879,6 +879,17 @@ (eq? (derivation-input-derivation (lowered-gexp-guile lexp)) (%guile-for-build))))))) +(test-assertm "lower-gexp, raw-derivation-file" + (mlet* %store-monad ((thing -> (program-file "prog" #~(display "hi!"))) + (exp -> #~(list #$(raw-derivation-file thing))) + (drv (lower-object thing)) + (lexp (lower-gexp exp #:effective-version "2.0"))) + (return (and (equal? `(list ,(derivation-file-name drv)) + (lowered-gexp-sexp lexp)) + (equal? (list (derivation-file-name drv)) + (lowered-gexp-sources lexp)) + (null? (lowered-gexp-inputs lexp)))))) + (test-eq "lower-gexp, non-self-quoting input" + (guard (c ((gexp-input-error? c) @@ -1157,6 +1168,24 @@ (equal? `(list "foo" ,text) (call-with-input-file out read))))))))) +(test-assertm "raw-derivation-file" + (let* ((exp #~(let ((drv #$(raw-derivation-file coreutils))) + (when (file-exists? drv) + (symlink drv #$output))))) + (mlet* %store-monad ((dep (lower-object coreutils)) + (drv (gexp->derivation "drv-ref" exp)) + (out -> (derivation->output-path drv))) + (mbegin %store-monad + (built-derivations (list drv)) + (mlet %store-monad ((refs (references* out))) + (return (and (member (derivation-file-name dep) + (derivation-sources drv)) + (not (member (derivation-file-name dep) + (map derivation-input-path + (derivation-inputs drv)))) + (equal? (readlink out) (derivation-file-name dep)) + (equal? refs (list (derivation-file-name dep)))))))))) + (test-assert "text-file*" (run-with-store %store (mlet* %store-monad -- cgit v1.2.3 From 6a7c4636d4dec47eefa03c95da5a1315bd0e0413 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 6 Jan 2020 15:14:09 +0100 Subject: Adjust module autoloads. In Guile < 2.9.7, autoloading a module would give you access to all its bindings. In future versions, autoloading a module gives access only to the listed bindings, as per #:select (see ). This commit adjusts autoloads to the new semantics, allowing Guix to be built with Guile 2.9.7/2.9.8. * guix/build/download.scm : Remove call to 'module-autoload!'. (load-gnutls): New procedure. (tls-wrap): Call it. * guix/git.scm : Remove call to 'module-autoload!'. (load-git-submodules): New procedure. (update-submodules): Call it instead of 'resolve-interface'. * gnu/bootloader/grub.scm: Replace #:autoload with #:use-module. * gnu/packages.scm: Likewise. * gnu/packages/ssh.scm: Likewise. * gnu/packages/tex.scm: Likewise. * gnu/services/cuirass.scm: Likewise. * gnu/services/mcron.scm: Likewise. * guix/lint.scm: Augment list of bindings in #:autoload. * guix/scripts/build.scm: Likewise. * guix/scripts/gc.scm: Likewise. * guix/scripts/pack.scm: Likewise. * guix/scripts/publish.scm: Likewise. * guix/scripts/pull.scm: Likewise. * guix/utils.scm: Remove unnecessary #:autoload clauses; replace one of them with #:use-module. --- gnu/bootloader/grub.scm | 2 +- gnu/packages.scm | 6 +++--- gnu/packages/ssh.scm | 6 +++--- gnu/packages/tex.scm | 2 +- gnu/services/cuirass.scm | 6 +++--- gnu/services/mcron.scm | 4 ++-- guix/build/download.scm | 13 +++++++------ guix/git.scm | 21 ++++++++++++++------- guix/lint.scm | 3 ++- guix/scripts/build.scm | 6 +++--- guix/scripts/gc.scm | 2 +- guix/scripts/pack.scm | 6 ++++-- guix/scripts/publish.scm | 6 ++++-- guix/scripts/pull.scm | 6 ++++-- guix/utils.scm | 7 ++----- 15 files changed, 54 insertions(+), 42 deletions(-) (limited to 'guix') diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index adcdbdbab0..f13685ac9d 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -28,7 +28,7 @@ #:use-module (gnu system uuid) #:use-module (gnu system file-systems) #:use-module (gnu system keyboard) - #:autoload (gnu packages bootloaders) (grub) + #:use-module (gnu packages bootloaders) #:autoload (gnu packages gtk) (guile-cairo guile-rsvg) #:autoload (gnu packages xorg) (xkeyboard-config) #:use-module (ice-9 match) diff --git a/gnu/packages.scm b/gnu/packages.scm index 959777ff8f..143469b288 100644 --- a/gnu/packages.scm +++ b/gnu/packages.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2013 Mark H Weaver ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2016, 2017 Alex Kost @@ -30,12 +30,12 @@ #:select ((package-name->name+version . hyphen-separated-name->name+version) mkdir-p)) - #:autoload (guix profiles) (packages->manifest) + #:use-module (guix profiles) #:use-module (guix describe) #:use-module (guix deprecation) #:use-module (ice-9 vlist) #:use-module (ice-9 match) - #:autoload (ice-9 binary-ports) (put-bytevector) + #:use-module (ice-9 binary-ports) #:autoload (system base compile) (compile) #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm index 45b8f0db00..ec4f00d8e6 100644 --- a/gnu/packages/ssh.scm +++ b/gnu/packages/ssh.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2013, 2014 Andreas Enge ;;; Copyright © 2014, 2015, 2016 Mark H Weaver ;;; Copyright © 2015, 2016, 2018, 2019 Efraim Flashner @@ -32,7 +32,7 @@ #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages base) - #:autoload (gnu packages boost) (boost) + #:use-module (gnu packages boost) #:use-module (gnu packages compression) #:use-module (gnu packages crypto) #:use-module (gnu packages elf) @@ -51,7 +51,7 @@ #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages popt) - #:autoload (gnu packages protobuf) (protobuf) + #:use-module (gnu packages protobuf) #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) #:use-module (gnu packages readline) diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index d184d7616b..e4346d1232 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -71,7 +71,7 @@ #:use-module (gnu packages xml) #:use-module (gnu packages xorg) #:use-module (gnu packages xdisorg) - #:autoload (gnu packages texinfo) (texinfo) + #:use-module (gnu packages texinfo) #:use-module (ice-9 ftw) #:use-module (ice-9 match) #:use-module ((srfi srfi-1) #:hide (zip))) diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm index d92421762a..7bfb021161 100644 --- a/gnu/services/cuirass.scm +++ b/gnu/services/cuirass.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Mathieu Lirzin -;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2017 Jan Nieuwenhuizen ;;; Copyright © 2018, 2019 Ricardo Wurmus @@ -25,8 +25,8 @@ #:use-module (guix gexp) #:use-module (guix records) #:use-module (gnu packages admin) - #:autoload (gnu packages ci) (cuirass) - #:autoload (gnu packages version-control) (git) + #:use-module (gnu packages ci) + #:use-module (gnu packages version-control) #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services shepherd) diff --git a/gnu/services/mcron.scm b/gnu/services/mcron.scm index 1327516b49..d9627c6bd0 100644 --- a/gnu/services/mcron.scm +++ b/gnu/services/mcron.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,7 +19,7 @@ (define-module (gnu services mcron) #:use-module (gnu services) #:use-module (gnu services shepherd) - #:autoload (gnu packages guile-xyz) (mcron) + #:use-module (gnu packages guile-xyz) #:use-module (guix deprecation) #:use-module (guix records) #:use-module (guix gexp) diff --git a/guix/build/download.scm b/guix/build/download.scm index a7bb3b0d6e..641dacefa1 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2017 Tobias Geerinckx-Rice ;;; @@ -155,11 +155,11 @@ out if the connection could not be established in less than TIMEOUT seconds." ;; be bound if we need them, because (guix download) adds GnuTLS as an ;; input in that case. -;; XXX: Use this hack instead of #:autoload to avoid compilation errors. -;; See . -(module-autoload! (current-module) - '(gnutls) - '(make-session connection-end/client)) +(define (load-gnutls) + ;; XXX: Use this hack instead of #:autoload to avoid compilation errors. + ;; See . + (module-use! (current-module) (resolve-interface '(gnutls))) + (set! load-gnutls (const #t))) (define %x509-certificate-directory ;; The directory where X.509 authority PEM certificates are stored. @@ -245,6 +245,7 @@ host name without trailing dot." (format (current-error-port) "gnutls: [~a|~a] ~a" (getpid) level str)) + (load-gnutls) (let ((session (make-session connection-end/client)) (ca-certs (%x509-certificate-directory))) diff --git a/guix/git.scm b/guix/git.scm index 83af596ef5..15a0a6f9e5 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Mathieu Othacehe -;;; Copyright © 2018, 2019 Ludovic Courtès +;;; Copyright © 2018, 2019, 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -48,11 +48,6 @@ git-checkout-url git-checkout-branch)) -;; XXX: Use this hack instead of #:autoload to avoid compilation errors. -;; See . -(module-autoload! (current-module) - '(git submodule) '(repository-submodules)) - (define %repository-cache-directory (make-parameter (string-append (cache-directory #:ensure? #f) "/checkouts"))) @@ -200,11 +195,23 @@ dynamic extent of EXP." (call-with-repository directory (lambda (repository) exp ...))) +(define (load-git-submodules) + "Attempt to load (git submodules), which was missing until Guile-Git 0.2.0. +Return true on success, false on failure." + (match (false-if-exception (resolve-interface '(git submodule))) + (#f + (set! load-git-submodules (const #f)) + #f) + (iface + (module-use! (current-module) iface) + (set! load-git-submodules (const #t)) + #t))) + (define* (update-submodules repository #:key (log-port (current-error-port))) "Update the submodules of REPOSITORY, a Git repository object." ;; Guile-Git < 0.2.0 did not have (git submodule). - (if (false-if-exception (resolve-interface '(git submodule))) + (if (load-git-submodules) (for-each (lambda (name) (let ((submodule (submodule-lookup repository name))) (format log-port (G_ "updating submodule '~a'...~%") diff --git a/guix/lint.scm b/guix/lint.scm index 41ddff584d..e3544bd963 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -45,7 +45,8 @@ #:use-module (guix gnu-maintenance) #:use-module (guix cve) #:use-module ((guix swh) #:hide (origin?)) - #:autoload (guix git-download) (git-reference?) + #:autoload (guix git-download) (git-reference? + git-reference-url git-reference-commit) #:use-module (ice-9 match) #:use-module (ice-9 regex) #:use-module (ice-9 format) diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index a853ac6c7d..1ab3a80e66 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2013 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -45,8 +45,8 @@ #:use-module (srfi srfi-37) #:autoload (gnu packages) (specification->package %package-module-path) #:autoload (guix download) (download-to-store) - #:autoload (guix git-download) (git-reference?) - #:autoload (guix git) (git-checkout?) + #:autoload (guix git-download) (git-reference? git-reference-url) + #:autoload (guix git) (git-checkout? git-checkout-url) #:use-module ((guix status) #:select (with-status-verbosity)) #:use-module ((guix progress) #:select (current-terminal-columns)) #:use-module ((guix build syscalls) #:select (terminal-columns)) diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm index 3f20a2e192..31a05075b5 100644 --- a/guix/scripts/gc.scm +++ b/guix/scripts/gc.scm @@ -22,7 +22,7 @@ #:use-module (guix store) #:use-module (guix store roots) #:autoload (guix build syscalls) (free-disk-space) - #:autoload (guix profiles) (generation-profile) + #:autoload (guix profiles) (generation-profile profile-generations) #:autoload (guix scripts package) (delete-generations) #:use-module (ice-9 match) #:use-module (ice-9 regex) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index b84e37cbf2..c8d8546e29 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2015, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2017, 2018 Ricardo Wurmus ;;; Copyright © 2018 Konrad Hinsen ;;; Copyright © 2018 Chris Marusich @@ -29,7 +29,9 @@ #:use-module ((guix status) #:select (with-status-verbosity)) #:use-module ((guix self) #:select (make-config.scm)) #:use-module (guix grafts) - #:autoload (guix inferior) (inferior-package?) + #:autoload (guix inferior) (inferior-package? + inferior-package-name + inferior-package-version) #:use-module (guix monads) #:use-module (guix modules) #:use-module (guix packages) diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm index 8fb67f9268..71a349d2fe 100644 --- a/guix/scripts/publish.scm +++ b/guix/scripts/publish.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 David Thompson -;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -51,7 +51,9 @@ #:use-module (guix store) #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix zlib) - #:autoload (guix lzlib) (lzlib-available?) + #:autoload (guix lzlib) (lzlib-available? + call-with-lzip-output-port + make-lzip-output-port) #:use-module (guix cache) #:use-module (guix ui) #:use-module (guix scripts) diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 04cc51829d..cb1be989e1 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2017 Marius Bakke ;;; ;;; This file is part of GNU Guix. @@ -33,7 +33,9 @@ #:use-module (guix memoization) #:use-module (guix monads) #:use-module (guix channels) - #:autoload (guix inferior) (open-inferior) + #:autoload (guix inferior) (open-inferior + inferior-available-packages + close-inferior) #:use-module (guix scripts build) #:autoload (guix build utils) (which) #:use-module ((guix build syscalls) diff --git a/guix/utils.scm b/guix/utils.scm index 728039fbf0..3e8e59b8dc 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2013, 2014, 2015 Mark H Weaver ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2014 Ian Denhardt @@ -31,16 +31,13 @@ #:use-module (srfi srfi-26) #:use-module (srfi srfi-35) #:use-module (srfi srfi-39) - #:use-module (ice-9 binary-ports) #:use-module (ice-9 ftw) - #:autoload (rnrs io ports) (make-custom-binary-input-port) + #:use-module (rnrs io ports) ;need 'port-position' etc. #:use-module ((rnrs bytevectors) #:select (bytevector-u8-set!)) #:use-module (guix memoization) #:use-module ((guix build utils) #:select (dump-port mkdir-p delete-file-recursively)) #:use-module ((guix build syscalls) #:select (mkdtemp! fdatasync)) #:use-module (ice-9 format) - #:autoload (ice-9 popen) (open-pipe*) - #:autoload (ice-9 rdelim) (read-line) #:use-module (ice-9 regex) #:use-module (ice-9 match) #:use-module (ice-9 format) -- cgit v1.2.3 From 7a0836cffdfe3ab9ee899602f218277646959144 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 7 Jan 2020 10:35:02 +0100 Subject: More module autoload changes. This is a followup to 6a7c4636d4dec47eefa03c95da5a1315bd0e0413. * guix/scripts/build.scm: Adjust #:autoload clauses. * guix/scripts/gc.scm: Likewise. --- guix/scripts/build.scm | 4 ++-- guix/scripts/gc.scm | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index 1ab3a80e66..bf307d1421 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -43,10 +43,10 @@ #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (srfi srfi-37) - #:autoload (gnu packages) (specification->package %package-module-path) + #:use-module (gnu packages) #:autoload (guix download) (download-to-store) #:autoload (guix git-download) (git-reference? git-reference-url) - #:autoload (guix git) (git-checkout? git-checkout-url) + #:autoload (guix git) (git-checkout git-checkout? git-checkout-url) #:use-module ((guix status) #:select (with-status-verbosity)) #:use-module ((guix progress) #:select (current-terminal-columns)) #:use-module ((guix build syscalls) #:select (terminal-columns)) diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm index 31a05075b5..ab7c13315f 100644 --- a/guix/scripts/gc.scm +++ b/guix/scripts/gc.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2012, 2013, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,7 +22,9 @@ #:use-module (guix store) #:use-module (guix store roots) #:autoload (guix build syscalls) (free-disk-space) - #:autoload (guix profiles) (generation-profile profile-generations) + #:autoload (guix profiles) (generation-profile + profile-generations + generation-number) #:autoload (guix scripts package) (delete-generations) #:use-module (ice-9 match) #:use-module (ice-9 regex) -- cgit v1.2.3 From 058d0251bd14fdbb06ce223bbecc8eb1a0d74382 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 7 Jan 2020 11:45:56 +0100 Subject: download, git: Refer to the right module in 'module-use!' call. This fixes a regression introduced in 6a7c4636d4dec47eefa03c95da5a1315bd0e0413. * guix/build/download.scm (load-gnutls): Call 'resolve-module' instead of 'current-module'. * guix/git.scm (load-git-submodules): Likewise. --- guix/build/download.scm | 3 ++- guix/git.scm | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/build/download.scm b/guix/build/download.scm index 641dacefa1..0f2d5f402a 100644 --- a/guix/build/download.scm +++ b/guix/build/download.scm @@ -158,7 +158,8 @@ out if the connection could not be established in less than TIMEOUT seconds." (define (load-gnutls) ;; XXX: Use this hack instead of #:autoload to avoid compilation errors. ;; See . - (module-use! (current-module) (resolve-interface '(gnutls))) + (module-use! (resolve-module '(guix build download)) + (resolve-interface '(gnutls))) (set! load-gnutls (const #t))) (define %x509-certificate-directory diff --git a/guix/git.scm b/guix/git.scm index 15a0a6f9e5..a12f1eec8e 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -203,7 +203,7 @@ Return true on success, false on failure." (set! load-git-submodules (const #f)) #f) (iface - (module-use! (current-module) iface) + (module-use! (resolve-module '(guix git)) iface) (set! load-git-submodules (const #t)) #t))) -- cgit v1.2.3 From f98c050c2017be06cff54abf965a8234f6998f76 Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Wed, 8 Jan 2020 14:54:01 +0100 Subject: build: asdf-build-system: Make sbcl-* Lisp packages reproducible. The '*.fasl' files produced by SBCL contain the mtime of the source file (see commit 72843d7ce32bd615f64a0326cf891658b5724ead of SBCL's code repository). As asdf-build-system makes a copy of the source files before compiling them, we must set the mtime of these copies to the same date as the originals for the build to be reproducible. * guix/build/asdf-build-system.scm (copy-files-to-output): Keep the modification time of the original source files. --- guix/build/asdf-build-system.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/build/asdf-build-system.scm b/guix/build/asdf-build-system.scm index dd6373b33a..1be2b3c5f0 100644 --- a/guix/build/asdf-build-system.scm +++ b/guix/build/asdf-build-system.scm @@ -79,7 +79,7 @@ valid." (let ((source (getcwd)) (target (source-directory out name)) (system-path (string-append out %system-install-prefix))) - (copy-recursively source target) + (copy-recursively source target #:keep-mtime? #t) (mkdir-p system-path) (for-each (lambda (file) -- cgit v1.2.3 From 984efa2b6a561bf0eeb43be63f01e2d83b151aa5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 8 Jan 2020 19:28:48 +0100 Subject: build-system/clojure: Provide only the right modules in scope. Previously, we used to have a whole bunch of (guix build *-build-system) modules in scope, which, for example, meant that '%standard-phases' was clashing. This change clarifies it. * guix/build-system/clojure.scm (%default-modules): New variable. (clojure-build): Change the default value of #:modules and that of #:phases. --- guix/build-system/clojure.scm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/build-system/clojure.scm b/guix/build-system/clojure.scm index d70535c9e3..607f67aaec 100644 --- a/guix/build-system/clojure.scm +++ b/guix/build-system/clojure.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018 Alex Vong +;;; Copyright © 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -43,12 +44,18 @@ ;; Code: (define-with-docs %clojure-build-system-modules - "Build-side modules imported and used by default." + "Build-side modules imported by default." `((guix build clojure-build-system) (guix build clojure-utils) (guix build guile-build-system) ,@%ant-build-system-modules)) +(define %default-modules + ;; Modules in scope in the build-side environment. + '((guix build clojure-build-system) + (guix build clojure-utils) + (guix build utils))) + (define-with-docs %default-clojure "The default Clojure package." (delay (@* (gnu packages clojure) clojure))) @@ -133,15 +140,14 @@ (test-include `',%test-include) (test-exclude `',%test-exclude) - (phases '(@ (guix build clojure-build-system) - %standard-phases)) + (phases '%standard-phases) (outputs '("out")) (search-paths '()) (system (%current-system)) (guile #f) (imported-modules %clojure-build-system-modules) - (modules %clojure-build-system-modules)) + (modules %default-modules)) "Build SOURCE with INPUTS." (let ((builder `(begin (use-modules ,@modules) -- cgit v1.2.3 From bbd9063afcb204b3f81c59d09f5c54d3b67f1e91 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Thu, 9 Jan 2020 16:32:16 +0100 Subject: lint: Check for more packages which should be native. * guix/lint.scm (check-inputs-should-be-native): Add autoconf, automake, bison, dejagnu, desktop-file-utils, doxygen, flex, gettext, gobject-introspection, googletest-source, groff, help2man, libtool, swig, qmake, qttools, texinfo, xorg-server-for-tests, yelp-tools. --- guix/lint.scm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/lint.scm b/guix/lint.scm index e3544bd963..ed2f06bc64 100644 --- a/guix/lint.scm +++ b/guix/lint.scm @@ -286,11 +286,24 @@ of a package, and INPUT-NAMES, a list of package specifications such as (let ((inputs (package-inputs package)) (input-names '("pkg-config" + "autoconf" + "automake" + "bison" "cmake" + "dejagnu" + "desktop-file-utils" + "doxygen" "extra-cmake-modules" + "flex" + "gettext" "glib:bin" + "gobject-introspection" + "googletest-source" + "groff" + "help2man" "intltool" "itstool" + "libtool" "qttools" "yasm" "nasm" "fasm" "python-coverage" "python2-coverage" @@ -302,7 +315,13 @@ of a package, and INPUT-NAMES, a list of package specifications such as "python-pytest" "python2-pytest" "python-pytest-cov" "python2-pytest-cov" "python-setuptools-scm" "python2-setuptools-scm" - "python-sphinx" "python2-sphinx"))) + "python-sphinx" "python2-sphinx" + "swig" + "qmake" + "qttools" + "texinfo" + "xorg-server-for-tests" + "yelp-tools"))) (map (lambda (input) (make-warning package -- cgit v1.2.3 From f75243e17e3ff88582314bcb8450e654bb0b556b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 9 Jan 2020 11:21:31 +0100 Subject: channels: Provide a hint when the 'guix' channel is lacking. Fixes . Reported by Jesse Gibbons . * guix/channels.scm (channel-instance-derivations): Raise '&fix-hint' condition in addition to the '&message' condition. --- guix/channels.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/channels.scm b/guix/channels.scm index 826ee729ad..f0261dc2da 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2018, 2019 Ludovic Courtès +;;; Copyright © 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen ;;; @@ -36,7 +36,8 @@ #:use-module (guix i18n) #:use-module ((guix utils) #:select (source-properties->location - &error-location)) + &error-location + &fix-hint)) #:use-module (srfi srfi-1) #:use-module (srfi srfi-2) #:use-module (srfi srfi-9) @@ -457,6 +458,9 @@ INSTANCES." (raise (apply make-compound-condition (condition (&message (message "'guix' channel is lacking"))) + (condition + (&fix-hint (hint (G_ "Make sure your list of channels +contains one channel named @code{guix} providing the core of Guix.")))) (if loc (list (condition (&error-location (location loc)))) '()))))) -- cgit v1.2.3