#1112228 tone-generator: (Unnecessarily?) Depends on deprecated dbus-glib

#1112228#5
Date:
2025-08-27 16:15:54 UTC
From:
To:
tone-generator Depends on libdbus-glib-1-2 and Build-Depends on
libdbus-glib-1-dev. Please (ask upstream to) avoid these dependencies.

From a quick look at codesearch.debian.net, it looks as though it is
actually only using libdbus APIs such as DBusConnection and DBusMessage.
If that is true, then the dependency on the deprecated dbus-glib library
could easily be dropped by removing dbus-glib-1 from the
PKG_CHECK_MODULES call, removing #include <dbus/dbus-glib.h> and
#include <dbus/dbus-glib-lowlevel.h>, and removing libdbus-glib-1-dev
from the Build-Depends in the packaging.

Thanks,
    smcv

#1112228#12
Date:
2025-08-28 06:28:06 UTC
From:
To:
Hi Simon,

tone-generator uses dbus_connection_setup_with_g_main() from
dbus-glib-lowlevel.h. How can that be replaced?
https://sources.debian.org/src/tone-generator/1.6.1-5/src/dbusif.c?hl=94#L94

Mike

#1112228#17
Date:
2025-08-28 08:08:11 UTC
From:
To:
Control: retitle -1 tone-generator: Depends on deprecated dbus-glib

Indeed, the dependency is not unnecessary in this case. I was checking
codesearch for the usual dbus-glib API patterns like dbus_g, but one of
the many design flaws of dbus-glib is that it doesn't use a consistent
namespace...

There are two main routes this could go:

If the developer prefers to use GLib more consistently, one route is to
move from dbus-glib + libdbus to GDBus. This is a thread-aware,
thread-safe implementation of D-Bus using GLib conventions such as
GMainContext and the GVariant representation of D-Bus data types.
It would take some porting, but does not add a dependency (because
dbus-glib already depends on libgio-2.0, the library that contains
GDBus).

Or, tone-generator could vendor a copy of dbus-gmain (the small subset
of dbus-glib that it is actually using) to attach libdbus to the GLib
main loop. This is dangerous for multi-threaded code (libdbus is *meant
to be* thread-safe, but does not have a particularly coherent threading
model, which makes it unlikely to be *actually* thread-safe) but should
be OK if it's single-threaded. For more details please see
<https://gitlab.freedesktop.org/dbus/dbus-glib/-/tree/dbus-gmain?ref_type=heads>,
which can be used with `git submodule` or `git subtree`, or by copying
dbus-gmain.[ch]. There is no independent shared library for dbus-gmain.

A third option would be to use some other D-Bus implementation, like
sd-bus.

     smcv

#1112228#24
Date:
2026-04-24 10:36:29 UTC
From:
To:
Control: severity -1 important

I'm raising the bug reports for remaining uses of dbus-glib to important
severity. It's now been 11 years since dbus-glib was documented as
deprecated in its own NEWS file, and it hasn't got any better-quality or
more-maintained since then.

It might be useful to note that since the initial MBF in 2018, the
migration guide from dbus-glib to GDBus has moved to
<https://docs.gtk.org/gio/migrating-gdbus.html>.

     smcv