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 667837 - GObject Introspection trunk Breaks APIs in autogenerated GIR files
GObject Introspection trunk Breaks APIs in autogenerated GIR files
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal critical
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-01-13 00:07 UTC by Daniel Espinosa
Modified: 2016-04-21 20:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Espinosa 2012-01-13 00:07:02 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.
Comment 1 Colin Walters 2012-10-30 13:38:12 UTC
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 ?
Comment 2 Daniel Espinosa 2012-11-06 00:15:51 UTC
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?
Comment 3 Emmanuele Bassi (:ebassi) 2013-08-26 09:57:34 UTC
is this still valid? given that it happened > 1.5 years ago, should we just close this?
Comment 4 André Klapper 2015-02-07 17:14:24 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]