GNOME Bugzilla – Bug 666208
valac doesn't include all required GIR from --pkg switches
Last modified: 2012-01-20 16:26:15 UTC
If valac generates GIR files but doesn't include all --pkg packages required for the code to compile, in this case using g-ir-compiler to create typelib raw fails with segfault (reported on comment to Bug 652391). You can see generated GIR file in attachment (id=203515) in Bug 652391. In this case valac generates GIR without Gee dependency and doesn't include the line: <include name="Gee" version="0.8"/> And if you see the XML include reference to symbols from Gee.
Libgee has no GIR.
I'm sorry, it has a GIR but doesn't have gir_namespace and gir_version information in the vapi.
I'll look into this on Saturday (I'm currently during my exam session). (In reply to comment #2) > I'm sorry, it has a GIR but doesn't have gir_namespace and gir_version > information in the vapi. Hmm. Isn't libgee gir generated by valac?
(In reply to comment #3) > I'll look into this on Saturday (I'm currently during my exam session). > > (In reply to comment #2) > > I'm sorry, it has a GIR but doesn't have gir_namespace and gir_version > > information in the vapi. > > Hmm. Isn't libgee gir generated by valac? The _vapi_ needs gir_namespace and gir_version :) Probably those must be set on top of every namespace Gee { }.
(In reply to comment #4) > (In reply to comment #3) > > I'll look into this on Saturday (I'm currently during my exam session). > > > > (In reply to comment #2) > > > I'm sorry, it has a GIR but doesn't have gir_namespace and gir_version > > > information in the vapi. > > > > Hmm. Isn't libgee gir generated by valac? > > The _vapi_ needs gir_namespace and gir_version :) Probably those must be set on > top of every namespace Gee { }. It worst - it seems that it requires to split: public class Gee.NameOfClass { ... } into [CCode (gir_namespace = "Gee", gir_version = "0.8")] namespace Gee { class NameOfClass { ... } } I'm seriously consider adding to gee/Makefile.am: gee-0.8.vapi: libgee-0.8.la sed -i 's:namespace Gee:[CCode (gir_namespace = "Gee", gir_version = "0.8")]\nnamespace Gee:g' gee-0.8.vapi as 'proper' fix seems to require violate DRY and reformat any code formatting (and this is bad as git merge/git rebase/git blame will stop working). BTW - since the valac knows version in .gir file why it doesn't simply include it into .vapi?
(In reply to comment #5) > (In reply to comment #4) > > (In reply to comment #3) > > > I'll look into this on Saturday (I'm currently during my exam session). > > > > > > (In reply to comment #2) > > > > I'm sorry, it has a GIR but doesn't have gir_namespace and gir_version > > > > information in the vapi. > > > > > > Hmm. Isn't libgee gir generated by valac? > > > > The _vapi_ needs gir_namespace and gir_version :) Probably those must be set on > > top of every namespace Gee { }. > Actually it seems that it needs to be specified in first file passed to vala (see bug #666478). I depend on ordering of compilation to avoid duplication. commit f52493aa5dd77f6415b0a5daf15a73e1c05a0ac2 Author: Maciej Piechotka <uzytkownik2@gmail.com> Date: Mon Dec 19 03:26:37 2011 +0100 Add gir_namespace and gir_version attributes, fixes bug #666208 Currently they are specified in assemblyinfo.vala which needs to be first file passed to vala. See bug # 666478 for details. commit 472ab29f4c757c7dbfd7c24368f31b3423508384 Author: Maciej Piechotka <uzytkownik2@gmail.com> Date: Mon Dec 19 03:26:37 2011 +0100 Add gir_namespace and gir_version attributes, fixes bug #666208 Currently they are specified in assemblyinfo.vala which needs to be first file passed to vala. See bug # 666478 for details.
So this commit landed on the 0.6 branch, but the GIR version there should actually be 1.0, right?
Good spot commit 3f5b960694867a005a0f4f4f09375b846bcc59ed Author: Maciej Piechotka <uzytkownik2@gmail.com> Date: Fri Jan 20 16:24:51 2012 +0000 Fix gir_namespace and gir_version attributes, fixes bug #666208