GNOME Bugzilla – Bug 667837
GObject Introspection trunk Breaks APIs in autogenerated GIR files
Last modified: 2016-04-21 20:01:12 UTC
Latest trunk in http://git.gnome.org/browse/gobject-introspection breaks API while fix generated code. GDA has support for autogenerated GIR files since 4.x versions. Now on 5.0, if you generate GIR from GObject Introspection master you'll find the following difference: + <constructor name="new" c:identifier="gda_data_proxy_new"> <doc xml:whitespace="preserve">Creates a new proxy for @model</doc> <return-value transfer-ownership="full"> <doc xml:whitespace="preserve">a new #GdaDataProxy object</doc> @@ -7665,6 +7660,11 @@ still forming a valid SQL syntax).</doc> <type name="DataModel" c:type="GdaDataModel*"/> </parameter> </parameters> + </constructor> + <function name="error_quark" c:identifier="gda_data_proxy_error_quark"> + <return-value transfer-ownership="none"> + <type name="GLib.Quark" c:type="GQuark"/> + </return-value> </function> Forget 'error-quark'. Before in 1.30 of GI, GIR defines a function called new for Gda.DataProxy object with a Gda.DataModel parameter to create a new object. This was a mistake from start because that must be a constructor with Gda.DataModel parameter and is fixed in master. But now any code that wants to use Gda.DataProxy.new (Gda.DataModel) will fails in future autogenerated GIR. Due to GDA has a 5.0 and new developments will be 5.x with API/ABI stable for a while, this will represent a problem with bindings. On Vala binding side, I can add a definition for Gda.DataProxy.new in a custom file to avoid to break API. But what about Python, JavaScript, and others that use directly GIR. Even Vala is moving to GIR too. May be is necesary to backport immediately to 1.30, announce it to allow any project to take care about that. Including a dependency on GI 1.30.1.
I'm not sure exactly what happened between 1.30.0 and 1.30.1 that could break something like this. Possibly https://bugzilla.gnome.org/show_bug.cgi?id=661677 ? But can you please add a pointer to your code at least? Even better, a test case in tests/scanner/regress.h ?
I don't think this bug is Bug 661677 related. Code is located at: http://git.gnome.org/browse/libgda/tree/libgda/gda-data-proxy.c Line 819, method gda_data_proxy_new(). I've added a new method Gda.DataProxy.new_with_data_model() to be used by bindings. Help me. I have to use jhbuild to access a GI version 1.30, then add my test case and finally verify it on resent version 1.34? What I need to verify? 1) Generated binding in 1.30 must be equal in 1.34? I mean 1.34 must generate same binding as in 1.30? I mean, in my case: a constructor like: foo_new (GObject object) {} in 1.30 must generate a Foo.new(GLib.Object) binding (in terms of gir format of course). in 1.34 must generate a Foo.new(GLib.object) **AND** a Foo(GLib.Object) function, this must keeps API from 1.30. I this correct?
is this still valid? given that it happened > 1.5 years ago, should we just close this?
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]