guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Ludovic Courtès
Date: Tue, 9 May 2023 10:28:16 -0400 (EDT)

branch: master
commit 642911f50540167bce5666922bb9eb074484e442
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue May 9 11:21:17 2023 +0200

    base: Remove now unnecessary 'with-store' replacement.
    
    This 'with-store' macro has become unnecessary since Guix commit
    8ed597f4a261fe188de82cd1f5daed83dba948eb, which changes its own
    'with-store' macro to not rely on 'dynamic-wind'.
    
    Furthermore, this definition of 'unwind-protect' would rewrap SRFI-34
    exceptions on Guile 3.0 in something like this:
    
      #<&compound-exception components: (#<&error> #<&irritants irritants: 
(#<&evaluation-error name: "shepherd" id: 26>)> #<&exception-with-kind-and-args 
kind: %exception args: (#<&evaluation-error name: "shepherd" id: 26>)>)>
    
    The 'error?' and 'evaluation-error?' predicates would return #f for
    these things, thereby leaving an uncaught exception in the fiber calling
    'process-specs'.
    
    * src/cuirass/base.scm (with-store): Remove.
    * src/cuirass/utils.scm (unwind-protect): Remove.
---
 src/cuirass/base.scm  | 22 ----------------------
 src/cuirass/utils.scm | 20 --------------------
 2 files changed, 42 deletions(-)

diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index 382e51e..ff1cc2c 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -86,28 +86,6 @@
             %use-substitutes?
             %fallback?))
 
-(define-syntax-rule (with-store store exp ...)
-  ;; XXX: This is a 'with-store' variant that plays well with delimited
-  ;; continuations and fibers.  The 'with-store' macro in (guix store)
-  ;; currently closes in a 'dynamic-wind' handler, which means it would close
-  ;; the store at each context switch.  Remove this when the real 'with-store'
-  ;; has been fixed.
-  (let ((store (open-connection)))
-    (unwind-protect
-     ;; Always set #:keep-going? so we don't stop on the first build failure.
-     ;; Set #:print-build-trace explicitly to make sure 'process-build-log'
-     ;; sees build events; set #:build-verbosity 1 so that we don't receive
-     ;; output from the builders (that is, we only get build traces, nothing
-     ;; more), which in turn makes sure we can correctly process build traces.
-     (set-build-options store
-                        #:use-substitutes? (%use-substitutes?)
-                        #:fallback? (%fallback?)
-                        #:keep-going? #t
-                        #:print-build-trace #t
-                        #:build-verbosity 1)
-     exp ...
-     (close-connection store))))
-
 (define %build-remote?
   ;; Define whether to use the remote build mechanism.
   (make-parameter #f))
diff --git a/src/cuirass/utils.scm b/src/cuirass/utils.scm
index eca214b..ee5245c 100644
--- a/src/cuirass/utils.scm
+++ b/src/cuirass/utils.scm
@@ -40,7 +40,6 @@
             object->json-scm
             object->json-string
             define-enumeration
-            unwind-protect
 
             with-timeout
             get-message-with-timeout
@@ -92,25 +91,6 @@ value."
       ((_ symbol) value)
       ...)))
 
-(define-syntax-rule (unwind-protect body ... conclude)
-  "Evaluate BODY... and return its result(s), but always evaluate CONCLUDE
-before leaving, even if an exception is raised.
-
-This is *not* implemented with 'dynamic-wind' in order to play well with
-delimited continuations and fibers."
-  (let ((conclusion (lambda () conclude)))
-    (catch #t
-      (lambda ()
-        (call-with-values
-            (lambda ()
-              body ...)
-          (lambda results
-            (conclusion)
-            (apply values results))))
-      (lambda args
-        (conclusion)
-        (apply throw args)))))
-
 (define %worker-thread-args
   (make-parameter #f))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]