From 94c7bf576a44829a676fb172bfceaefff4eb90f0 Mon Sep 17 00:00:00 2001 From: Guillaume Girol Date: Sun, 12 Mar 2023 12:00:00 +0000 Subject: [PATCH] separate-debug-info.sh: succeed when output does not contain elf files Currently, separate-debug-info adds a debug output, and the build fail when it is not created. the output is only created when at least one elf file is stripped. As a result, adding separateDebugInfo = true on a lib will break the static build (unless the lib also contains an executable). In order to not have to remember to add an exception every time, let's just create the debug output unconditionally. --- pkgs/build-support/setup-hooks/separate-debug-info.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/build-support/setup-hooks/separate-debug-info.sh b/pkgs/build-support/setup-hooks/separate-debug-info.sh index 3c8c9c294c3..ca651b4393a 100644 --- a/pkgs/build-support/setup-hooks/separate-debug-info.sh +++ b/pkgs/build-support/setup-hooks/separate-debug-info.sh @@ -11,6 +11,9 @@ _separateDebugInfo() { local dst="${debug:-$out}" if [ "$prefix" = "$dst" ]; then return 0; fi + # in case there is nothing to strip, don't fail the build + mkdir -p "$dst" + dst="$dst/lib/debug/.build-id" # Find executables and dynamic libraries.