GNOME Bugzilla – Bug 659699
property name collision when generating code for iface "Connection"
Last modified: 2011-09-21 14:59:58 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.
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.
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!
That fixed my issues, thanks.
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!
[NEEDINFO is NOT meant for use against other developers but against reporters only. CC and/or ASSIGN please.]
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"
(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.
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 8 is accurate but is overstating the problem - it only applies to nautilus and gnome-online-accounts
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 on attachment 197149 [details] [review] Proposed patch Committed to branch master and branch glib-2-30
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