After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 772902 - gio bindings regression
gio bindings regression
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings: GLib
0.34.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2016-10-14 00:17 UTC by Sebastian Reichel
Modified: 2016-10-15 19:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
girparser: More complete parsing of field information (1.04 KB, patch)
2016-10-14 11:37 UTC, Rico Tzschichholz
none Details | Review
gio-2.0: Regenerate for girparser changes (3.79 KB, patch)
2016-10-14 11:37 UTC, Rico Tzschichholz
committed Details | Review
girparser: More complete parsing of field information (2.62 KB, patch)
2016-10-15 16:57 UTC, Rico Tzschichholz
committed Details | Review

Description Sebastian Reichel 2016-10-14 00:17:30 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
Comment 1 Al Thomas 2016-10-14 11:31:48 UTC
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.
Comment 2 Rico Tzschichholz 2016-10-14 11:37:00 UTC
Created attachment 337701 [details] [review]
girparser: More complete parsing of field information

Especially to retrieve available array-length information.
Comment 3 Rico Tzschichholz 2016-10-14 11:37:16 UTC
Created attachment 337702 [details] [review]
gio-2.0: Regenerate for girparser changes
Comment 4 Sebastian Reichel 2016-10-14 12:23:25 UTC
(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
Comment 5 Rico Tzschichholz 2016-10-15 16:57:29 UTC
Created attachment 337761 [details] [review]
girparser: More complete parsing of field information

Especially to retrieve available array-length information.
Comment 6 Rico Tzschichholz 2016-10-15 19:17:58 UTC
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.