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 669378 - libchamplain-0.12.x vala bindings fail to build: The type name `FontMap' could not be found
libchamplain-0.12.x vala bindings fail to build: The type name `FontMap' coul...
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
: 671807 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-02-04 22:09 UTC by Alexandre Rostovtsev
Modified: 2012-03-12 10:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
complete build log showing the build failure (110.80 KB, text/plain)
2012-02-04 22:09 UTC, Alexandre Rostovtsev
  Details
proposed patch, fixes the build failure (1.98 KB, patch)
2012-02-04 22:13 UTC, Alexandre Rostovtsev
none Details | Review

Description Alexandre Rostovtsev 2012-02-04 22:09:27 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.
Comment 1 Alexandre Rostovtsev 2012-02-04 22:13:17 UTC
Created attachment 206787 [details] [review]
proposed patch, fixes the build failure
Comment 2 Alexandre Rostovtsev 2012-02-04 22:24:56 UTC
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.
Comment 3 Jiri Techet 2012-02-05 22:26:21 UTC
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?
Comment 4 Alexandre Rostovtsev 2012-02-05 22:47:35 UTC
(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.
Comment 5 Jiri Techet 2012-02-06 16:53:54 UTC
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.
Comment 6 Vincent Untz 2012-02-27 14:22:20 UTC
So let's move the bug to vala and see what people say there.
Comment 7 Luca Bruno 2012-02-27 16:30:15 UTC
> 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.
Comment 8 Jiri Techet 2012-03-04 00:13:20 UTC
(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.
Comment 9 Jiri Techet 2012-03-12 00:08:07 UTC
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.
Comment 10 André Klapper 2012-03-12 10:41:16 UTC
*** Bug 671807 has been marked as a duplicate of this bug. ***