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 629649 - vapigen errors on GIR 1.2 <alias/> element
vapigen errors on GIR 1.2 <alias/> element
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings
0.9.x
Other Linux
: Normal major
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-14 12:10 UTC by Philip Withnall
Modified: 2010-11-08 10:14 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philip Withnall 2010-09-14 12:10:19 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.
Comment 1 Jürg Billeter 2010-09-14 13:25:10 UTC
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.
Comment 2 Philip Withnall 2010-09-14 14:09:34 UTC
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.
Comment 3 Travis Reitter 2010-09-15 22:54:46 UTC
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.
Comment 4 Travis Reitter 2010-09-15 22:55:38 UTC
(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)
Comment 5 Travis Reitter 2010-09-16 16:03:50 UTC
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.
Comment 6 Evan Nemerson 2010-11-08 10:14:11 UTC
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