After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 618029 - gdbus & gio-unix problems
gdbus & gio-unix problems
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
2.25.x
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-05-07 16:17 UTC by Christian Persch
Modified: 2010-05-14 00:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Persch 2010-05-07 16:17:50 UTC
There are some tiny problems with gdbus and gio vs. gio-unix:

a) 

gio/gio.h includes gdbusmessage.h.

gdbusmessage.h contains:

#ifdef G_OS_UNIX
#include <gio/gunixfdlist.h>
#endif

But gunixfdlist is only available when you have added cflags from gio-unix-2.0.
Therefore, when you include <gio/gio.h> in application code which uses cflags for gio-2.0 only, you get this error:

...../include/glib-2.0/gio/gdbusmessage.h:29:29: error: gio/gunixfdlist.h: No such file or directory


b)

gunixcredentialsmessage.h is included in gdbus_headers and thus ends up in $prefix/include/gio-2.0/gio instead of $prefix/include/gio-unix-2.0/gio where all the other unix-only headers are.
Comment 1 Matthias Clasen 2010-05-09 16:45:56 UTC
It would maybe be overkill to introduce a gunixdbusmessage.h header just for these 2 functions. A pragmatic solution would be to just move them to gunixfdlist.h. David ?
Comment 2 David Zeuthen (not reading bugmail) 2010-05-10 00:51:47 UTC
(In reply to comment #1)
> It would maybe be overkill to introduce a gunixdbusmessage.h header just for
> these 2 functions. A pragmatic solution would be to just move them to
> gunixfdlist.h. David ?

We could also just guard functions behind #ifdef __G_UNIX_FD_LIST_H__ ...
Comment 3 Matthias Clasen 2010-05-10 15:17:02 UTC
the #if G_IO_UNIX around the gunixfdlist.h include is still incorrect and will bomb if you build something on unix without gio-unix-2.0.pc
Comment 4 David Zeuthen (not reading bugmail) 2010-05-10 19:15:39 UTC
(In reply to comment #3)
> the #if G_IO_UNIX around the gunixfdlist.h include is still incorrect and will
> bomb if you build something on unix without gio-unix-2.0.pc

That's fine, we simply don't include gunixfdlist.h from gdbusmessage.h since we're depending on the user to do it. I mean, he will need to do that anyway in order to get the GUnixFDList typedef in the first place.
Comment 5 Matthias Clasen 2010-05-10 20:52:25 UTC
Then you introduce an ordering dependency among the users includes, which is not a nice thing to do.
Comment 6 David Zeuthen (not reading bugmail) 2010-05-10 21:02:02 UTC
(In reply to comment #5)
> Then you introduce an ordering dependency among the users includes, which is
> not a nice thing to do.

True that. Well, GUnixFDList could include gdbusmessage.h.. might be nicer than moving the GUnixFDList*-using functions to that said headerfile as suggested in comment 2. Either way, I don't think there's any way to not lose...

We could also just move

 typedef struct _GUnixFDList   GUnixFDList

and (other Unix-only structs too) to giotypes.h. Technically that's kinda where they belong.
Comment 7 Matthias Clasen 2010-05-10 22:01:15 UTC
 typedef struct _GUnixFDList   GUnixFDList

That may be the most elegant solution.
Means that you get to see the type even if you don't use gio-unix, but you don't get to use it.