GNOME Bugzilla – Bug 669378
libchamplain-0.12.x vala bindings fail to build: The type name `FontMap' could not be found
Last modified: 2012-03-12 10:41:16 UTC
Created attachment 206786 [details] complete build log showing the build failure libchamplain-0.12.1 and 0.12.0 fails to build with --enable-vala: ( /usr/bin/vapigen-0.14 --library champlain-0.12 --pkg clutter-1.0 --pkg atk --pkg pangocairo ./Champlain-0.12.gir ) /usr/bin/g-ir-compiler --includedir=. Champlain-0.12.gir -o Champlain-0.12.typelib ** (vapigen-0.14:4045): CRITICAL **: vala_code_node_get_attribute_string: assertion `self != NULL' failed [...] ** (vapigen-0.14:4045): CRITICAL **: vala_gir_parser_add_symbol_to_container: assertion `sym != NULL' failed CoglPango-1.0.gir:63.61-63.61: error: The type name `FontMap' could not be found <type name="FontMap" c:type="CoglPangoFontMap*"/> ^ CoglPango-1.0.gir:78.61-78.61: error: The type name `FontMap' could not be found <type name="FontMap" c:type="CoglPangoFontMap*"/> ^ CoglPango-1.0.gir:93.61-93.61: error: The type name `FontMap' could not be found <type name="FontMap" c:type="CoglPangoFontMap*"/> ^ CoglPango-1.0.gir:109.61-109.61: error: The type name `FontMap' could not be found <type name="FontMap" c:type="CoglPangoFontMap*"/> ^ CoglPango-1.0.gir:132.61-132.61: error: The type name `FontMap' could not be found <type name="FontMap" c:type="CoglPangoFontMap*"/> ^ CoglPango-1.0.gir:151.61-151.61: error: The type name `FontMap' could not be found <type name="FontMap" c:type="CoglPangoFontMap*"/> ^ Generation failed: 6 error(s), 0 warning(s) make[3]: *** [champlain-0.12.vapi] Error 1 I am seeing this failure on on a Gentoo machine with vala-0.14.2, gobject-introspection-1.30.0, cogl-1.8.2, and clutter-1.8.4. The complete build log of the build failure is attached. Adding "--pkg cogl-pango-1.0" to vapigen's argument list (as suggested in bug #667751) fixes the problem and allows the build to complete successfully.
Created attachment 206787 [details] [review] proposed patch, fixes the build failure
Note that cogl-pango-1.0 vala bindings are, at the moment, included only in vala-0.15.1 and greater. I have filed bug #669379 to also get them included in the next vala-0.14.x release.
Hmm, with the patch it doesn't compile on my Ubuntu 11.10 box. I'd like to avoid patches which require the latest version of some library because it will fail to compile on all the older distributions. I'm wondering why it failed to compile in the first place - it compiles fine here (without the patch) and libchamplain doesn't use CoglPangoFontMap anywhere so it looks there were some changes in clutter/cogl which add some extra dependencies - isn't it actually a bug in clutter/cogl?
(In reply to comment #3) > I'm wondering why it failed to compile in the first place - it compiles fine > here (without the patch) You are probably building with an older version of vala. It seems that the failure occurs only when using >=vala-0.14.2.
Yes, that's clear. What I meant by the sentence was "what has changed in >=vala-0.14.2 (or clutter/cogl from which the vapi's originate) that it doesn't compile any more". In my opinion there shouldn't be any changes in the vapi's that force you to add extra packages during compilation. Otherwise it's hard to maintain compatibility with older distributions.
So let's move the bug to vala and see what people say there.
> In my opinion there shouldn't be any changes in the vapi's that force you to > add extra packages during compilation. Otherwise it's hard to maintain > compatibility with older distributions. But somebody added CoglPango gir recently, and cogl-pango vapi is available only with recent vala.
(In reply to comment #6) > So let's move the bug to vala and see what people say there. One more possibility is to distribute libchamplain's vapis with vala so there's always the right libchampalin's vapi version with the corresponding vala version. Compilation of libchamplain with vala support would be only used to generate the vapi for the given vala version and it wouldn't be necessary to do for ordinary users. I actually don't know why libchampalin's vapi isn't distributed with vala. If I remember correctly someone on the mailing list said it was discussed in the past and the conclusion was "no" but I don't know the reason why.
OK, so I have released libchamplain 0.12.2 with the patch and disabled vala regeneration during distcheck - see more here: http://mail.gnome.org/archives/libchamplain-list/2012-March/msg00000.html --enable-vala won't work for 0.14.2 (and because of the patch anything lower) but because the vapis are distributed with libchamplain, ordinary people shouldn't need to re-generate them. At the end I've decided not to include libchamplain in vala - it's API isn't stable yet and then it would become problematic which version to ship with vala.
*** Bug 671807 has been marked as a duplicate of this bug. ***