GNOME Bugzilla – Bug 598325
libchamplain bindings
Last modified: 2010-04-10 21:00:14 UTC
Bindings for libchamplain and libchamplain-gtk.
Created attachment 145375 [details] champlain bindings
I was about to write up a small Vala sample code snippet that uses this VAPI binding but it seems that as soon as I use this VAPI then valac executes some buggy code path which prints "critical warnings" to the console. I'm unsure whether this is a bug in the VAPI binding or a bug in valac though? mnemo@kingfish:~/projs/howto/vala/libchamplain$ cat main.vala int main (string[] args) { stdout.printf ("hello world\n"); return 0; } mnemo@kingfish:~/projs/howto/vala/libchamplain$ valac main.vala mnemo@kingfish:~/projs/howto/vala/libchamplain$ valac main.vala --pkg=champlain-0.4 --vapidir=../../../vala/vapi_bindings ** (valac:18892): CRITICAL **: vala_class_add_hidden_method: assertion `self != NULL' failed ** (valac:18892): CRITICAL **: vala_class_add_hidden_method: assertion `self != NULL' failed ** (valac:18892): CRITICAL **: vala_class_add_hidden_method: assertion `self != NULL' failed ** (valac:18892): CRITICAL **: vala_class_add_hidden_method: assertion `self != NULL' failed ** (valac:18892): CRITICAL **: vala_class_add_hidden_method: assertion `self != NULL' failed mnemo@kingfish:~/projs/howto/vala/libchamplain$ gdb --args env G_DEBUG=fatal-warnings valac main.vala --pkg=champlain-0.4 --vapidir=../../../vala/vapi_bindings Reading symbols from /usr/bin/env...(no debugging symbols found)...done. (gdb) r Executing new program: /usr/bin/valac ** CRITICAL **: vala_class_add_hidden_method: assertion `self != NULL' failed aborting... Program received signal SIGABRT, Aborted. 0x00007ffff71624b5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. in ../nptl/sysdeps/unix/sysv/linux/raise.c (gdb) bt
+ Trace 218403
So basically when I run valac without this VAPI it works but as soon as I add the --pkg=champlain-0.4 --vapidir=../../../vala/vapi_bindings parameters as well the GLib critical errors appear.
Tomaz do you have a small sample program that uses this VAPI btw? That would be useful for validating the correctness of the VAPI with respect to memory leaks etc (i.e. using valgrind).
Created attachment 145788 [details] ChamplainExample.vala
Hi. I have now attached an example. To compile I used: valac \ --thread \ --pkg clutter-1.0 \ --pkg gtk+-2.0 \ --pkg champlain-0.4 \ --pkg champlain-gtk-0.4 \ --vapidir=./ \ ChamplainExample.vala -o ChamplainExample At compiling I also get: ** (valac:27815): CRITICAL **: vala_class_add_hidden_method: assertion `self != NULL' failed I don't know what is wrong here, but I get the same also with clutter-gtk bindings. However the compilation finishes without other errors and produces an executable. When starting I get: (<unknown>:27874): ClutterGLX-CRITICAL **: Unable to make the stage window 0x5a0002b the current GLX drawable But this is probably related to clutter initialization. If I use clutter-gtk init everything is fine, but clutter-gtk bindings are also not yet included in vala. regards, Tomaž
I'd be happy to get these integrated in the source tree of libchamplain. Provide me with a patch that installs everything using autotools and it'll be cool :) Actually, I did look for documentation on how to do that, or another project that installs vala bindings, but couldn't find any.
Tomaz, Anything going on with this? IMHO it would be better to get the bindings distributed upstream, if you're comfortable with that. Just not sure if I should close the bug or not.
Yes, the bindings will be distributed upstream - I hope when the next stable and unstable versions comes out.. if Pierre-Luc agrees. :)
Yes, if having the bindings upstream is the way to go, then I agree. I'll wait for the updated patch or git branch against libchamplain 0.4.4.
Hi, The bindings have been now added upstream so this bug can be closed. regards, Tomaž