[Vala] Can't compile GIR file generated by Vala



Hi all:

I created a simple library with this code:

usingGLib;
// using GIO;
usingPosix;
namespaceFreedesktopPortals{
publicGLib.UnixFDListcreateUnixFDList(GLib.Filefile, boolwritable) {
varfdList =newGLib.UnixFDList();
varfileFd =Posix.open(file.get_path(), writable ?Posix.O_RDONLY:Posix.O_RDWR, 0);
        fdList.append(fileFd);
Posix.close(fileFd);
returnfdList;
    }
}

And compiled that file with also this other piece of code for constants:

namespaceFreedesktopPortalsConstants{
publicconststringDATADIR="/usr/local/share";
publicconststringPKGDATADIR="/usr/local/share/testOpenFile";
publicconststringGETTEXT_PACKAGE="testOpenFile";
publicconststringRELEASE_NAME="testOpenFile";
publicconststringVERSION="1.0.0";
}

After creating a library, the vala compiler generates this .GIR file:

<?xmlversion="1.0"?>
<repositoryversion="1.2"xmlns="http://www.gtk.org/introspection/core/1.0"xmlns:c="http://www.gtk.org/introspection/c/1.0"xmlns:glib="http://www.gtk.org/introspection/glib/1.0";>
<includename="Gio"version="2.0"/>
<packagename="FreedesktopPortals"/>
<c:includename="FreedesktopPortals.h"/>
<namespacename="FreedesktopPortals"version="1.0"c:prefix="FreedesktopPortalsConstants">
<constantname="DATADIR"c:identifier="FREEDESKTOP_PORTALS_CONSTANTS_DATADIR"value="/usr/local/share">
<typename="utf8"c:type="const gchar*"/>
</constant>
<constantname="PKGDATADIR"c:identifier="FREEDESKTOP_PORTALS_CONSTANTS_PKGDATADIR"value="/usr/local/share/testOpenFile">
<typename="utf8"c:type="const gchar*"/>
</constant>
<constantname="GETTEXT_PACKAGE"c:identifier="FREEDESKTOP_PORTALS_CONSTANTS_GETTEXT_PACKAGE"value="testOpenFile">
<typename="utf8"c:type="const gchar*"/>
</constant>
<constantname="RELEASE_NAME"c:identifier="FREEDESKTOP_PORTALS_CONSTANTS_RELEASE_NAME"value="testOpenFile">
<typename="utf8"c:type="const gchar*"/>
</constant>
<constantname="VERSION"c:identifier="FREEDESKTOP_PORTALS_CONSTANTS_VERSION"value="1.0.0">
<typename="utf8"c:type="const gchar*"/>
</constant>
</namespace>
<c:includename="FreedesktopPortals.h"/>
<namespacename="FreedesktopPortals"version="1.0"c:prefix="FreedesktopPortals">
<functionname="createUnixFDList"c:identifier="freedesktop_portals_createUnixFDList">
<return-valuetransfer-ownership="full">
<typename="Gio.UnixFDList"c:type="GUnixFDList*"/>
</return-value>
<parameters>
<parametername="file"transfer-ownership="none">
<typename="Gio.File"c:type="GFile*"/>
</parameter>
<parametername="writable"transfer-ownership="none">
<typename="gboolean"c:type="gboolean"/>
</parameter>
</parameters>
</function>
</namespace>
</repository>

The problem is that, when I try to compile it with:

    g-ir-compiler --shared-library=FreedesktopPortals FreedesktopPortals-1.0.gir --output FreedesktopPortals-1.0.typelib

I receive a core dump:

    (g-ir-compiler:4638): GLib-CRITICAL **: 01:05:06.777: g_hash_table_lookup_extended: assertion 'hash_table != NULL' failed
    `trap' para punto de parada/seguimiento

If I remove one of the namespaces block in the GIR, or if I mix both in the same, the compiler works fine.

My questions are:

 - Am I doing something wrong? What?

 - If not, is this a bug in Vala, or in G-IR (to fill the bug in the right place)

Thanks.

--
Nos leemos
                         RASTER    (Linux user #228804)
raster rastersoft com              http://www.rastersoft.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]