summary refs log tree commit diff
path: root/guix/ui.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-05-26 22:30:31 +0200
committerLudovic Courtès <ludo@gnu.org>2021-06-01 23:26:07 +0200
commit82d8ab01f5cb6d479e3b82c08067e2442ee7cad8 (patch)
treeff54647ca08ed54f418a9ebdaaae721ad3baf1c1 /guix/ui.scm
parent49b15701adb758f89bdf4f36f3220851d744c817 (diff)
downloadguix-82d8ab01f5cb6d479e3b82c08067e2442ee7cad8.tar.gz
maint: Require Guile 3.0.
* configure.ac: Require Guile 3.0.
* doc/guix.texi (Requirements): Adjust accordingly.
* gnu/packages/package-management.scm (guile2.2-guix): Remove.
* guix/lint.scm (exception-with-kind-and-args?): Remove 'cond-expand'.
* guix/scripts/deploy.scm (deploy-machine*): Likewise.
* guix/store.scm (call-with-store): Likewise.
* guix/swh.scm (http-get*, http-post*): Likewise.
* guix/ui.scm (without-compiler-optimizations, guard*)
(call-with-error-handling): Likewise.
Diffstat (limited to 'guix/ui.scm')
-rw-r--r--guix/ui.scm46
1 files changed, 16 insertions, 30 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index 05b3f5f84c..6b0155f563 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -196,17 +196,11 @@ information, or #f if it could not be found."
                            (stack-ref stack 1)    ;skip the 'throw' frame
                            last))))
 
-(cond-expand
-  (guile-3
-   (define-syntax-rule (without-compiler-optimizations exp)
-     ;; Compile with the baseline compiler (-O1), which is much less expensive
-     ;; than -O2.
-     (parameterize (((@ (system base compile) default-optimization-level) 1))
-       exp)))
-  (else
-   (define-syntax-rule (without-compiler-optimizations exp)
-     ;; No easy way to turn off optimizations on Guile 2.2.
-     exp)))
+(define-syntax-rule (without-compiler-optimizations exp)
+  ;; Compile with the baseline compiler (-O1), which is much less expensive
+  ;; than -O2.
+  (parameterize (((@ (system base compile) default-optimization-level) 1))
+    exp))
 
 (define* (load* file user-module
                 #:key (on-error 'nothing-special))
@@ -674,22 +668,17 @@ or variants of @code{~a} in the same profile.")
 or remove one of them from the profile.")
                               name1 name2)))))
 
-(cond-expand
-  (guile-3
-   ;; On Guile 3.0, in 'call-with-error-handling' we need to re-raise.  To
-   ;; preserve useful backtraces in case of unhandled errors, we want that to
-   ;; happen before the stack has been unwound, hence 'guard*'.
-   (define-syntax-rule (guard* (var clauses ...) exp ...)
-     "This variant of SRFI-34 'guard' does not unwind the stack before
+;; On Guile 3.0, in 'call-with-error-handling' we need to re-raise.  To
+;; preserve useful backtraces in case of unhandled errors, we want that to
+;; happen before the stack has been unwound, hence 'guard*'.
+(define-syntax-rule (guard* (var clauses ...) exp ...)
+  "This variant of SRFI-34 'guard' does not unwind the stack before
 evaluating the tests and bodies of CLAUSES."
-     (with-exception-handler
-         (lambda (var)
-           (cond clauses ... (else (raise var))))
-       (lambda () exp ...)
-       #:unwind? #f)))
-  (else
-   (define-syntax-rule (guard* (var clauses ...) exp ...)
-     (guard (var clauses ...) exp ...))))
+  (with-exception-handler
+      (lambda (var)
+        (cond clauses ... (else (raise var))))
+    (lambda () exp ...)
+    #:unwind? #f))
 
 (define (call-with-error-handling thunk)
   "Call THUNK within a user-friendly error handler."
@@ -822,10 +811,7 @@ directories:~{ ~a~}~%")
              ;; Furthermore, use of 'guard*' ensures that the stack has not
              ;; been unwound when we re-raise, since that would otherwise show
              ;; useless backtraces.
-             ((cond-expand
-                (guile-3
-                 ((exception-predicate &exception-with-kind-and-args) c))
-                (else #f))
+             (((exception-predicate &exception-with-kind-and-args) c)
               (raise c))
 
              ((message-condition? c)