summary refs log tree commit diff
path: root/pkgs/build-support/setup-hooks/separate-debug-info.sh
diff options
context:
space:
mode:
authorGuillaume Girol <symphorien+git@xlumurb.eu>2023-03-12 12:00:00 +0000
committerGuillaume Girol <symphorien+git@xlumurb.eu>2023-03-12 12:00:00 +0000
commit94c7bf576a44829a676fb172bfceaefff4eb90f0 (patch)
tree804ed56d39535c4200a095a461769e2d7f7c022d /pkgs/build-support/setup-hooks/separate-debug-info.sh
parent0c4800d579af4ed98ecc47d464a5e7b0870c4b1f (diff)
downloadnixpkgs-94c7bf576a44829a676fb172bfceaefff4eb90f0.tar
nixpkgs-94c7bf576a44829a676fb172bfceaefff4eb90f0.tar.gz
nixpkgs-94c7bf576a44829a676fb172bfceaefff4eb90f0.tar.bz2
nixpkgs-94c7bf576a44829a676fb172bfceaefff4eb90f0.tar.lz
nixpkgs-94c7bf576a44829a676fb172bfceaefff4eb90f0.tar.xz
nixpkgs-94c7bf576a44829a676fb172bfceaefff4eb90f0.tar.zst
nixpkgs-94c7bf576a44829a676fb172bfceaefff4eb90f0.zip
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.
Diffstat (limited to 'pkgs/build-support/setup-hooks/separate-debug-info.sh')
-rw-r--r--pkgs/build-support/setup-hooks/separate-debug-info.sh3
1 files changed, 3 insertions, 0 deletions
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.