From bfd522da633bd904918a939b29f0a0ebb594fa6b Mon Sep 17 00:00:00 2001 From: Guillaume Maudoux Date: Thu, 12 May 2016 12:18:59 +0200 Subject: [PATCH] setup-hooks: do not pass missing dirs to find (close #15405) find fails when called with an inexistent search path. That situation may arise when the output is created after by a postFixup hook. vcunat amended the PR by clarifying one more `return` to `return 0`. --- pkgs/build-support/setup-hooks/separate-debug-info.sh | 4 +++- pkgs/development/tools/misc/patchelf/setup-hook.sh | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/setup-hooks/separate-debug-info.sh b/pkgs/build-support/setup-hooks/separate-debug-info.sh index 518be964733..c90d2cd5201 100644 --- a/pkgs/build-support/setup-hooks/separate-debug-info.sh +++ b/pkgs/build-support/setup-hooks/separate-debug-info.sh @@ -6,8 +6,10 @@ dontStrip=1 fixupOutputHooks+=(_separateDebugInfo) _separateDebugInfo() { + [ -e "$prefix" ] || return 0 + local dst="${debug:-$out}" - if [ "$prefix" = "$dst" ]; then return; fi + if [ "$prefix" = "$dst" ]; then return 0; fi dst="$dst/lib/debug/.build-id" diff --git a/pkgs/development/tools/misc/patchelf/setup-hook.sh b/pkgs/development/tools/misc/patchelf/setup-hook.sh index 563ef57fce1..bc1cddd4879 100644 --- a/pkgs/development/tools/misc/patchelf/setup-hook.sh +++ b/pkgs/development/tools/misc/patchelf/setup-hook.sh @@ -6,6 +6,8 @@ fixupOutputHooks+=('if [ -z "$dontPatchELF" ]; then patchELF "$prefix"; fi') patchELF() { local dir="$1" + [ -e "$dir" ] || return 0 + header "shrinking RPATHs of ELF executables and libraries in $dir" local i