Control: tag -1 patch

Hi!

On Sun, 2023-10-29 at 06:55:23 +0100, Lucas Nussbaum wrote:
> Source: dlt-daemon
> Version: 2.18.10-5
> Severity: serious
> Justification: FTBFS
> Tags: trixie sid ftbfs
> User: lu...@debian.org
> Usertags: ftbfs-20231028 ftbfs-trixie

> During a rebuild of all packages in sid, your package failed to build
> on amd64.
> 
> Relevant part (hopefully):
> > 89% tests passed, 1 tests failed out of 9
> > 
> > Total Test time (real) =   6.07 sec
> > 
> > The following tests FAILED:
> >       8 - gtest_dlt_daemon_multiple_files_logging (SIGTRAP)
> > Errors while running CTest
> > make[1]: *** [Makefile:74: test] Error 8
> > make[1]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu'
> > dh_auto_test: error: cd obj-x86_64-linux-gnu && make -j8 test 
> > ARGS\+=--verbose ARGS\+=-j8 returned exit code 2

So the problem is that the test suite is no parallel safe, as various
test cases use the same files under /tmp (!) and incur into race
conditions. The missing killall is not a cause of failure (!), but for
me is what helped me trigger this issue locally. (I'm filing another
report for the /tmp stuff.)

Attached a series of patches that "fix" this (and some of other
cleanups. The only ones needed to workaround this problem are patch 2
and 3. Although ideally the test suite would be made parallel safe by
using different files for each test case.

Thanks,
Guillem
From 509a491ddbb36d8312a0c4db3eb5b0778aa9c7f7 Mon Sep 17 00:00:00 2001
From: Guillem Jover <gjo...@sipwise.com>
Date: Tue, 7 Nov 2023 18:47:45 +0100
Subject: [PATCH 1/5] Run wrap-and-sort -sat

This makes changes when diffing sources minimal. As a side effect it
also removes a duplicate dependency on libsystemd-dev.
---
 debian/control                 | 44 ++++++++++++++++++++++++++--------
 debian/dlt-daemon.install      |  1 +
 debian/dlt-tools.install       |  8 +++----
 debian/libdlt-dev.dirs         |  2 +-
 debian/libdlt-dev.install      |  2 +-
 debian/libdlt-examples.install |  8 +++----
 6 files changed, 45 insertions(+), 20 deletions(-)

diff --git a/debian/control b/debian/control
index 7cf89c9..e9e47b4 100644
--- a/debian/control
+++ b/debian/control
@@ -1,8 +1,19 @@
 Source: dlt-daemon
 Priority: optional
 Maintainer: Aigars Mahinovs <aigar...@debian.org>
-Uploaders: Gianfranco Costamagna <locutusofb...@debian.org>
-Build-Depends: debhelper-compat (= 13), cmake, zlib1g-dev, libdbus-1-dev, doxygen, libgtest-dev, libsystemd-dev, pandoc, systemd, libsystemd-dev, libjson-c-dev
+Uploaders:
+ Gianfranco Costamagna <locutusofb...@debian.org>,
+Build-Depends:
+ cmake,
+ debhelper-compat (= 13),
+ doxygen,
+ libdbus-1-dev,
+ libgtest-dev,
+ libjson-c-dev,
+ libsystemd-dev,
+ pandoc,
+ systemd,
+ zlib1g-dev,
 Standards-Version: 4.6.2
 Section: libs
 Rules-Requires-Root: no
@@ -12,7 +23,9 @@ Package: libdlt-dev
 Section: libdevel
 Architecture: any
 Multi-Arch: same
-Depends: libdlt2 (= ${binary:Version}), ${misc:Depends}
+Depends:
+ libdlt2 (= ${binary:Version}),
+ ${misc:Depends},
 Description: Diagnostic Log and Trace (DLT) library (development)
  This component provides a log and trace interface, based on the standardised
  protocol specified in the AUTOSAR standard 4.0 DLT. This software can be used
@@ -25,7 +38,9 @@ Description: Diagnostic Log and Trace (DLT) library (development)
 Package: libdlt2
 Architecture: any
 Multi-Arch: same
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends:
+ ${misc:Depends},
+ ${shlibs:Depends},
 Description: Diagnostic Log and Trace (DLT) library
  This component provides a log and trace interface, based on the standardised
  protocol specified in the AUTOSAR standard 4.0 DLT. This software can be used
@@ -37,8 +52,11 @@ Description: Diagnostic Log and Trace (DLT) library
 Package: dlt-daemon
 Architecture: any
 Multi-Arch: foreign
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Suggests: dlt-tools
+Depends:
+ ${misc:Depends},
+ ${shlibs:Depends},
+Suggests:
+ dlt-tools,
 Description: Diagnostic Log and Trace logging daemon
  This component provides a log and trace interface, based on the standardised
  protocol specified in the AUTOSAR standard 4.0 DLT. This software can be used
@@ -55,8 +73,11 @@ Description: Diagnostic Log and Trace logging daemon
 Package: dlt-tools
 Architecture: any
 Multi-Arch: foreign
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Suggests: dlt-daemon
+Depends:
+ ${misc:Depends},
+ ${shlibs:Depends},
+Suggests:
+ dlt-daemon,
 Description: Diagnostic Log and Trace (DLT) (documentation)
  This component provides a log and trace interface, based on the standardised
  protocol specified in the AUTOSAR standard 4.0 DLT. This software can be used
@@ -70,8 +91,11 @@ Description: Diagnostic Log and Trace (DLT) (documentation)
 Package: libdlt-examples
 Architecture: any
 Multi-Arch: foreign
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Suggests: dlt-daemon
+Depends:
+ ${misc:Depends},
+ ${shlibs:Depends},
+Suggests:
+ dlt-daemon,
 Description: Diagnostic Log and Trace (DLT) (documentation)
  This component provides a log and trace interface, based on the standardised
  protocol specified in the AUTOSAR standard 4.0 DLT. This software can be used
diff --git a/debian/dlt-daemon.install b/debian/dlt-daemon.install
index db68c9d..328b845 100644
--- a/debian/dlt-daemon.install
+++ b/debian/dlt-daemon.install
@@ -4,4 +4,5 @@ usr/bin/dlt-daemon
 usr/share/man/man1/dlt-daemon.*
 usr/share/man/man5/dlt.conf.*
 usr/share/man/man5/dlt_gateway.conf.*
+
 #usr/lib/systemd/system/dlt.socket
diff --git a/debian/dlt-tools.install b/debian/dlt-tools.install
index 54efab3..cf3b926 100644
--- a/debian/dlt-tools.install
+++ b/debian/dlt-tools.install
@@ -1,6 +1,7 @@
 etc/dlt-dbus.conf
 etc/dlt-kpi.conf
 etc/dlt-system.conf
+usr/bin/dlt-*-ctrl
 usr/bin/dlt-adaptor*
 usr/bin/dlt-control
 usr/bin/dlt-convert
@@ -9,14 +10,13 @@ usr/bin/dlt-kpi
 usr/bin/dlt-receive
 usr/bin/dlt-sortbytimestamp
 usr/bin/dlt-system
-usr/bin/dlt-*-ctrl
+usr/lib/systemd/system/dlt-adaptor-udp.service /usr/share/doc/dlt-tools/examples
+usr/lib/systemd/system/dlt-receive.service /usr/share/doc/dlt-tools/examples
+usr/share/man/man1/dlt-*-ctrl*
 usr/share/man/man1/dlt-adaptor*
 usr/share/man/man1/dlt-control*
 usr/share/man/man1/dlt-convert*
-usr/share/man/man1/dlt-*-ctrl*
 usr/share/man/man1/dlt-receive*
 usr/share/man/man1/dlt-sortbytimestamp*
 usr/share/man/man1/dlt-system*
 usr/share/man/man5/dlt-system*
-usr/lib/systemd/system/dlt-adaptor-udp.service /usr/share/doc/dlt-tools/examples
-usr/lib/systemd/system/dlt-receive.service /usr/share/doc/dlt-tools/examples
diff --git a/debian/libdlt-dev.dirs b/debian/libdlt-dev.dirs
index 4418816..da07fdd 100644
--- a/debian/libdlt-dev.dirs
+++ b/debian/libdlt-dev.dirs
@@ -1,2 +1,2 @@
-usr/lib
 usr/include
+usr/lib
diff --git a/debian/libdlt-dev.install b/debian/libdlt-dev.install
index f29af28..7755ba3 100644
--- a/debian/libdlt-dev.install
+++ b/debian/libdlt-dev.install
@@ -1,4 +1,4 @@
 usr/include/*
-usr/lib/*/lib*.so
 usr/lib/*/cmake/*
+usr/lib/*/lib*.so
 usr/lib/*/pkgconfig/*
diff --git a/debian/libdlt-examples.install b/debian/libdlt-examples.install
index e16a1d1..a346049 100644
--- a/debian/libdlt-examples.install
+++ b/debian/libdlt-examples.install
@@ -1,7 +1,7 @@
-usr/bin/dlt-example* /usr/lib/libdlt-examples
-usr/bin/dlt-test* /usr/lib/libdlt-examples
-examples/* /usr/share/doc/libdlt-examples
-src/examples/* /usr/share/doc/libdlt-examples
 doc/*.txt /usr/share/doc/libdlt-examples
 doc/images/* /usr/share/doc/libdlt-examples
+examples/* /usr/share/doc/libdlt-examples
+src/examples/* /usr/share/doc/libdlt-examples
+usr/bin/dlt-example* /usr/lib/libdlt-examples
+usr/bin/dlt-test* /usr/lib/libdlt-examples
 usr/lib/systemd/system/dlt-example-user.service /usr/share/doc/libdlt-examples/examples
-- 
2.42.0

From 18836a0b26088eb472e2b3e59e4a9bfaf51fa5f3 Mon Sep 17 00:00:00 2001
From: Guillem Jover <gjo...@sipwise.com>
Date: Tue, 7 Nov 2023 18:48:44 +0100
Subject: [PATCH 2/5] Do not run the test suite in parallel

The test suite is not parallel safe, as it shares the same log files for
multiple test cases.
---
 debian/rules | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/debian/rules b/debian/rules
index 6835072..0cd6027 100755
--- a/debian/rules
+++ b/debian/rules
@@ -14,6 +14,8 @@ override_dh_auto_configure:
 		-DWITH_DLT_DBUS=ON -DWITH_DLT_SYSTEM=ON -DWITH_DLT_KPI=ON -DWITH_DLT_FILETRANSFER=ON -DWITH_UDP_CONNECTION=ON \
 		-DWITH_DLT_UNIT_TESTS=ON -DWITH_EXTENDED_FILTERING=ON -DWITH_DLT_LOGSTORAGE_GZIP=ON -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
 
+override_dh_auto_test:
+	dh_auto_test --no-parallel
 
 override_dh_auto_install:
 	dh_auto_install
-- 
2.42.0

From a7efbc52963eab3e3a6100680d72c5be3b7f1658 Mon Sep 17 00:00:00 2001
From: Guillem Jover <gjo...@sipwise.com>
Date: Tue, 7 Nov 2023 19:12:40 +0100
Subject: [PATCH 3/5] Add psmisc to Build-Depends needed for killall

The test suite uses killall in its test cases.
---
 debian/control | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/control b/debian/control
index e9e47b4..6092585 100644
--- a/debian/control
+++ b/debian/control
@@ -12,6 +12,7 @@ Build-Depends:
  libjson-c-dev,
  libsystemd-dev,
  pandoc,
+ psmisc <!nocheck>,
  systemd,
  zlib1g-dev,
 Standards-Version: 4.6.2
-- 
2.42.0

From 323acc65edaaee33a729e6649a00b16212c4a7bc Mon Sep 17 00:00:00 2001
From: Guillem Jover <gjo...@sipwise.com>
Date: Tue, 7 Nov 2023 18:50:17 +0100
Subject: [PATCH 4/5] Remove unused systemd from Build-Depends

---
 debian/control | 1 -
 1 file changed, 1 deletion(-)

diff --git a/debian/control b/debian/control
index 6092585..1f8a2e2 100644
--- a/debian/control
+++ b/debian/control
@@ -13,7 +13,6 @@ Build-Depends:
  libsystemd-dev,
  pandoc,
  psmisc <!nocheck>,
- systemd,
  zlib1g-dev,
 Standards-Version: 4.6.2
 Section: libs
-- 
2.42.0

From e81d6550baf3226faa77ee50482d308204b5e1a6 Mon Sep 17 00:00:00 2001
From: Guillem Jover <gjo...@sipwise.com>
Date: Tue, 7 Nov 2023 18:54:12 +0100
Subject: [PATCH 5/5] Use execute_after_dh_auto_install instead of
 override_dh_auto_install

The former avoids having to explicitly call dh_auto_install, when we
only want to extend it with additional commands.
---
 debian/rules | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/debian/rules b/debian/rules
index 0cd6027..296bce1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -17,8 +17,7 @@ override_dh_auto_configure:
 override_dh_auto_test:
 	dh_auto_test --no-parallel
 
-override_dh_auto_install:
-	dh_auto_install
+execute_after_dh_auto_install:
 	# we use the Debian version for the services files
 	rm debian/tmp/usr/lib/systemd/system/dlt-dbus.service debian/tmp/usr/lib/systemd/system/dlt-system.service debian/tmp/usr/lib/systemd/system/dlt.service
 	# they are used only for testing, and they mention /usr/local/ in source code, so they can't work anyway
-- 
2.42.0

Reply via email to