guix-commits
[Top][All Lists]
Advanced

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

01/03: build-system/gnu: 'strip' phase now skips symlinks.


From: Ludovic Courtès
Subject: 01/03: build-system/gnu: 'strip' phase now skips symlinks.
Date: Thu, 26 Jan 2017 21:09:40 +0000 (UTC)

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

commit 0363474a0b57067000ddd4b131cb31d7c70223fb
Author: Ludovic Courtès <address@hidden>
Date:   Thu Jan 26 11:27:11 2017 +0100

    build-system/gnu: 'strip' phase now skips symlinks.
    
    This avoids a situation where the "debug" output would contain separate
    (and different) .debug files for "libfoo.so" and "libfoo.so.0.0", even
    though "libfoo.so" is actually a symlink to "libfoo.so.0.0".
    
    * guix/build/gnu-build-system.scm (strip): Remove 'file-exists?' call in
    'for-each' lambda.  Pass a predicate to 'find-files' to restrict the
    result to regular files.
---
 guix/build/gnu-build-system.scm |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 59394c2..a19d2a3 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <address@hidden>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès 
<address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -389,8 +389,7 @@ makefiles."
               debug-output objcopy-command))
 
     (for-each (lambda (file)
-                (and (file-exists? file)          ;discard dangling symlinks
-                     (or (elf-file? file) (ar-file? file))
+                (and (or (elf-file? file) (ar-file? file))
                      (or (not debug-output)
                          (make-debug-file file))
                      ;; Ensure libraries are writable.
@@ -399,7 +398,12 @@ makefiles."
                                    (append strip-flags (list file))))
                      (or (not debug-output)
                          (add-debug-link file))))
-              (find-files dir)))
+              (find-files dir
+                          (lambda (file stat)
+                            ;; Ignore symlinks such as:
+                            ;; libfoo.so -> libfoo.so.0.0.
+                            (eq? 'regular (stat:type stat)))
+                          #:stat lstat)))
 
   (or (not strip-binaries?)
       (every strip-dir



reply via email to

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