Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken vala bindings (again) #289

Closed
ricotz opened this issue Nov 19, 2020 · 5 comments
Closed

Broken vala bindings (again) #289

ricotz opened this issue Nov 19, 2020 · 5 comments
Labels

Comments

@ricotz
Copy link
Contributor

ricotz commented Nov 19, 2020

due to b52858b

There was a lengthy discussion regarding those annotations, see #214 and #208

If python is actually iterating over the elements of a GPtrArray to free them then this is wrong. It should be advised to use the available GLib API.

@tintou
Copy link
Contributor

tintou commented Nov 19, 2020

I raised this issue to GObject Introspection and there is a lack of annotation for this. The current way of dealing with this is to use g_ptr_array_set_free_func (ptrarray, NULL); before returning the GPtrArray…
See how GNOME Builder is doing this when returning a GPtrArray

@ximion
Copy link
Owner

ximion commented Nov 19, 2020

I can't remove the free function, as this would break the C API.
Wow, this sucks... Can't either Vala, Python or GIR be fixed to address this?

@ricotz
Copy link
Contributor Author

ricotz commented Nov 19, 2020

As a mitigation you can add a metadata file for vala to tweak the generated vapi.

@ximion
Copy link
Owner

ximion commented Nov 19, 2020

That may be the best temporary fix...
At the moment it seems like I can choose between breaking all C users of libappstream, breaking Appcenter via Vala bindings, or breaking Python applications with the previous change that made Vala work (as reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=974107 ).

@ximion ximion added the bug label Nov 29, 2020
@ximion
Copy link
Owner

ximion commented Nov 29, 2020

How would I have to change the Vala metadata to fix this for Vala? I would like to go this route for the next release (scheduled for Monday), and maybe find a more permanent solution later.
Unfortunately, there doesn't seem to be a workaround for Python.

ricotz added a commit to ricotz/appstream that referenced this issue Nov 30, 2020
@ximion ximion closed this as completed in ba85567 Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants