summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/scripts/lint.scm54
-rw-r--r--tests/lint.scm4
2 files changed, 32 insertions, 26 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index e477bf0ddc..e8cf2dc1ff 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -774,30 +774,36 @@ descriptions maintained upstream."
(define (check-derivation package)
"Emit a warning if we fail to compile PACKAGE to a derivation."
- (catch #t
- (lambda ()
- (guard (c ((nix-protocol-error? c)
- (emit-warning package
- (format #f (G_ "failed to create derivation: ~a")
- (nix-protocol-error-message c))))
- ((message-condition? c)
- (emit-warning package
- (format #f (G_ "failed to create derivation: ~a")
- (condition-message c)))))
- (with-store store
- ;; Disable grafts since it can entail rebuilds.
- (package-derivation store package #:graft? #f)
-
- ;; If there's a replacement, make sure we can compute its
- ;; derivation.
- (match (package-replacement package)
- (#f #t)
- (replacement
- (package-derivation store replacement #:graft? #f))))))
- (lambda args
- (emit-warning package
- (format #f (G_ "failed to create derivation: ~s~%")
- args)))))
+ (define (try system)
+ (catch #t
+ (lambda ()
+ (guard (c ((nix-protocol-error? c)
+ (emit-warning package
+ (format #f (G_ "failed to create ~a derivation: ~a")
+ system
+ (nix-protocol-error-message c))))
+ ((message-condition? c)
+ (emit-warning package
+ (format #f (G_ "failed to create ~a derivation: ~a")
+ system
+ (condition-message c)))))
+ (with-store store
+ ;; Disable grafts since it can entail rebuilds.
+ (package-derivation store package system #:graft? #f)
+
+ ;; If there's a replacement, make sure we can compute its
+ ;; derivation.
+ (match (package-replacement package)
+ (#f #t)
+ (replacement
+ (package-derivation store replacement system
+ #:graft? #f))))))
+ (lambda args
+ (emit-warning package
+ (format #f (G_ "failed to create ~a derivation: ~s")
+ system args)))))
+
+ (for-each try (package-supported-systems package)))
(define (check-license package)
"Warn about type errors of the 'license' field of PACKAGE."
diff --git a/tests/lint.scm b/tests/lint.scm
index ab0e8b9a8c..300153e24e 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
@@ -365,7 +365,7 @@
(arguments
'(#:imported-modules (invalid-module))))))
(check-derivation pkg)))
- "failed to create derivation")))
+ "failed to create")))
(test-assert "license: invalid license"
(string-contains