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: Fri, 1 Sep 2023 12:06:07 -0400 (EDT)

branch: master
commit 2ee6dc6947664e7f34ce526d1997985d0a2c0cf5
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Sep 1 16:59:22 2023 +0200

    base: 'create-build-outputs' catches 'register-gc-root' errors.
    
    Commit 9e897d84edb403aab68afb662f1331d161a7cd22 would lead the
    "set-build-successful!" test to fail when running in build environments:
    
      In procedure symlink: No such file or directory: 
"/var/guix/gcroots/profiles/per-user/nixbld/cuirass/source"
    
    This fixes this regression.
    
    * src/cuirass/base.scm (create-build-outputs): Wrap 'register-gc-root'
    in 'catch'.
---
 src/cuirass/base.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index 097d9fc..b53a494 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -564,7 +564,17 @@ OUTPUTS, a list of <build-output> records."
                                (find-product build build-output))))
                 (when (and file (file-exists? file))
                   (log-info "Adding build product ~a" file)
-                  (register-gc-root file)
+                  (catch 'system-error
+                    (lambda ()
+                      (register-gc-root file))
+                    (lambda args
+                      ;; This might be ENOENT, for instance because
+                      ;; /var/guix/gcroots/profiles is missing, as is the case
+                      ;; in build environments.
+                      (log-warning
+                       "failed to create GC root for '~a' (build '~a'): ~a"
+                       file (build-nix-name build)
+                       (strerror (system-error-errno args)))))
                   (db-add-build-product
                    (build-product
                     (build-id (build-id build))



reply via email to

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