[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: build-system/gnu: 'strip' phase lists files in sorted order.
From: |
Ludovic Courtès |
Subject: |
01/01: build-system/gnu: 'strip' phase lists files in sorted order. |
Date: |
Thu, 1 Sep 2016 21:57:10 +0000 (UTC) |
civodul pushed a commit to branch core-updates
in repository guix.
commit ff43e353a1920a47a763024cd0682f2dc805964b
Author: Ludovic Courtès <address@hidden>
Date: Thu Sep 1 23:48:08 2016 +0200
build-system/gnu: 'strip' phase lists files in sorted order.
This fixes a bug whereby the choice between stripping 'libfoo.so.0.1.2'
and stripping 'libfoo.so' (the symlink) would be non-deterministic.
* guix/build/gnu-build-system.scm (strip)[strip-dir]: Use 'find-files'
instead of 'file-system-fold' so that files are picked in deterministic
order.
---
guix/build/gnu-build-system.scm | 31 +++++++++++--------------------
1 file changed, 11 insertions(+), 20 deletions(-)
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 34edff7..ab97c92 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -386,26 +386,17 @@ makefiles."
(when debug-output
(format #t "debugging output written to ~s using ~s~%"
debug-output objcopy-command))
- (file-system-fold (const #t)
- (lambda (path stat result) ; leaf
- (and (file-exists? path) ;discard dangling symlinks
- (or (elf-file? path) (ar-file? path))
- (or (not debug-output)
- (make-debug-file path))
- (zero? (apply system* strip-command
- (append strip-flags (list path))))
- (or (not debug-output)
- (add-debug-link path))))
- (const #t) ; down
- (const #t) ; up
- (const #t) ; skip
- (lambda (path stat errno result)
- (format (current-error-port)
- "strip: failed to access `~a': ~a~%"
- path (strerror errno))
- #f)
- #t
- dir))
+
+ (for-each (lambda (file)
+ (and (file-exists? file) ;discard dangling symlinks
+ (or (elf-file? file) (ar-file? file))
+ (or (not debug-output)
+ (make-debug-file file))
+ (zero? (apply system* strip-command
+ (append strip-flags (list file))))
+ (or (not debug-output)
+ (add-debug-link file))))
+ (find-files dir)))
(or (not strip-binaries?)
(every strip-dir