From de5cbd4a38a33e0412f1c481fe8e01a871dc13e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 29 Aug 2018 22:28:06 +0200 Subject: [PATCH] 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 # Now you get warnings and error reports as intended: warning: failed to load '(gnu tests install)': In procedure abi-check: : record ABI mismatch; recompilation needed warning: failed to load '(gnu tests ssh)': In procedure abi-check: : 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 da3ecdaaf8..1f11648e2c 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 ()