Bug 27598 - dbus-binding-tool doesn't support annotations in signals
Summary: dbus-binding-tool doesn't support annotations in signals
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: GLib (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Simon McVittie
QA Contact: John (J5) Palmieri
URL: http://git.collabora.co.uk/?p=user/sm...
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-04-12 02:42 UTC by Christian Dywan
Modified: 2011-05-27 03:57 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Allow signal annotations in dbus-binding-tool (391 bytes, patch)
2010-04-12 02:44 UTC, Christian Dywan
Details | Splinter Review
Allow <annotation> inside <property> too (889 bytes, patch)
2011-01-04 08:16 UTC, Simon McVittie
Details | Splinter Review
Don't .gitignore everything in test/interfaces, and remove some duplication (1.64 KB, patch)
2011-01-04 08:16 UTC, Simon McVittie
Details | Splinter Review
Test that interfaces, methods, properties, signals can be annotated (3.18 KB, patch)
2011-01-04 08:16 UTC, Simon McVittie
Details | Splinter Review
test/interfaces: check that some invalid annotations aren't allowed (4.44 KB, patch)
2011-01-04 08:17 UTC, Simon McVittie
Details | Splinter Review
test/interfaces: test annotated arguments (1.61 KB, patch)
2011-01-04 08:17 UTC, Simon McVittie
Details | Splinter Review

Description Christian Dywan 2010-04-12 02:42:14 UTC
The dbus-binding-tool treats annotations in signals as errors. Leading to the following:

$ dbus-binding-tool --mode=glib-client --output=test-glue.h
../../../tracker/data/dbus/tracker-resources.xml 
Unable to load "../../../tracker/data/dbus/tracker-resources.xml": Can't put
<annotation> element here

The problematic annotation is something like this:

<signal name="Writeback">
  <arg type="a{sas}" name="subjects" />
  <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QMap&lt;QString,QStringList&gt;"/>
</signal>

The D-Bus specification [1] however says this is allowed:

"Method, interface, property, and signal elements may have "annotations", which
are generic key/value pairs of metadata."

http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format
Comment 1 Christian Dywan 2010-04-12 02:44:51 UTC
Created attachment 34910 [details] [review]
Allow signal annotations in dbus-binding-tool

Attached a possible fix which seems to solve the problem.
Comment 2 Simon McVittie 2011-01-04 08:15:30 UTC
Branch with that commit and some more (including tests) at <http://git.collabora.co.uk/?p=user/smcv/dbus-glib-smcv.git;a=shortlog;h=refs/heads/27598>. Patches to follow.
Comment 3 Simon McVittie 2011-01-04 08:16:02 UTC
Created attachment 41625 [details] [review]
Allow <annotation> inside <property> too
Comment 4 Simon McVittie 2011-01-04 08:16:23 UTC
Created attachment 41626 [details] [review]
Don't .gitignore everything in test/interfaces, and remove some duplication
Comment 5 Simon McVittie 2011-01-04 08:16:43 UTC
Created attachment 41627 [details] [review]
Test that interfaces, methods, properties, signals can be annotated
Comment 6 Simon McVittie 2011-01-04 08:17:09 UTC
Created attachment 41628 [details] [review]
test/interfaces: check that some invalid annotations aren't allowed
Comment 7 Simon McVittie 2011-01-04 08:17:51 UTC
Created attachment 41629 [details] [review]
test/interfaces: test annotated arguments

The D-Bus Specification doesn't actually allow this, but dbus-glib has
always supported it, and indeed understands a couple of <arg> annotations
itself - org.freedesktop.DBus.GLib.ReturnVal and ….DBus.GLib.Const.

(That's all the patches for now; review would be appreciated.)
Comment 8 Robert Ancell 2011-02-14 19:24:47 UTC
Patches look good to me, we are now using these in Ubuntu 11.04 (Natty).
Comment 9 Simon McVittie 2011-05-27 03:57:11 UTC
Fixed in git for 0.94, based on review from Robert and no objections from the reviewer group.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.