Re: [Vala] Call For Help: Switch to Gio Gir
- From: Abderrahim Kitouni <a kitouni gmail com>
- To: Luca Bruno <lethalman88 gmail com>
- Cc: vala-devel-list gnome org
- Subject: Re: [Vala] Call For Help: Switch to Gio Gir
- Date: Thu, 30 Dec 2010 18:46:40 +0100
Hi,
في ح، 26-12-2010 عند 12:33 +0100 ، كتب Luca Bruno:
> The plan is to make the gio-2.0.vapi generated from the gir close to the
> current one so that we can:
> 1) Test and improve the gir parser
> 2) Have backward compatibility and less breakage as possible if a day we'll
> really switch to Gio-2.0.gir
What I tried to do to test this is to run vala's tests with the new
vapi, I found some problems (the tests still don't compile, but that's
probably the hard task: once they compile it would be trivial to fix any
crashes):
1) Gio-2.0.gir contains both gio-2.0 and gio-unix-2.0 (filedescriptor
test uses both). So the assumption that there is a one-to-many
replationship doesn't hold :-(
2) ByteArray isn't supported, so this
<property name="path-as-array"
writable="1"
construct-only="1"
transfer-ownership="none">
<array name="GLib.ByteArray">
<type name="gpointer" c:type="gpointer"/>
</array>
</property>
is mapped to :
public void*[] path_as_array { owned get; construct; }
which valac can't even parse (this is with glib master as of December
25th, not the gir you suggested).
3) InputStream.read takes void* buffer, size_t count instead of uint8[]
buffer
4) when manually fixing the above (replacing gio-unix-2.0.vapi with an
empty file, deleting the unparsable properties, and fixing read), there
is still problems with the generated code (related to gio-unix), but the
fact it got there (there seems to be only 2 tests after filedescriptor),
I think it's in relatively good shape :-)
Another thing that annoys me is ref/unref/free functions that aren't
hidden (plus the ugly CCode annotations that use g_boxed_* and
*_get_type). I know this is bug 572415, but maybe vapigen can second
guess the g-i scanner?
A comment about your workflow:
> Workflow:
> 1) Create the switch-to-gir-gio local branch and build it,
> say your vala source dir is $SRC
> 2) If you don't have the latest 1.2 gir, download them from
> http://code.coeusgroup.com/gir-1.0/ into $SRC/gir
> 3) cd $SRC/gir and build the new gio-2.0.vapi with the following command:
>
> ../vapigen/vapigen --girdir . --metadatadir ../vapi/metadata --library
> gio-2.0 Gio-2.0.gir ../vapi/metadata/gio-2.0-custom.vala
>
> 4) Generate a diff with the old gio vapi:
>
> diff -urN ../vapi/gio-2.0.vapi gio-2.0.vapi
I'm doing this in the vapi directory and using git diff (bonus, I can
run 'make -C .. check' and watch the tests break ;-p)
Regards,
Abderrahim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]