From 4d52e0f66791250deae4890ac12a4789b1290a88 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 23 Jan 2020 15:34:41 +0100 Subject: compile: Remove incorrect exports. This is a followup to fed36328129def5f10b1d1f3e4ea8886916fd22a. * guix/build/compile.scm: Remove exports of '%lightweight-optimizations' and '%default-optimizations'. * guix/self.scm: Remove unused (guix build compile) module. --- guix/build/compile.scm | 6 ++---- guix/self.scm | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'guix') diff --git a/guix/build/compile.scm b/guix/build/compile.scm index 3781e148ce..4b6472784c 100644 --- a/guix/build/compile.scm +++ b/guix/build/compile.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2013, 2014, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer ;;; ;;; This file is part of GNU Guix. @@ -29,9 +29,7 @@ (define-module (guix build compile) #:use-module (guix build utils) #:use-module (language tree-il optimize) #:use-module (language cps optimize) - #:export (%default-optimizations - %lightweight-optimizations - compile-files)) + #:export (compile-files)) ;;; Commentary: ;;; diff --git a/guix/self.scm b/guix/self.scm index 207e80d842..f9015148d6 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -28,7 +28,6 @@ (define-module (guix self) #:use-module (guix sets) #:use-module (guix modules) #:use-module ((guix build utils) #:select (find-files)) - #:use-module ((guix build compile) #:select (%lightweight-optimizations)) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) #:use-module (srfi srfi-35) -- cgit v1.2.3 From 370891d5655a92eda596df5a03abed53511df386 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 23 Jan 2020 22:35:43 +0100 Subject: derivations: Inline 'find' in 'coalesce-duplicate-inputs'. Previously the first argument to 'find' would show up high in profiles of 'package-derivation'. This speeds things up a big, especially on Guile 3. * guix/derivations.scm (coalesce-duplicate-inputs)[find]: New procedure. --- guix/derivations.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/derivations.scm b/guix/derivations.scm index 480a65c78b..f6d6f7db25 100644 --- a/guix/derivations.scm +++ b/guix/derivations.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 © 2016, 2017 Mathieu Lirzin ;;; ;;; This file is part of GNU Guix. @@ -240,6 +240,13 @@ (define (coalesce-duplicate-inputs inputs) "Return a list of inputs, such that when INPUTS contains the same DRV twice, they are coalesced, with their sub-derivations merged. This is needed because Nix itself keeps only one of them." + (define (find pred lst) ;inlinable copy of 'find' + (let loop ((lst lst)) + (match lst + (() #f) + ((head . tail) + (if (pred head) head (loop tail)))))) + (fold (lambda (input result) (match input (($ (= derivation-file-name path) sub-drvs) -- cgit v1.2.3 From 8234fe653e61d0090138cbd4c48d877568355439 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 23 Jan 2020 22:43:17 +0100 Subject: self: Build with Guile 3.0. * guix/self.scm (specification->package): Return the "guile3.0-" variants. (guix-derivation): Change 'guile' to (specification->package "guile"). Pass "3.0" as #:guile-version. --- guix/self.scm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'guix') diff --git a/guix/self.scm b/guix/self.scm index f9015148d6..6b633f9bc0 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -48,13 +48,13 @@ (define specification->package (let ((ref (lambda (module variable) (module-ref (resolve-interface module) variable)))) (match-lambda - ("guile" (ref '(gnu packages commencement) 'guile-final)) - ("guile-json" (ref '(gnu packages guile) 'guile-json-3)) - ("guile-ssh" (ref '(gnu packages ssh) 'guile-ssh)) - ("guile-git" (ref '(gnu packages guile) 'guile-git)) - ("guile-sqlite3" (ref '(gnu packages guile) 'guile-sqlite3)) - ("guile-gcrypt" (ref '(gnu packages gnupg) 'guile-gcrypt)) - ("gnutls" (ref '(gnu packages tls) 'gnutls)) + ("guile" (ref '(gnu packages guile) 'guile-3.0)) + ("guile-json" (ref '(gnu packages guile) 'guile3.0-json)) + ("guile-ssh" (ref '(gnu packages ssh) 'guile3.0-ssh)) + ("guile-git" (ref '(gnu packages guile) 'guile3.0-git)) + ("guile-sqlite3" (ref '(gnu packages guile) 'guile3.0-sqlite3)) + ("guile-gcrypt" (ref '(gnu packages gnupg) 'guile3.0-gcrypt)) + ("gnutls" (ref '(gnu packages tls) 'guile3.0-gnutls)) ("zlib" (ref '(gnu packages compression) 'zlib)) ("lzlib" (ref '(gnu packages compression) 'lzlib)) ("gzip" (ref '(gnu packages compression) 'gzip)) @@ -1120,9 +1120,9 @@ (define (shorten version) version)) (define guile - ;; When PULL-VERSION >= 1, produce a self-contained Guix and use Guile 2.2 - ;; unconditionally. - (default-guile)) + ;; When PULL-VERSION >= 1, produce a self-contained Guix and use the + ;; current Guile unconditionally. + (specification->package "guile")) (when (and (< pull-version 1) (not (string=? (package-version guile) guile-version))) @@ -1141,7 +1141,7 @@ (define guile (shorten version)) #:pull-version pull-version #:guile-version (if (>= pull-version 1) - "2.2" guile-version) + "3.0" guile-version) #:guile-for-build guile))) (if guix (lower-object guix) -- cgit v1.2.3 From a07d5e558b5403dad0a59776b950b6b02169c249 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 24 Jan 2020 10:13:10 +0100 Subject: ui: Do not display error messages with bare format strings. On Guile 3, with, say, an error in ~/.guile, we'd get: $ guix repl guix repl: error: Unbound variable: ~S * guix/ui.scm (call-with-error-handling): Add '&exception-with-kind-and-args' case. --- guix/ui.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'guix') diff --git a/guix/ui.scm b/guix/ui.scm index 4857a88827..a47dafecd4 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -770,6 +770,17 @@ (define (manifest-entry-output* entry) (gettext (condition-message c) %gettext-domain)) (display-hint (condition-fix-hint c)) (exit 1)) + + ;; On Guile 3.0.0, exceptions such as 'unbound-variable' come are + ;; compound and include a '&message'. However, that message only + ;; contains the format string. Thus, special-case it here to + ;; avoid displaying a bare format string. + ((cond-expand + (guile-3 + ((exception-predicate &exception-with-kind-and-args) c)) + (else #f)) + (raise c)) + ((message-condition? c) ;; Normally '&message' error conditions have an i18n'd message. (leave (G_ "~a~%") -- cgit v1.2.3 From 09238d618a511de80de189ff3ff18bfa0f280bb9 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 24 Jan 2020 18:13:38 +0100 Subject: guix build, archive, graph: Disable absolute file port name canonicalization. This avoids an 'lstat' storm. Specifically: ./pre-inst-env strace -c guix build -nd libreoffice goes from 1,711 to 214 'lstat' calls. * guix/scripts/build.scm (options->things-to-build): When SPEC matches 'derivation-path?', call 'canonicalize-path'. (guix-build): Remove 'with-fluids' for %FILE-PORT-NAME-CANONICALIZATION. * guix/scripts/archive.scm (guix-archive): Remove 'with-fluids' for %FILE-PORT-NAME-CANONICALIZATION. * guix/scripts/graph.scm (guix-graph): Likewise. --- guix/scripts/archive.scm | 65 +++++++++++------------ guix/scripts/build.scm | 131 ++++++++++++++++++++++++----------------------- guix/scripts/graph.scm | 27 +++++----- 3 files changed, 109 insertions(+), 114 deletions(-) (limited to 'guix') diff --git a/guix/scripts/archive.scm b/guix/scripts/archive.scm index 2b4d39c7b8..4f39920fe7 100644 --- a/guix/scripts/archive.scm +++ b/guix/scripts/archive.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019, 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -371,36 +371,33 @@ (define (lines port) (cons line result))))) (with-error-handling - ;; Ask for absolute file names so that .drv file names passed from the - ;; user to 'read-derivation' are absolute when it returns. - (with-fluids ((%file-port-name-canonicalization 'absolute)) - (let ((opts (parse-command-line args %options (list %default-options)))) - (parameterize ((%graft? (assoc-ref opts 'graft?))) - (cond ((assoc-ref opts 'generate-key) - => - generate-key-pair) - ((assoc-ref opts 'authorize) - (authorize-key)) - (else - (with-status-verbosity (assoc-ref opts 'verbosity) - (with-store store - (set-build-options-from-command-line store opts) - (cond ((assoc-ref opts 'export) - (export-from-store store opts)) - ((assoc-ref opts 'import) - (import-paths store (current-input-port))) - ((assoc-ref opts 'missing) - (let* ((files (lines (current-input-port))) - (missing (remove (cut valid-path? store <>) - files))) - (format #t "~{~a~%~}" missing))) - ((assoc-ref opts 'list) - (list-contents (current-input-port))) - ((assoc-ref opts 'extract) - => - (lambda (target) - (restore-file (current-input-port) target))) - (else - (leave - (G_ "either '--export' or '--import' \ -must be specified~%"))))))))))))) + (let ((opts (parse-command-line args %options (list %default-options)))) + (parameterize ((%graft? (assoc-ref opts 'graft?))) + (cond ((assoc-ref opts 'generate-key) + => + generate-key-pair) + ((assoc-ref opts 'authorize) + (authorize-key)) + (else + (with-status-verbosity (assoc-ref opts 'verbosity) + (with-store store + (set-build-options-from-command-line store opts) + (cond ((assoc-ref opts 'export) + (export-from-store store opts)) + ((assoc-ref opts 'import) + (import-paths store (current-input-port))) + ((assoc-ref opts 'missing) + (let* ((files (lines (current-input-port))) + (missing (remove (cut valid-path? store <>) + files))) + (format #t "~{~a~%~}" missing))) + ((assoc-ref opts 'list) + (list-contents (current-input-port))) + ((assoc-ref opts 'extract) + => + (lambda (target) + (restore-file (current-input-port) target))) + (else + (leave + (G_ "either '--export' or '--import' \ +must be specified~%")))))))))))) diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index bf307d1421..f054fc2bce 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -809,7 +809,11 @@ (define (ensure-list x) (cond ((derivation-path? spec) (catch 'system-error (lambda () - (list (read-derivation-from-file spec))) + ;; Ask for absolute file names so that .drv file + ;; names passed from the user to 'read-derivation' + ;; are absolute when it returns. + (let ((spec (canonicalize-path spec))) + (list (read-derivation-from-file spec)))) (lambda args ;; Non-existent .drv files can be substituted down ;; the road, so don't error out. @@ -927,67 +931,64 @@ (define opts (list %default-options))) (with-error-handling - ;; Ask for absolute file names so that .drv file names passed from the - ;; user to 'read-derivation' are absolute when it returns. - (with-fluids ((%file-port-name-canonicalization 'absolute)) - (with-status-verbosity (assoc-ref opts 'verbosity) - (with-store store - ;; Set the build options before we do anything else. - (set-build-options-from-command-line store opts) - - (parameterize ((current-terminal-columns (terminal-columns))) - (let* ((mode (assoc-ref opts 'build-mode)) - (drv (options->derivations store opts)) - (urls (map (cut string-append <> "/log") - (if (assoc-ref opts 'substitutes?) - (or (assoc-ref opts 'substitute-urls) - ;; XXX: This does not necessarily match the - ;; daemon's substitute URLs. - %default-substitute-urls) - '()))) - (items (filter-map (match-lambda - (('argument . (? store-path? file)) - ;; If FILE is a .drv that's not in - ;; store, keep it so that it can be - ;; substituted. - (and (or (not (derivation-path? file)) - (not (file-exists? file))) - file)) - (_ #f)) - opts)) - (roots (filter-map (match-lambda - (('gc-root . root) root) - (_ #f)) - opts))) - - (unless (or (assoc-ref opts 'log-file?) - (assoc-ref opts 'derivations-only?)) - (show-what-to-build store drv - #:use-substitutes? - (assoc-ref opts 'substitutes?) - #:dry-run? (assoc-ref opts 'dry-run?) - #:mode mode)) - - (cond ((assoc-ref opts 'log-file?) - ;; Pass 'show-build-log' the output file names, not the - ;; derivation file names, because there can be several - ;; derivations leading to the same output. - (for-each (cut show-build-log store <> urls) - (delete-duplicates - (append (map derivation->output-path drv) - items)))) - ((assoc-ref opts 'derivations-only?) - (format #t "~{~a~%~}" (map derivation-file-name drv)) - (for-each (cut register-root store <> <>) - (map (compose list derivation-file-name) drv) - roots)) - ((not (assoc-ref opts 'dry-run?)) - (and (build-derivations store (append drv items) - mode) - (for-each show-derivation-outputs drv) - (for-each (cut register-root store <> <>) - (map (lambda (drv) - (map cdr - (derivation->output-paths drv))) - drv) - roots))))))))))) + (with-status-verbosity (assoc-ref opts 'verbosity) + (with-store store + ;; Set the build options before we do anything else. + (set-build-options-from-command-line store opts) + + (parameterize ((current-terminal-columns (terminal-columns))) + (let* ((mode (assoc-ref opts 'build-mode)) + (drv (options->derivations store opts)) + (urls (map (cut string-append <> "/log") + (if (assoc-ref opts 'substitutes?) + (or (assoc-ref opts 'substitute-urls) + ;; XXX: This does not necessarily match the + ;; daemon's substitute URLs. + %default-substitute-urls) + '()))) + (items (filter-map (match-lambda + (('argument . (? store-path? file)) + ;; If FILE is a .drv that's not in + ;; store, keep it so that it can be + ;; substituted. + (and (or (not (derivation-path? file)) + (not (file-exists? file))) + file)) + (_ #f)) + opts)) + (roots (filter-map (match-lambda + (('gc-root . root) root) + (_ #f)) + opts))) + + (unless (or (assoc-ref opts 'log-file?) + (assoc-ref opts 'derivations-only?)) + (show-what-to-build store drv + #:use-substitutes? + (assoc-ref opts 'substitutes?) + #:dry-run? (assoc-ref opts 'dry-run?) + #:mode mode)) + + (cond ((assoc-ref opts 'log-file?) + ;; Pass 'show-build-log' the output file names, not the + ;; derivation file names, because there can be several + ;; derivations leading to the same output. + (for-each (cut show-build-log store <> urls) + (delete-duplicates + (append (map derivation->output-path drv) + items)))) + ((assoc-ref opts 'derivations-only?) + (format #t "~{~a~%~}" (map derivation-file-name drv)) + (for-each (cut register-root store <> <>) + (map (compose list derivation-file-name) drv) + roots)) + ((not (assoc-ref opts 'dry-run?)) + (and (build-derivations store (append drv items) + mode) + (for-each show-derivation-outputs drv) + (for-each (cut register-root store <> <>) + (map (lambda (drv) + (map cdr + (derivation->output-paths drv))) + drv) + roots)))))))))) diff --git a/guix/scripts/graph.scm b/guix/scripts/graph.scm index 53f407b2fc..fca1e3777c 100644 --- a/guix/scripts/graph.scm +++ b/guix/scripts/graph.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2019 Simon Tournier ;;; ;;; This file is part of GNU Guix. @@ -552,20 +552,17 @@ (define type (read/eval-package-expression exp))) (_ #f)) opts))) - ;; Ask for absolute file names so that .drv file names passed from the - ;; user to 'read-derivation' are absolute when it returns. - (with-fluids ((%file-port-name-canonicalization 'absolute)) - (run-with-store store - ;; XXX: Since grafting can trigger unsolicited builds, disable it. - (mlet %store-monad ((_ (set-grafting #f)) - (nodes (mapm %store-monad - (node-type-convert type) - items))) - (export-graph (concatenate nodes) - (current-output-port) - #:node-type type - #:backend backend)) - #:system (assq-ref opts 'system)))))) + (run-with-store store + ;; XXX: Since grafting can trigger unsolicited builds, disable it. + (mlet %store-monad ((_ (set-grafting #f)) + (nodes (mapm %store-monad + (node-type-convert type) + items))) + (export-graph (concatenate nodes) + (current-output-port) + #:node-type type + #:backend backend)) + #:system (assq-ref opts 'system))))) #t) ;;; graph.scm ends here -- cgit v1.2.3 From 01e5d63c87b6b110f0632597e89a6a7476fc7d1c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 24 Jan 2020 22:39:47 +0100 Subject: serialization: 'read-byte-string' makes a single read(2) call. On "guix build libreoffice -nd", this reduces the number of read(2) system calls from 10,434 to 8092. * guix/serialization.scm (sub-bytevector): New procedure. (read-byte-string): Make a single 'get-bytevector-n*' call and use 'sub-bytevector'. --- guix/serialization.scm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/serialization.scm b/guix/serialization.scm index 9452303730..836ad06caf 100644 --- a/guix/serialization.scm +++ b/guix/serialization.scm @@ -27,6 +27,7 @@ (define-module (guix serialization) #:use-module ((ice-9 rdelim) #:prefix rdelim:) #:use-module (ice-9 match) #:use-module (ice-9 ftw) + #:use-module (system foreign) #:export (write-int read-int write-long-long read-long-long write-padding @@ -80,6 +81,17 @@ (define (get-bytevector-n* port count) (port port))))) bv)) +(define (sub-bytevector bv len) + "Return a bytevector that aliases the first LEN bytes of BV." + (define max (bytevector-length bv)) + (cond ((= len max) bv) + ((< len max) + ;; Yes, this is safe because the result of each conversion procedure + ;; has its life cycle synchronized with that of its argument. + (pointer->bytevector (bytevector->pointer bv) len)) + (else + (error "sub-bytevector called to get a super bytevector")))) + (define (write-int n p) (let ((b (make-bytevector 8 0))) (bytevector-u32-set! b 0 n (endianness little)) @@ -119,10 +131,9 @@ (define (write-string s p) (define (read-byte-string p) (let* ((len (read-int p)) (m (modulo len 8)) - (bv (get-bytevector-n* p len))) - (or (zero? m) - (get-bytevector-n* p (- 8 m))) - bv)) + (pad (if (zero? m) 0 (- 8 m))) + (bv (get-bytevector-n* p (+ len pad)))) + (sub-bytevector bv len))) (define (read-string p) (utf8->string (read-byte-string p))) -- cgit v1.2.3 From 1e8da4cdefb089ac7d2453d71f72924540238d87 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Thu, 23 Jan 2020 03:24:01 +0100 Subject: guix: ocaml: Also replace dune when relevant in package-with-explicit-ocaml. * guix/build-system/ocaml.scm (package-with-explicit-ocaml): Take a dune argument and add it to transformed packages when relevant. --- guix/build-system/ocaml.scm | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/build-system/ocaml.scm b/guix/build-system/ocaml.scm index de3e71a5aa..c5996bf0cf 100644 --- a/guix/build-system/ocaml.scm +++ b/guix/build-system/ocaml.scm @@ -92,7 +92,11 @@ (define (default-ocaml4.07-findlib) (let ((module (resolve-interface '(gnu packages ocaml)))) (module-ref module 'ocaml4.07-findlib))) -(define* (package-with-explicit-ocaml ocaml findlib old-prefix new-prefix +(define (default-ocaml4.07-dune) + (let ((module (resolve-interface '(gnu packages ocaml)))) + (module-ref module 'ocaml4.07-dune))) + +(define* (package-with-explicit-ocaml ocaml findlib dune old-prefix new-prefix #:key variant-property) "Return a procedure of one argument, P. The procedure creates a package with the same fields as P, which is assumed to use OCAML-BUILD-SYSTEM, such @@ -100,6 +104,10 @@ (define* (package-with-explicit-ocaml ocaml findlib old-prefix new-prefix recursively accordingly. If the name of P starts with OLD-PREFIX, this is replaced by NEW-PREFIX; otherwise, NEW-PREFIX is prepended to the name. +When the package uses the DUNE-BUILD-SYSTEM, the procedure creates a package +with the same fields as P, such that it is compiled with OCAML, FINDLIB and DUNE +instead. + When VARIANT-PROPERTY is present, it is used as a key to search for pre-defined variants of this transformation recorded in the 'properties' field of packages. The property value must be the promise of a package. This is a @@ -132,10 +140,15 @@ (define (transform p) name)))) (arguments (let ((ocaml (if (promise? ocaml) (force ocaml) ocaml)) - (findlib (if (promise? findlib) (force findlib) findlib))) + (findlib (if (promise? findlib) (force findlib) findlib)) + (dune (if (promise? dune) (force dune) dune))) (ensure-keyword-arguments (package-arguments p) `(#:ocaml ,ocaml - #:findlib ,findlib)))))) + #:findlib ,findlib + ,@(if (eq? (package-build-system p) + (default-dune-build-system)) + `(#:dune ,dune) + '()))))))) (else p))) (define (cut? p) @@ -148,6 +161,7 @@ (define (cut? p) (define package-with-ocaml4.07 (package-with-explicit-ocaml (delay (default-ocaml4.07)) (delay (default-ocaml4.07-findlib)) + (delay (default-ocaml4.07-dune)) "ocaml-" "ocaml4.07-" #:variant-property 'ocaml4.07-variant)) -- cgit v1.2.3 From a13db7e2ab05ee3ab9a42dd6a101130b8896fee0 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sat, 25 Jan 2020 21:39:04 +0200 Subject: build: cargo-build-system: Allow patched crates. * guix/build/cargo-build-system.scm (crate-src?): Don't check for a gzipped tarball, just make sure it's not a directory. --- guix/build/cargo-build-system.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm index 8a8d74ee1b..78c27a29e4 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2016 David Craven ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2019 Ivan Petkov -;;; Copyright © 2019 Efraim Flashner +;;; Copyright © 2019, 2020 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -58,7 +58,7 @@ (define (has-executable-target?) (define (crate-src? path) "Check if PATH refers to a crate source, namely a gzipped tarball with a Cargo.toml file present at its root." - (and (gzip-file? path) + (and (not (directory-exists? path)) ; not a tarball ;; First we print out all file names within the tarball to see if it ;; looks like the source of a crate. However, the tarball will include ;; an extra path component which we would like to ignore (since we're -- cgit v1.2.3 From 61b95c15cfb2c9b0d02cf09f93c0df76be0972b5 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 27 Jan 2020 09:17:32 +0200 Subject: build: cargo-build-system: Add pkg-config environment variables. * guix/build/cargo-build-system.scm (configure): Add environment variables to use system libgit2 and libssh2. * gnu/packages/crates-io.scm (rust-libgit2-sys-0.10, rust-libssh2-sys-0.2)[arguments]: Remove LIBGIT2 and LIBSSH2 environment variable settings. * gnu/packages/rust-apps.scm (tokei)[arguments]: Same. --- gnu/packages/crates-io.scm | 3 --- gnu/packages/rust-apps.scm | 4 +--- guix/build/cargo-build-system.scm | 2 ++ 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'guix') diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index 1099a25d87..a5f224f99e 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -5626,8 +5626,6 @@ (define-public rust-libgit2-sys-0.10 (lambda* (#:key inputs #:allow-other-keys) (let ((openssl (assoc-ref inputs "openssl"))) (setenv "OPENSSL_DIR" openssl)) - (setenv "LIBGIT2_SYS_USE_PKG_CONFIG" "1") - (setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "1") #t))))) (native-inputs `(("libgit2" ,libgit2) @@ -5734,7 +5732,6 @@ (define-public rust-libssh2-sys-0.2 (lambda* (#:key inputs #:allow-other-keys) (let ((openssl (assoc-ref inputs "openssl"))) (setenv "OPENSSL_DIR" openssl)) - (setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "1") #t))))) (native-inputs `(("libssh2" ,libssh2) diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index d9a672f777..90bd146442 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -143,9 +143,7 @@ (define-public tokei (add-after 'configure 'unvendor-libraries-from-crates (lambda* (#:key inputs #:allow-other-keys) (let ((openssl (assoc-ref inputs "openssl"))) - (setenv "OPENSSL_DIR" openssl) - (setenv "LIBGIT2_SYS_USE_PKG_CONFIG" "1") - (setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "1")) + (setenv "OPENSSL_DIR" openssl)) #t))))) (native-inputs `(("libgit2" ,libgit2) diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm index 78c27a29e4..0721989589 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -119,6 +119,8 @@ (define* (configure #:key inputs ;; upgrading the compiler for example. (setenv "RUSTFLAGS" "--cap-lints allow") (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) + (setenv "LIBGIT2_SYS_USE_PKG_CONFIG" "1") + (setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "1") ;; We don't use the Cargo.lock file to determine the package versions we use ;; during building, and in any case if one is not present it is created -- cgit v1.2.3 From 8377512e0c36146f55bde044e2f9b004c7482236 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Wed, 22 Jan 2020 13:29:34 +0100 Subject: guix: qt-build-system: Add phase `check-setup`. * guix/build/qt-build-system.scm (check-setup): New function. (%standard-phases): Add as new phase `check-setup before `check. * doc/guix.texi (Build System)[qt-build-system]: Describe the new phase. --- doc/guix.texi | 25 +++++++++++++++++++++---- guix/build/qt-build-system.scm | 14 +++++++++++++- 2 files changed, 34 insertions(+), 5 deletions(-) (limited to 'guix') diff --git a/doc/guix.texi b/doc/guix.texi index 3141c4582f..8cc824b917 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -47,7 +47,7 @@ Copyright @copyright{} 2017 Thomas Danckaert@* Copyright @copyright{} 2017 humanitiesNerd@* Copyright @copyright{} 2017 Christopher Allan Webber@* Copyright @copyright{} 2017, 2018, 2019 Marius Bakke@* -Copyright @copyright{} 2017, 2019 Hartmut Goebel@* +Copyright @copyright{} 2017, 2019, 2020 Hartmut Goebel@* Copyright @copyright{} 2017, 2019 Maxim Cournoyer@* Copyright @copyright{} 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice@* Copyright @copyright{} 2017 George Clemmer@* @@ -6447,10 +6447,24 @@ Which Perl package is used can be specified with @code{#:perl}. This variable is exported by @code{(guix build-system qt)}. It is intended for use with applications using Qt or KDE. -This build system adds the phase @code{qt-wrap} to the ones defined by -@code{cmake-build-system}, after the @code{install} phase. +This build system adds the following two phases to the ones defined by +@code{cmake-build-system}: -This phase searches for Qt5 plugin paths, QML paths and some XDG in the inputs +@table @code +@item check-setup +The phase @code{check-setup} prepares the environment for running +the checks as commonly used by Qt test programs. +For now this only sets some environment variables: +@code{QT_QPA_PLATFORM=offscreen}, +@code{DBUS_FATAL_WARNINGS=0} and +@code{CTEST_OUTPUT_ON_FAILURE=1}. + +This phase is added before the @code{check} phase. +It's a separate phase to ease adjusting if necessary. + +@item qt-wrap +The phase @code{qt-wrap} +searches for Qt5 plugin paths, QML paths and some XDG in the inputs and output. In case some path is found, all programs in the output's @file{bin/}, @file{sbin/}, @file{libexec/} and @file{lib/libexec/} directories are wrapped in scripts defining the necessary environment variables. @@ -6460,6 +6474,9 @@ by listing their names in the @code{#:qt-wrap-excluded-outputs} parameter. This is useful when an output is known not to contain any Qt binaries, and where wrapping would gratuitously add a dependency of that output on Qt, KDE, or such. + +This phase is added after the @code{install} phase. +@end table @end defvr @defvr {Scheme Variable} r-build-system diff --git a/guix/build/qt-build-system.scm b/guix/build/qt-build-system.scm index be2b808901..005157b0a4 100644 --- a/guix/build/qt-build-system.scm +++ b/guix/build/qt-build-system.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2014 Federico Beffa ;;; Copyright © 2014, 2015 Ludovic Courtès ;;; Copyright © 2018 Mark H Weaver -;;; Copyright © 2019 Hartmut Goebel +;;; Copyright © 2019, 2020 Hartmut Goebel ;;; ;;; This file is part of GNU Guix. ;;; @@ -36,6 +36,17 @@ (define-module (guix build qt-build-system) ;; ;; Code: +(define* (check-setup #:rest args) + ;; Make Qt render "offscreen". In many cases this allows to run tests + ;; without starting a X11 server. + (setenv "QT_QPA_PLATFORM" "offscreen") + ;; Qt/KDE tests often need dbus (`dbus-launch …`) which is not fully + ;; set-up the the build container. + (setenv "DBUS_FATAL_WARNINGS" "0") + ;; Set here to ease overwriting 'check (even if set there, too) + (setenv "CTEST_OUTPUT_ON_FAILURE" "1") + #t) + (define (variables-for-wrapping base-directories) (define (collect-sub-dirs base-directories subdirectory) @@ -101,6 +112,7 @@ (define handle-output (define %standard-phases (modify-phases cmake:%standard-phases + (add-before 'check 'check-setup check-setup) (add-after 'install 'qt-wrap wrap-all-programs))) (define* (qt-build #:key inputs (phases %standard-phases) -- cgit v1.2.3 From 4968ea2c9279389d3b2f427dec29d07f1031784c Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Fri, 17 Jan 2020 22:18:29 +0100 Subject: Use HTTPS for liballeg.org. * gnu/packages/game-development.scm (allegro-4, allegro)[home-page]: Use HTTPS. * guix/licenses.scm (giftware): Likewise. --- gnu/packages/game-development.scm | 4 ++-- guix/licenses.scm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index 13006f3509..5160bcf2ea 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm @@ -723,7 +723,7 @@ (define-public allegro-4 multimedia programming. It handles common, low-level tasks such as creating windows, accepting user input, loading data, drawing images, playing sounds, etc.") - (home-page "http://liballeg.org") + (home-page "https://liballeg.org") (license license:giftware))) (define-public allegro @@ -764,7 +764,7 @@ (define-public allegro multimedia programming. It handles common, low-level tasks such as creating windows, accepting user input, loading data, drawing images, playing sounds, etc.") - (home-page "http://liballeg.org") + (home-page "https://liballeg.org") (license license:bsd-3))) (define-public allegro-5.0 diff --git a/guix/licenses.scm b/guix/licenses.scm index 41d4fefad2..a44a5bac0d 100644 --- a/guix/licenses.scm +++ b/guix/licenses.scm @@ -286,7 +286,7 @@ (define freetype (define giftware (license "Giftware" - "http://liballeg.org/license.html" + "https://liballeg.org/license.html" "The Allegro 4 license")) (define gpl1 -- cgit v1.2.3