Subject: Re: bug#48538: D-Bus services do not work on foreign distributions/non-user profiles

From: Maxim Cournoyer <[email-masked]>
Date: Thu, 20 May 2021 13:18:32 -0400

This can be verified on a system where the jami-daemon (libring) has not
yet been installed (commonly via propagation from one of the jami
clients):

$ guix environment --ad-hoc jami-gnome -- jami-gnome

Attempt to run it:

$ jami-gnome

It should fail with the following message: "Could not rec-connect to the
Jami daemon (dring). Jami will now quit."

as the currently running dbus session doesn't know about
the newly installed D-Bus service, as it only look under a few
hard-coded places.

For this particular instance, a workaround is to run jami via the
dbus-run-session utility, which launches the client in an ad-hoc d-bus
session which knows about the dring D-Bus service (through the
XDG_DATA_DIRS variable set by glib's search path).

$ guix environment --pure --ad-hoc jami-gnome dbus glib \
     -- dbus-run-session jami-gnome

The glib package is added for its XDG_DATA_DIRS search path.  It works
because the client doesn't really care about being able to talk to
anything else but its daemon over D-Bus.