guix-commits
[Top][All Lists]
Advanced

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

02/02: build-system/gnu: Tolerate errors during the 'strip' phase.


From: Mark H. Weaver
Subject: 02/02: build-system/gnu: Tolerate errors during the 'strip' phase.
Date: Fri, 16 Mar 2018 20:08:07 -0400 (EDT)

mhw pushed a commit to branch core-updates
in repository guix.

commit 99aaeaa00bd3d5964fc5a723f52c2baf3f3d2974
Author: Mark H Weaver <address@hidden>
Date:   Fri Mar 16 18:33:52 2018 -0400

    build-system/gnu: Tolerate errors during the 'strip' phase.
    
    This is a followup to commit 9a87649c863e1ff8b073b356875eb05eecedbcf7.
    
    * guix/build/gnu-build-system.scm (strip)[strip-dir]: If an invoke error
    occurs, issue a warning and continue to the next file.  This restores the
    tolerance of stripping errors prior to commit 9a87649.
---
 guix/build/gnu-build-system.scm | 35 ++++++++++++++++++++++++-----------
 1 file changed, 24 insertions(+), 11 deletions(-)

diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 18d76a3..8fe6fa8 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -27,6 +27,8 @@
   #:use-module (ice-9 format)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-19)
+  #:use-module (srfi srfi-34)
+  #:use-module (srfi srfi-35)
   #:use-module (srfi srfi-26)
   #:use-module (rnrs io ports)
   #:export (%standard-phases
@@ -437,17 +439,28 @@ makefiles."
 
     (for-each (lambda (file)
                 (when (or (elf-file? file) (ar-file? file))
-                  (when debug-output
-                    (make-debug-file file))
-
-                  ;; Ensure the file is writable.
-                  (make-file-writable file)
-
-                  (apply invoke strip-command
-                         (append strip-flags (list file)))
-
-                  (when debug-output
-                    (add-debug-link file))))
+                  ;; If an error occurs while processing a file, issue a
+                  ;; warning and continue to the next file.
+                  (guard (c ((invoke-error? c)
+                             (format (current-error-port)
+                                     "warning: ~a: program ~s exited\
address@hidden with non-zero exit status ~a~]\
address@hidden terminated by signal ~a~]~%"
+                                     file
+                                     (invoke-error-program c)
+                                     (invoke-error-exit-status c)
+                                     (invoke-error-term-signal c))))
+                    (when debug-output
+                      (make-debug-file file))
+
+                    ;; Ensure the file is writable.
+                    (make-file-writable file)
+
+                    (apply invoke strip-command
+                           (append strip-flags (list file)))
+
+                    (when debug-output
+                      (add-debug-link file)))))
               (find-files dir
                           (lambda (file stat)
                             ;; Ignore symlinks such as:



reply via email to

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