From 2f93e1682a02d76c59762ffaa99ee2abe4dea928 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 8 Apr 2024 21:47:29 +0200 Subject: records: Do not inline throws for ABI mismatches. * guix/records.scm (record-abi-mismatch-error): New procedure. (abi-check): Use it. Change-Id: I49936599716e117b8fbf26fb9d8f462bbbb8e88b --- guix/records.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/records.scm b/guix/records.scm index f4d12a861d..48637ea0a4 100644 --- a/guix/records.scm +++ b/guix/records.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012-2023 Ludovic Courtès +;;; Copyright © 2012-2024 Ludovic Courtès ;;; Copyright © 2018 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -61,6 +61,11 @@ (define (current-abi-identifier type) (string-append "% " (symbol->string type-name) " abi-cookie"))))) + (define (record-abi-mismatch-error type) + (throw 'record-abi-mismatch-error 'abi-check + "~a: record ABI mismatch; recompilation needed" + (list type) '())) + (define (abi-check type cookie) "Return syntax that checks that the current \"application binary interface\" (ABI) for TYPE is equal to COOKIE." @@ -68,9 +73,7 @@ (define (abi-check type cookie) #`(unless (eq? current-abi #,cookie) ;; The source file where this exception is thrown must be ;; recompiled. - (throw 'record-abi-mismatch-error 'abi-check - "~a: record ABI mismatch; recompilation needed" - (list #,type) '())))) + (record-abi-mismatch-error #,type)))) (define* (report-invalid-field-specifier name bindings #:optional parent-form) -- cgit v1.2.3