From 0363474a0b57067000ddd4b131cb31d7c70223fb Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 26 Jan 2017 11:27:11 +0100 Subject: 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(-) (limited to 'guix/build/gnu-build-system.scm') diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 59394c2cac..a19d2a3e96 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 +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -389,8 +389,7 @@ (define (strip-dir dir) 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 @@ (define (strip-dir dir) (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 -- cgit v1.2.3