[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/11: lint: derivation: Adjust exception handling for Guile 3.
From: |
guix-commits |
Subject: |
02/11: lint: derivation: Adjust exception handling for Guile 3. |
Date: |
Fri, 17 Jan 2020 08:25:45 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit fd4c832bdbc4bc3e9479ad1bab6590d03ae78b60
Author: Ludovic Courtès <address@hidden>
AuthorDate: Fri Jan 17 11:23:34 2020 +0100
lint: derivation: Adjust exception handling for Guile 3.
This makes sure the "derivation: invalid arguments" test passes on
Guile 3.0.0. Without this change, the lint warning would only include
the format string instead of the key and arguments.
* guix/lint.scm (exception-with-kind-and-args?): New procedure.
(check-derivation): Use it.
---
guix/lint.scm | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/guix/lint.scm b/guix/lint.scm
index d2f24c6..697bd24 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -905,16 +905,31 @@ descriptions maintained upstream."
(origin-uris origin))
'())))
+(cond-expand
+ (guile-3
+ ;; Guile 3.0.0 does not export this predicate.
+ (define exception-with-kind-and-args?
+ (exception-predicate &exception-with-kind-and-args)))
+ (else ;Guile 2
+ (define exception-with-kind-and-args?
+ (const #f))))
+
(define (check-derivation package)
"Emit a warning if we fail to compile PACKAGE to a derivation."
(define (try system)
- (catch #t
+ (catch #t ;TODO: Remove 'catch' when Guile 2.x is no longer supported.
(lambda ()
(guard (c ((store-protocol-error? c)
(make-warning package
(G_ "failed to create ~a derivation: ~a")
(list system
(store-protocol-error-message c))))
+ ((exception-with-kind-and-args? c)
+ (make-warning package
+ (G_ "failed to create ~a derivation: ~s")
+ (list system
+ (cons (exception-kind c)
+ (exception-args c)))))
((message-condition? c)
(make-warning package
(G_ "failed to create ~a derivation: ~a")
- branch master updated (df18ea6 -> 05f8a14), guix-commits, 2020/01/17
- 01/11: packages: Prevent inlining of 'find-best-packages-by-name'., guix-commits, 2020/01/17
- 02/11: lint: derivation: Adjust exception handling for Guile 3.,
guix-commits <=
- 03/11: lint: vulnerabilities: Avoid 'mock' in test., guix-commits, 2020/01/17
- 04/11: doc: cookbook: Avoid URL reference to the manual., guix-commits, 2020/01/17
- 05/11: doc: Replace some invalid uses of @var with @code., guix-commits, 2020/01/17
- 06/11: import: opam: Avoid uses of '@@' in tests., guix-commits, 2020/01/17
- 09/11: gnu: Add imv., guix-commits, 2020/01/17
- 11/11: git-authenticate: Add new key for atheia., guix-commits, 2020/01/17
- 10/11: gnu: imv: Record the absolute file name of 'imv-x11' and 'imv-wayland'., guix-commits, 2020/01/17
- 07/11: import: texlive: Avoid uses of '@@' in tests., guix-commits, 2020/01/17
- 08/11: gnu: Add corsix-th., guix-commits, 2020/01/17