[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1109944: unblock: libcap2/1:2.75-10



Package: release.debian.org
Severity: normal
X-Debbugs-Cc: libcap2@packages.debian.org
Control: affects -1 + src:libcap2
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package libcap2, which fixes a FTBFS, and a
FTBFS-twice-in-a-row (do we have an acronym for that?).

Thanks,
Christian

[ Reason ]
This fixes #1109906, which is caused by the occasional lingering
of test executables, thus preventing the RPATH drop.

In the previous workaround, wasn't seeing the forest for the
trees -- I don't need to remove RPATH from the original tests,
it's sufficient to remove them from the installed copies.

This upload also fixes a typo in a dh_auto_clean override,
which resulted in a failure to build twice in a row.

[ Impact ]
#1109906 is release-critical.

[ Tests ]
There are no user-visible changes.

For the package build itself, I first tested this in
experimental before uploading to unstable.

[ Risks ]
There should be zero risks to this change.

[ Checklist ]
  [x] all changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in testing

unblock libcap2/1:2.75-10
diff -Nru libcap2-2.75/debian/changelog libcap2-2.75/debian/changelog
--- libcap2-2.75/debian/changelog	2025-06-17 21:43:10.000000000 +0200
+++ libcap2-2.75/debian/changelog	2025-07-26 20:46:06.000000000 +0200
@@ -1,3 +1,13 @@
+libcap2 (1:2.75-10) unstable; urgency=medium
+
+  * d/rules: Fix typo in override_dh_auto_clean
+    Makes package buildable twice-in-row again
+  * d/rules: Remove RPATH from installed copy of test binary
+    This sidesteps the problem of the original copy being held open by some
+    lingering test process. (Closes: #1109906)
+
+ -- Christian Kastner <ckk@debian.org>  Sat, 26 Jul 2025 20:46:06 +0200
+
 libcap2 (1:2.75-9) unstable; urgency=medium
 
   * d/rules: Add short sleep after tests
diff -Nru libcap2-2.75/debian/rules libcap2-2.75/debian/rules
--- libcap2-2.75/debian/rules	2025-06-17 21:43:10.000000000 +0200
+++ libcap2-2.75/debian/rules	2025-07-26 20:46:06.000000000 +0200
@@ -39,7 +39,7 @@
 	# two cleans
 	set -e; if test -d _build; then \
 		dh_auto_clean -B_build -O--buildsystem=golang; \
-		dh_auto_clean O--buildsystem=golang; \
+		dh_auto_clean -O--buildsystem=golang; \
 	fi
 	# Undo change of lookup (see override_dh_auto_build)
 	sed -i -e 's,\./tcapsh-static,../progs/tcapsh-static,g' tests/libcap_launch_test.c
@@ -80,33 +80,33 @@
 
 
 override_dh_auto_install:
-	# On slower arches, it seems that tests need more time to shut down,
-	# which causes patchelf to fail. A short sleep is the least complicated
-	# workaround
-	sleep 5
-	# Unfortunately, RPATH seems to be needed for the build-time tests
-	# (avoiding it and going through LD_LIBRARY_PATH didn't work in all
-	# cases)
-	# List is identical to build above, minus noop (no RPATH)
-	cd tests && patchelf --remove-rpath \
-		psx_test \
-		libcap_psx_test \
-		uns_test \
-		libcap_launch_test \
-		libcap_psx_launch_test \
-		exploit \
-		noexploit
 	dh_auto_install -- \
 		$(MAKE_ASSIGNMENTS) \
 		lib=lib/$(DEB_HOST_MULTIARCH) \
 		PKGCONFIGDIR=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \
 		RAISE_SETFCAP=no
 
+execute_after_dh_install-arch:
+	# Unfortunately, RPATH seems to be needed for the build-time tests
+	# (avoiding it and going through LD_LIBRARY_PATH didn't work in all
+	# cases).
+	# Also, we need to operate on the install result, as the original
+	# executable may still be used by a running test process.
+	# .
+	# List is identical to build above, minus noop (no RPATH)
+	cd debian/libcap-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libcap2/tests  && \
+		patchelf --remove-rpath \
+			psx_test \
+			libcap_psx_test \
+			uns_test \
+			libcap_launch_test \
+			libcap_psx_launch_test \
+			exploit \
+			noexploit
 
 override_dh_auto_test:
 	dh_auto_test -- $(MAKE_ASSIGNMENTS)
 
-
 override_dh_makeshlibs:
 	dh_makeshlibs -V'libcap2 (>= $(SHLIBS_MINVER))' -plibcap2 \
 		--add-udeb=libcap2-udeb -- -c4

Reply to: