[MacPorts] #26924: glib2: new GDBus API can't connect to dbus

David Evans devans at macports.org
Sun Oct 24 13:39:48 PDT 2010


On 10/24/10 11:46 AM, MacPorts wrote:
> #26924: glib2: new GDBus API can't connect to dbus
> ----------------------------------+-----------------------------------------
>   Reporter:  devans@…             |       Owner:  ryandesign@…          
>       Type:  defect               |      Status:  closed                
>   Priority:  Normal               |   Milestone:                        
>  Component:  ports                |     Version:  1.9.1                 
> Resolution:  fixed                |    Keywords:  patch_attached        
>       Port:  glib2                |  
> ----------------------------------+-----------------------------------------
>
> Comment(by ryandesign@…):
>
>  Sorry, I totally missed this ticket. Thanks for taking care of it.
>
Unfortunately, this is not the end of the story.

This interface is now the GNOME preferred interface for clients to
connect to and communicate
on the dbus.  Beginning with GNOME 2.32, many, if not most apps, have
switched to this API
as opposed to using libdbus. GConf is a good example.

The problem is that glib's gio code does not yet know how to get the
dbus address from
launchd as libdbus does and as is implemented in MacPorts.  Instead it
looks for the well
known environment variables DBUS_SESSION_BUS_ADDRESS or
DBUS_SYSTEM_BUS_ADDRESS
as appropriate to find the bus address.  If this is not available then
it tries to use dbus-launch
to do the job as Linux does but this doesn't work for us.

For MacPorts (OS X in general) it needs to get the dbus socket address
from launchd using launchctl
 and then form the bus address from that, something like

DBUS_SESSION_BUS_ADDRESS="unix:path=`launchctl getenv
DBUS_LAUNCHD_SESSION_BUS_SOCKET`"

As a concrete example, my current session bus address is

unix:path=/tmp/launch-aNV5El/unix_domain_listener

Comments in the code indicate that they are aware of this situation (on
the TODO list), but it isn't clear when the
appropriate code might be added.  See g_dbus_address_connect() in
gio/gdbusaddress.c.

So something to look for or maybe get involved upstream.

This is just to let you know of the situation if you weren't already
aware.  Because of the situation,
I am holding off on moving the GNOME ports to version 2.32 until launchd
is supported.  I think
having to have the user set the required environment variable manually
will cause too much confusion
and without this dbus just appears to be broken (which it is not).

Right now I am working on porting the GNOME 2.32 ports, where they
differ from the current ones,
to a test port tree and will add this to svn under my user name when
ready so that other developers
and more adventurous users can get involved in the testing process.

Dave



More information about the macports-dev mailing list