guix-commits
[Top][All Lists]
Advanced

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

01/01: ui: 'load*' no longer fails on Guile 2.2.3 upon EACCES or similar


From: Ludovic Courtès
Subject: 01/01: ui: 'load*' no longer fails on Guile 2.2.3 upon EACCES or similar.
Date: Tue, 6 Mar 2018 04:50:51 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 7949c140b10184f82247ea10fbbb344ecd097924
Author: Ludovic Courtès <address@hidden>
Date:   Tue Mar 6 10:47:25 2018 +0100

    ui: 'load*' no longer fails on Guile 2.2.3 upon EACCES or similar.
    
    Previously, if ~/.cache was not write-accessible, 'guix' would exit with
    code 1 without printing any message.  That was because the 'make-stack'
    call would fail since the exception (a 'system-error) came from
    'compile-file', which was called at a point where TAG wasn't installed
    yet.  Secondly, to mimick auto-compilation behavior, we just swallow
    'system-error raised by 'compile-file'.
    
    Reported by Clément Lassieur.
    
    * guix/ui.scm (load*): Move 'compile-file' call in the dynamic extent of
    TAG.  Catch 'system-error around it and ignore it.
---
 guix/ui.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index 221bb82..a4943c2 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -204,9 +204,8 @@ messages."
       ;; avoid ABI breakage in the user's config file, we explicitly compile
       ;; it (the problem remains if the user's config is spread on several
       ;; modules.)  See <https://bugs.gnu.org/29881>.
-      (if (string=? (version) "2.2.3")
-          (compile-file file #:env user-module)
-          (set! %fresh-auto-compile #t))
+      (unless (string=? (version) "2.2.3")
+        (set! %fresh-auto-compile #t))
 
       (set! %load-should-auto-compile #t)
 
@@ -218,6 +217,12 @@ messages."
          (parameterize ((current-warning-port (%make-void-port "w")))
            (call-with-prompt tag
              (lambda ()
+               (when (string=? (version) "2.2.3")
+                 (catch 'system-error
+                   (lambda ()
+                     (compile-file file #:env user-module))
+                   (const #f)))              ;EACCES maybe, let's interpret it
+
                ;; Give 'load' an absolute file name so that it doesn't try to
                ;; search for FILE in %LOAD-PATH.  Note: use 'load', not
                ;; 'primitive-load', so that FILE is compiled, which then 
allows us



reply via email to

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