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 563794 - Redo annotation parsing & applying
Redo annotation parsing & applying
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Johan (not receiving bugmail) Dahlin
gobject-introspection Maintainer(s)
Depends on:
Blocks: 565147
 
 
Reported: 2008-12-09 01:52 UTC by Johan (not receiving bugmail) Dahlin
Modified: 2015-02-07 16:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
v1: work in progress (38.17 KB, patch)
2008-12-09 01:53 UTC, Johan (not receiving bugmail) Dahlin
none Details | Review
v2: getting there (56.91 KB, patch)
2008-12-10 02:01 UTC, Johan (not receiving bugmail) Dahlin
none Details | Review
v3 (58.06 KB, patch)
2008-12-20 20:39 UTC, Johan (not receiving bugmail) Dahlin
none Details | Review
passes make check (46.24 KB, patch)
2008-12-31 03:35 UTC, Colin Walters
none Details | Review
include annotationparser.py (63.16 KB, patch)
2008-12-31 03:38 UTC, Colin Walters
none Details | Review
v4 (63.56 KB, patch)
2009-01-03 02:14 UTC, Johan (not receiving bugmail) Dahlin
none Details | Review
v5 (69.84 KB, patch)
2009-01-03 14:24 UTC, Johan (not receiving bugmail) Dahlin
none Details | Review

Description Johan (not receiving bugmail) Dahlin 2008-12-09 01:52:14 UTC
Annotation parsing is a bit messy right now.
We should take advantage of having python ready and use to do as much as possible of the parsing. Annotation is also conceptually different from transforming, so the tasks should also be separated. (eg, separate modules)

This is needed for sanity, especially since we soon have to parse annotations for signals and properties.
Comment 1 Johan (not receiving bugmail) Dahlin 2008-12-09 01:53:33 UTC
Created attachment 124228 [details] [review]
v1: work in progress

This patch is mainly removing a lot of code.
It's doing all comment parsing in python code, and support Since/transfer/inout/out.
Comment 2 Johan (not receiving bugmail) Dahlin 2008-12-10 02:01:46 UTC
Created attachment 124320 [details] [review]
v2: getting there

This is the result of tonight's hacking. The new parser can almost parse the complete annotations specified in annotation.[ch]. Getting pretty close now.
Comment 3 Colin Walters 2008-12-20 02:23:27 UTC
This is looking quite good.  I was about to start on bug 555036 and this patch would make it significantly easier (nearly trivial).

Is this patch the latest?  If so I may try to pick it up and finish it this weekend.
Comment 4 Johan (not receiving bugmail) Dahlin 2008-12-20 02:42:53 UTC
No, there's one newer version which passes annotation/drawable but still fails in a couple of places in foo. I'll attach it tomorrow. (just need to unpack the HD it's on)
Comment 5 Johan (not receiving bugmail) Dahlin 2008-12-20 20:39:41 UTC
Created attachment 125064 [details] [review]
v3

Latest patch, against trunk. Misses porting of patch from bug 563934, should be too hard though.
Comment 6 Colin Walters 2008-12-31 03:35:33 UTC
Created attachment 125557 [details] [review]
passes make check

This version passes make check.  Highlights are:

* Handle fields+arrays specially; we can't really rely on annotation passes to turn things into Array because we don't have the parse tree around anymore, and we lose data without it

* Key bugfixes: code was doing is_param = isinstance(node.type, Param) when foo.type is never a Param, but obviously node is

See the interdiff for details
Comment 7 Colin Walters 2008-12-31 03:38:11 UTC
Created attachment 125558 [details] [review]
include annotationparser.py

Previous patch was lacking annotationparser.py (explaining how it somehow became smaller).
Comment 8 Johan (not receiving bugmail) Dahlin 2009-01-01 15:13:53 UTC
(In reply to comment #7)
> Created an attachment (id=125558) [edit]
> include annotationparser.py
> 
> Previous patch was lacking annotationparser.py (explaining how it somehow
> became smaller).
> 

Woho! Thanks for completing this Colin. Looks great and all.
I'm just slightly worried that it might break gir-repository, since there's plenty of annotations in there, some of the combinations might not be tested in g-i itself. I'd just like to verify that Gtk-2.0.gir doesn't change with this patch applied. Apart from that just commit it.
Comment 9 Johan (not receiving bugmail) Dahlin 2009-01-03 02:14:02 UTC
Created attachment 125673 [details] [review]
v4

make check in gir-repository passes with this, however Gtk-2.0.gir has changed transfer of parameter from full to none for all object references, not sure why.
Comment 10 Johan (not receiving bugmail) Dahlin 2009-01-03 14:24:10 UTC
Created attachment 125684 [details] [review]
v5

Updated for trunk after bug 556489 got solved, however make check doesn't pass any longer. We need to know if a parameter is referring to an object or interface to solve this properly.
Comment 11 Johan (not receiving bugmail) Dahlin 2009-01-12 20:14:33 UTC
I landed this, let's fix regressions as we find them, but it should really be quite okay.
Comment 12 André Klapper 2015-02-07 16:44:44 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]