GNOME Bugzilla – Bug 629649
vapigen errors on GIR 1.2 <alias/> element
Last modified: 2010-11-08 10:14:11 UTC
Building telepathy-glib from this branch: http://git.collabora.co.uk/?p=user/pwith/telepathy-glib;a=shortlog;h=refs/heads/30134-intset-rename, vapigen fails with the following error: TelepathyGLib-0.12.gir:15.5-15.34: error: The base type `TelepathyGLib.Intset` of struct `TelepathyGLib.IntSet` is not a struct Generation failed: 1 error(s), 0 warning(s) The relevant <alias/> from the GIR file is as follows: <alias name="IntSet" c:type="TpIntSet"> <type name="Intset" c:type="TpIntset"/> </alias> Nothing else in the GIR file refers to IntSet: it all refers to Intset, which is defined as follows: <record name="Intset" c:type="TpIntset" glib:type-name="TpIntset" glib:get-type="tp_intset_get_type" c:symbol-prefix="intset"> <constructor name="new" c:identifier="tp_intset_new">…</constructor> <method name="add" c:identifier="tp_intset_add">…</method> … </record> I've uploaded the GIR file here: http://people.collabora.co.uk/~pwith/TelepathyGLib-0.12.gir This is using Vala compiled from http://git.gnome.org/browse/vala/commit/?h=0.10-gir&id=65fde53c99728fd406422d3193f6cf898f3a162d.
Do you really want/need to expose the old name to introspection as well? Vala currently does not support type aliases. If you don't need them, you should be able to mark them as not introspectable.
It turns out that telepathy-glib hasn't made any stability guarantees for GIR or VAPI files yet, so we can (and will) just mark the aliases as non-introspectable.
We do seem to be hitting this with another type: <alias name="Handle" c:type="TpHandle"> <doc xml:whitespace="preserve">...</doc> <type name="guint" c:type="guint"/> </alias> But we can't just skip this one, since it's critical to Telepathy and used throughout the API. So I guess we haven't fixed all the telepathy-glib build errors with GIR 1.2 after all.
(In reply to comment #3) > We do seem to be hitting this with another type: > > <alias name="Handle" c:type="TpHandle"> > <doc xml:whitespace="preserve">...</doc> > <type name="guint" c:type="guint"/> > </alias> > > But we can't just skip this one, since it's critical to Telepathy and used > throughout the API. > > So I guess we haven't fixed all the telepathy-glib build errors with GIR 1.2 > after all. The exact error I get is: /opt/gnome/bin/vapigen \ --library telepathy-glib \ --pkg gio-2.0 \ ../telepathy-glib/TelepathyGLib-0.12.gir \ ** (vapigen:15127): CRITICAL **: vala_gir_parser_parse_type_from_name: assertion `type_name != NULL' failed ** (vapigen:15127): CRITICAL **: vala_code_node_set_parent_node: assertion `self != NULL' failed TelepathyGLib-0.12.gir:13.7-13.28: error: expected end element of `alias' TelepathyGLib-0.12.gir:13.7-13.28: error: expected end element of `namespace' TelepathyGLib-0.12.gir:14.5-14.4: error: expected end element of `repository' Generation failed: 3 error(s), 0 warning(s)
This must have been due to a mixed up development PREFIX. With the latest version of the 0.10 branch, I don't have this problem. I'll leave this bug open for tracking support of the new <alias><type/></alias> schema that GIR 1.2 uses.
commit 8a6402634b1d138667b5827eb584f702ddd693d0 Author: Evan Nemerson <evan@coeus-group.com> Date: Sun Oct 17 13:41:31 2010 -0700 girparser: Update parsing of alias element to 1.2 syntax