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 650874 - codegen chokes on docs
codegen chokes on docs
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
unspecified
Other Linux
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-05-23 14:56 UTC by Bastien Nocera
Modified: 2011-05-24 03:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bastien Nocera 2011-05-23 14:56:19 UTC
gdbus-codegen will choke on files such as this one:
http://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/datetime/gsd-datetime-mechanism.xml


Traceback (most recent call last):
  • File "/home/hadess/Projects/gnome-install/bin/gdbus-codegen", line 33 in <module>
    sys.exit(codegen_main())
  • File "/home/hadess/Projects/gnome-install/lib64/gdbus-codegen/codegen_main.py", line 171 in codegen_main
    parsed_ifaces = parser.parse_dbus_xml(xml_data)
  • File "/home/hadess/Projects/gnome-install/lib64/gdbus-codegen/parser.py", line 283 in parse_dbus_xml
    parser = DBusXMLParser(xml_data)
  • File "/home/hadess/Projects/gnome-install/lib64/gdbus-codegen/parser.py", line 56 in __init__
    self._parser.Parse(xml_data)
  • File "/home/hadess/Projects/gnome-install/lib64/gdbus-codegen/parser.py", line 263 in handle_start_element
    raise RuntimeError('Cannot go from state "%s" to element with name "%s"'%(self.state, name))
RuntimeError: Cannot go from state "arg" to element with name "doc:doc"

Docs should just be ignored (or maybe added as gtk-doc?)
Comment 1 David Zeuthen (not reading bugmail) 2011-05-23 15:14:10 UTC
Yeah, we should definitely just ignore elements we don't know/care about. FWIW, I saw this last week but for some reason didn't fix it or file a bug.
Comment 2 David Zeuthen (not reading bugmail) 2011-05-23 15:14:49 UTC
Better error messages would be nice too. Especially in a format so e.g. emacs can parse them (e.g. <file>:<line>: <complaint>).
Comment 3 David Zeuthen (not reading bugmail) 2011-05-24 03:24:55 UTC
OK, fixed here including tests:

 http://git.gnome.org/browse/glib/commit/?id=263ce3042ccf596f5cd59b1defa546df2602597d