[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/03: records: Adjust 'record-abi-mismatch-error' arguments.
From: |
Ludovic Courtès |
Subject: |
01/03: records: Adjust 'record-abi-mismatch-error' arguments. |
Date: |
Wed, 29 Aug 2018 17:32:08 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit de5cbd4a38a33e0412f1c481fe8e01a871dc13e5
Author: Ludovic Courtès <address@hidden>
Date: Wed Aug 29 22:28:06 2018 +0200
records: Adjust 'record-abi-mismatch-error' arguments.
Previously, 'display-error' (as used by 'warn-about-load-error', for
instance) would be called with a wrong number of arguments when a
'record-abi-mismatch-error' was caught:
warning: failed to load '(gnu tests install)':
Backtrace:
[...]
ERROR: In procedure display-error:
Wrong number of arguments to #<procedure display-error (_ _ _ _ _ _)>
Now you get warnings and error reports as intended:
warning: failed to load '(gnu tests install)':
In procedure abi-check: <openssh-configuration>: record ABI mismatch;
recompilation needed
warning: failed to load '(gnu tests ssh)':
In procedure abi-check: <openssh-configuration>: record ABI mismatch;
recompilation needed
* guix/records.scm (print-record-abi-mismatch-error): Remove.
Remove top-level call to 'set-exception-printer!'.
(abi-check): Use arguments as expected by 'display-error'.
---
guix/records.scm | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/guix/records.scm b/guix/records.scm
index da3ecda..1f11648 100644
--- a/guix/records.scm
+++ b/guix/records.scm
@@ -52,17 +52,6 @@
((weird _ ...) ;weird!
(syntax-violation name "invalid field specifier" #'weird)))))
-(define (print-record-abi-mismatch-error port key args
- default-printer)
- (match args
- ((rtd . _)
- ;; The source file where this exception is thrown must be recompiled.
- (format port "ERROR: ~a: record ABI mismatch; recompilation needed"
- rtd))))
-
-(set-exception-printer! 'record-abi-mismatch-error
- print-record-abi-mismatch-error)
-
(eval-when (expand load eval)
;; The procedures below are needed both at run time and at expansion time.
@@ -81,7 +70,11 @@
interface\" (ABI) for TYPE is equal to COOKIE."
(with-syntax ((current-abi (current-abi-identifier type)))
#`(unless (eq? current-abi #,cookie)
- (throw 'record-abi-mismatch-error #,type)))))
+ ;; The source file where this exception is thrown must be
+ ;; recompiled.
+ (throw 'record-abi-mismatch-error 'abi-check
+ "~a: record ABI mismatch; recompilation needed"
+ '(#,type) '())))))
(define-syntax make-syntactic-constructor
(syntax-rules ()