[pacman-dev] libmakepkg: when stripping split debug symbols, warn on duplicate paths

Message ID 20190805044503.11349-1-eschwartz@archlinux.org
State Superseded, archived
Headers show
Series
  • [pacman-dev] libmakepkg: when stripping split debug symbols, warn on duplicate paths
Related show

Commit Message

Eli Schwartz Aug. 5, 2019, 4:45 a.m. UTC
Trying to strip multiple files installed to the same filepath (in
different components of a split package) can produce surprising results
if those files are built using different options. Per FS#63356 this is
not a supported PKGBUILD configuration. Instead, warn about such cases
when producing debug packages.

Fixes FS#63366

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---
 scripts/libmakepkg/tidy/strip.sh.in | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Patch

diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in
index 5937e13c..eaa764b7 100644
--- a/scripts/libmakepkg/tidy/strip.sh.in
+++ b/scripts/libmakepkg/tidy/strip.sh.in
@@ -46,7 +46,13 @@  strip_file() {
 	if check_option "debug" "y"; then
 		local bid=$(build_id "$binary")
 
-		# has this file already been stripped
+		# has this filepath been stripped before under a different Build Id
+		if [[ -f "$dbgdir/$binary.debug" ]]; then
+			if [[ -n $bid && $bid != $(build_id "$dbgdir/$binary.debug") ]]; then
+				warning "Split package with multiple copies of the file '%s' have different Build Ids" "$binary"
+			fi
+		fi
+		# has this file's hardlink already been stripped
 		if [[ -n "$bid" ]]; then
 			if [[ -f "$dbgdir/.build-id/${bid:0:2}/${bid:2}.debug" ]]; then
 				return