GNOME Bugzilla – Bug 772902
gio bindings regression
Last modified: 2016-10-15 19:18:18 UTC
Hi, While mdbus2 from FSO project builds with vala 0.34.x, the resulting binary is not really functional. With 0.32.x everything worked fine. I tracked this down to commit 1efb947c15eb682383240dd09a181b5818b22156, which should be reverted. If you want to test it, just use [0]. The code's builds deps are just vala, glib and libreadline. [0] https://github.com/freesmartphone/mdbus -- Sebastian
That commit for gio-2.0.vapi has removed the CCode detail, array_null_terminated = true, for a number of fields holding references to arrays ( see https://git.gnome.org/browse/vala/diff/vapi/gio-2.0.vapi?id=1efb947c15eb682383240dd09a181b5818b22156 ). So the working assumption would be that this is the cause of the problem. Adding those details back should fix the problem. They can be added back manually to test this, but the long term fix is to find out why they were removed. Taking DBusAnnotationsInfo.annotations as an example, the documentation ( https://developer.gnome.org/gio/stable/gio-D-Bus-Introspection-Data.html#GDBusAnnotationInfo-struct ) states "A pointer to a NULL-terminated array of pointers..." and the GObject Introspection annotation is shown as [array zero-terminated=1]( see https://git.gnome.org/browse/glib/tree/gio/gdbusintrospection.h ). Looking at the history of gdbusintrospection.h there have been no changes to this file since January 2014, so that rules out a change in the annotation causing a problem. So this leaves g-ir-scanner that generates the GIR or vapigen that generates the VAPI for investigation.
Created attachment 337701 [details] [review] girparser: More complete parsing of field information Especially to retrieve available array-length information.
Created attachment 337702 [details] [review] gio-2.0: Regenerate for girparser changes
(In reply to Al Thomas from comment #1) > That commit for gio-2.0.vapi has removed the CCode detail, > array_null_terminated = true, for a number of fields holding references to > arrays ( see > https://git.gnome.org/browse/vala/diff/vapi/gio-2.0. > vapi?id=1efb947c15eb682383240dd09a181b5818b22156 ). So the working > assumption would be that this is the cause of the problem. Adding those > details back should fix the problem. Sorry, I should have been more verbose in the bug report. I actually noticed, that array_null_terminated was removed between 0.32 and 0.34. Then I tried to add array_null_terminated to the 0.34 vapi file and mdbus worked again. Only then I searched for the commit, which removed the annotation. The "gio-2.0: Regenerate for girparser changes" attachment from Rico is what I did manually. > They can be added back manually to test this, but the long term fix > is to find out why they were removed. I maintain mdbus for Debian, so that is not an option. I can add the patch to our vala package until it is fixed in an upstream release, though. P.S.: Thanks for your speedy processing :) -- Sebastian
Created attachment 337761 [details] [review] girparser: More complete parsing of field information Especially to retrieve available array-length information.
commit 77dabfba681a3f5cc803ae862e0de0290d9a3588 Author: Rico Tzschichholz <ricotz@ubuntu.com> Date: Sat Oct 15 21:05:10 2016 +0200 Regenerate for GIR-based bindings including array-related metadata fixes commit 92d6204a1c153c73abba73abb826122619c864ee Author: Rico Tzschichholz <ricotz@ubuntu.com> Date: Fri Oct 14 09:22:27 2016 +0200 girparser: More complete parsing of field information Especially to retrieve available array-length information.