From f8bcf1935a18e9a728e824030b3ded4fb63638cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 24 Nov 2014 22:45:41 +0100 Subject: [PATCH] build-system/gnu: Gracefully handle dangling symlinks in the 'strip' phase. * guix/build/gnu-build-system.scm (strip): Check whether 'file-exists?' before calling 'elf-file?' and 'ar-file?'. This should fix build failures in the presence of dangling symlinks, as in . --- guix/build/gnu-build-system.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index dbbb71af35..e42a6cc48b 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -343,7 +343,8 @@ (define (strip-dir dir) debug-output objcopy-command)) (file-system-fold (const #t) (lambda (path stat result) ; leaf - (and (or (elf-file? path) (ar-file? path)) + (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