From ca522a7fc84c5682ba9ac9c80fa5477ad69ef857 Mon Sep 17 00:00:00 2001 From: Elvis Pranskevichus Date: Fri, 10 Jan 2025 09:33:48 -0800 Subject: [PATCH] generic: Avoid stripping binaries when a debug build is requested (#43) --- metapkg/targets/base.py | 4 ++++ metapkg/targets/generic/build.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/metapkg/targets/base.py b/metapkg/targets/base.py index f659b91..c7e6dab 100644 --- a/metapkg/targets/base.py +++ b/metapkg/targets/base.py @@ -783,6 +783,10 @@ def build_date(self) -> datetime.datetime: def build_parallelism(self) -> int: return self._jobs + @property + def is_debug_build(self) -> bool: + return self._build_debug + def get_source_abspath(self) -> pathlib.Path: raise NotImplementedError diff --git a/metapkg/targets/generic/build.py b/metapkg/targets/generic/build.py index 59e6f19..4e4fe3d 100644 --- a/metapkg/targets/generic/build.py +++ b/metapkg/targets/generic/build.py @@ -451,7 +451,8 @@ def _fixup_binaries(self, files: list[pathlib.Path]) -> None: if self.target.is_binary_code_file(self, full_path): bin_paths[file.name].add(inst_path) binaries.add(inst_path) - self._strip(image_root, file) + if not self.is_debug_build: + self._strip(image_root, file) if self.target.is_dynamically_linked(self, full_path): self._fixup_rpath(image_root, file) refs[inst_path] = self.target.get_shlib_refs(