Source: dbus-fast
Version: 2.23.0-1
Severity: normal
Tags: patch
User: d...@packages.debian.org
Usertags: dbus-launch dbus-launch-for-tests

dbus-fast relies on dbus-launch (dbus-x11) to run its test suite,
but it doesn't need to: dbus-daemon is sufficient. Please consider the
attached patch, which avoids pulling in X11 libraries and various bits
of historical backwards-compatibility glue around X11 autolaunching.

See also <https://lists.debian.org/debian-devel/2016/08/msg00554.html>,
a mass bug filing in 2016.

The autopkgtests still pass with the attached patch (tested in qemu, lxc,
podman) and according to diffoscope, the resulting binaries are identical.

Thanks,
    smcv
>From e91932b938cc93af7ba13c74a813071e9582abf5 Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@debian.org>
Date: Mon, 26 Aug 2024 15:27:32 +0100
Subject: [PATCH] Use dbus-run-session for tests in preference to dbus-launch

This avoids relying on X11 autolaunch mechanisms that have never been
completely reliable, and also avoids pulling in backwards-compatibility
code in /etc/X11/Xsession.d.

Closes: #-1
---
 debian/control         | 2 +-
 debian/rules           | 2 +-
 debian/tests/control   | 2 +-
 debian/tests/run-tests | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/debian/control b/debian/control
index 9c4052d..2dc30a4 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Section: python
 Priority: optional
 Build-Depends:
  cython3 (>= 3.0.5),
- dbus-x11 <!nocheck>,
+ dbus-daemon <!nocheck>,
  debhelper-compat (= 13),
  dh-sequence-python3,
  dh-sequence-sphinxdoc,
diff --git a/debian/rules b/debian/rules
index 84a1c57..78bd022 100755
--- a/debian/rules
+++ b/debian/rules
@@ -19,7 +19,7 @@ override_dh_auto_clean:
 	rm -rf dbus_fast.egg-info/ src/dbus_fast/*.c src/dbus_fast/*/*.c docs/_build setup.py
 
 override_dh_auto_test:
-	xvfb-run -a dbus-launch --exit-with-session dh_auto_test --no-parallel
+	xvfb-run -a dbus-run-session -- dh_auto_test --no-parallel
 
 override_dh_auto_build:
 	dh_auto_build $@ --buildsystem=pybuild
diff --git a/debian/tests/control b/debian/tests/control
index 9b66c72..c6c318d 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,6 +1,6 @@
 Tests: run-tests
 Depends:
- dbus-x11,
+ dbus-daemon,
  python3-all,
  python3-poetry-core,
  python3-pytest,
diff --git a/debian/tests/run-tests b/debian/tests/run-tests
index fd62616..e8087a6 100755
--- a/debian/tests/run-tests
+++ b/debian/tests/run-tests
@@ -2,5 +2,5 @@
 set -e
 cp -r test* "$AUTOPKGTEST_TMP/" && cd "$AUTOPKGTEST_TMP"
 for py in $(py3versions -s); do
-	xvfb-run -a dbus-launch --exit-with-session $py -Wd -m pytest -v -x -k "not test_tcp_connection_with_forwarding and not test_glib_properties and not test_sending_signals_between_buses" --no-cov 2>&1
+	xvfb-run -a dbus-run-session -- $py -Wd -m pytest -v -x -k "not test_tcp_connection_with_forwarding and not test_glib_properties and not test_sending_signals_between_buses" --no-cov 2>&1
 done
-- 
2.45.2

Reply via email to