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 738171 - (skip) annotation on a parameter causes GI build failure
(skip) annotation on a parameter causes GI build failure
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
2.42.x
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks: 738176
 
 
Reported: 2014-10-08 18:53 UTC by Mikhail Zabaluev
Modified: 2015-03-04 20:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
giscanner: fix GIRParser skip handling (1.10 KB, patch)
2014-12-05 23:26 UTC, Dieter Verfaillie
none Details | Review
giscanner: enable the --reparse-validate option for our test suite (2.40 KB, patch)
2014-12-10 16:29 UTC, Dieter Verfaillie
reviewed Details | Review
giscanner: enable the --reparse-validate option for our test suite (2.73 KB, patch)
2014-12-12 21:09 UTC, Dieter Verfaillie
none Details | Review

Description Mikhail Zabaluev 2014-10-08 18:53:46 UTC
I wanted to try out using (skip) on parameter names, using the makefile rule to build GLib-2.0.gir out of gir/glib-2.0.c in the gobject-introspection tree. This appears to be unsupported by the Python GIR scanner, which breaks the build:

ERROR: Failed to re-parse gir file; scanned='/tmp/tmpG3uu_B.gir' passthrough='/tmp/tmpcUH5t9.gir'

The passthrough file lacks skip="1" attribute on the parameter element.
Comment 1 Dieter Verfaillie 2014-12-05 23:19:38 UTC
Yeah. The same happens annotating return values with (skip).
Comment 2 Dieter Verfaillie 2014-12-05 23:26:33 UTC
Created attachment 292221 [details] [review]
giscanner: fix GIRParser skip handling

The skip annotation on symbols ends up as an introspectable xml attribute
but on paramters and the return value a skip attribute is written.
Making GIRParser read the skip attribute fixes g-ir-scanner's
passthrough gir test for skipped attributes and/or return values.
Comment 3 Dieter Verfaillie 2014-12-10 16:29:50 UTC
Created attachment 292455 [details] [review]
giscanner: enable the --reparse-validate option for our test suite

giscanner: enable the --reparse-validate option for our test suite

Doing so reveals GIRParser did not yet support:
- the (skip) annotation on parameters and return values
- the (attributes) annotation

This patch fixes both issues an prevents further similar problems.

https://bugzilla.gnome.org/show_bug.cgi?id=738171
Comment 4 Johan (not receiving bugmail) Dahlin 2014-12-12 20:42:05 UTC
Review of attachment 292455 [details] [review]:

Just my 2 cents.

::: giscanner/girparser.py
@@ +169,3 @@
+        skip = node.attrib.get('skip')
+        if skip:
+            obj.skip = int(skip) > 0

You may want to catch ValueError here, which will be raised for empty strings or non-numbers.

@@ +202,3 @@
+        attributes = node.findall(_corens('attribute'))
+        if attributes:
+            _attributes = OrderedDict()

nitpick, trailing underscores (eg attributes_) is more common for things that conflict. A leading underscore (eg, _attributes) implies that it is private or hidden.
Comment 5 Dieter Verfaillie 2014-12-12 21:09:45 UTC
Created attachment 292636 [details] [review]
giscanner: enable the --reparse-validate option for our test suite

Thanks for the review!
Fixes both issues mentioned above.
Comment 6 André Klapper 2015-02-07 17:22:36 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 7 Dieter Verfaillie 2015-03-04 20:04:23 UTC
Thanks for the review. Attachment #292636 [details] pushed as 5a137d0, including fixes for the nitpicks mentioned in comment #4.