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 659699 - property name collision when generating code for iface "Connection"
property name collision when generating code for iface "Connection"
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
2.29.x
Other Linux
: Normal blocker
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-09-21 12:09 UTC by Xavier Claessens
Modified: 2011-09-21 14:59 UTC
See Also:
GNOME target: 3.2
GNOME version: ---


Attachments
Proposed patch (9.75 KB, patch)
2011-09-21 12:20 UTC, David Zeuthen (not reading bugmail)
committed Details | Review

Description Xavier Claessens 2011-09-21 12:09:43 UTC
telepathy spec has an interface org.freedesktop.Telepathy.Connection and I generate code with prefix=org.freedesktop.Telepathy.

That means that the generated TpGDBusObjectProxy will have a property "connection" for the interface, but it conflicts with the property "connection" on GDBusObjectProxy.

I get warnings like that:

(process:27254): GLib-GObject-CRITICAL **: Property 'connection' on class 'TpGDBusObjectProxy' has type 'GDBusConnection' which is different from the type 'TpGDBusConnection', of the property on interface 'TpGDBusObject'


g_dbus_connection_signal_subscribe: assertion `G_IS_DBUS_CONNECTION (connection)' failed


I think the property on GDBusObjectProxy should be prefixed with "g-" or something.

Setting this as blocker for 2.30 since it's our last chance for an API break.
Comment 1 David Zeuthen (not reading bugmail) 2011-09-21 12:13:13 UTC
Yeah, this was an oversight of mine - just like GDBusProxy, we need to prefix properties with g- to avoid collisions like that. Will attach a patch.
Comment 2 David Zeuthen (not reading bugmail) 2011-09-21 12:20:37 UTC
Created attachment 197149 [details] [review]
Proposed patch

This patch fixes it for me. You will have to regenerate your code with gdbus-codegen(1) if you are using the ObjectManager interfaces. Please check if it works for you. Thanks!
Comment 3 Xavier Claessens 2011-09-21 12:55:13 UTC
That fixed my issues, thanks.
Comment 4 David Zeuthen (not reading bugmail) 2011-09-21 12:59:04 UTC
OK, since this is an API break (a small one, though, only affecting people using the ObjectManager interfaces) and we're in code freeze I'd like Ryan to OK it. We really want this change. Ryan? Thanks!
Comment 5 André Klapper 2011-09-21 13:13:14 UTC
[NEEDINFO is NOT meant for use against other developers but against reporters only. CC and/or ASSIGN please.]
Comment 6 Javier Jardón (IRC: jjardon) 2011-09-21 13:36:04 UTC
After a grep in a GNOME checkout, seems that only gnome-online-accounts and nautilus seems to use ObjectManager interfaces, but they do not have a interface called "Connection"
Comment 7 David Zeuthen (not reading bugmail) 2011-09-21 13:48:23 UTC
(In reply to comment #6)
> After a grep in a GNOME checkout, seems that only gnome-online-accounts and
> nautilus seems to use ObjectManager interfaces, but they do not have a
> interface called "Connection"

Sure. But these two (and anything else using ObjectManager interfaces) still need a rebuild after applying the patch because the code generated by gdbus-codegen(1) references the :object-path and :connection that has now been renamed. Not a big deal (neither nautilus nor g-o-a distributes the generated code anyway) and much better to get the API right instead of living with this problem the rest of our lives.
Comment 8 Allison Karlitskaya (desrt) 2011-09-21 14:49:24 UTC
My understanding of the problem is this:

 - we are changing the name of the property but also changing the name used
   in the code generator

 - any code generated using the current version of GLib will not work once
   we apply this patch

 - upshot is that GNOME 3.1.92 binary packages that are in distributions will
   *stop working* when they drop the upgrade to GLib, until they either rebuild
   the current version of those packages or release the 3.2.0 version (and do
   the rebuild associated with that)
Comment 9 David Zeuthen (not reading bugmail) 2011-09-21 14:51:12 UTC
comment 8 is accurate but is overstating the problem - it only applies to nautilus and gnome-online-accounts
Comment 10 Allison Karlitskaya (desrt) 2011-09-21 14:52:03 UTC
At the same time, I don't like living with mistakes.  Please apply the change to glib-2-30, but notify the release team and the distributor-list of the situation.
Comment 11 David Zeuthen (not reading bugmail) 2011-09-21 14:52:42 UTC
Comment on attachment 197149 [details] [review]
Proposed patch

Committed to branch master and branch glib-2-30
Comment 12 David Zeuthen (not reading bugmail) 2011-09-21 14:59:58 UTC
Thanks for the review - I've sent this note:

From: David Zeuthen <zeuthen@gmail.com>
To: release-team@gnome.org, distributor-list@gnome.org
Cc: Ryan Lortie <desrt@desrt.ca>
Subject: GLib API change for 3.2

Hey,

In https://bugzilla.gnome.org/show_bug.cgi?id=659699 a problem with gdbus-codegen(1) was discovered and we decided to break API to fix it.

This means that code using the new D-Bus ObjectManager interfaces and gdbus-codegen(1) will have to be rebuilt. In GNOME, this includes nautilus and gnome-online-accounts. As neither of these projects distributes generated code, only a rebuild is needed, no need for new tarballs or anything.

Thanks,
David