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 778144 - Allow disabling introspection for ancillary property mechanisms
Allow disabling introspection for ancillary property mechanisms
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: 1.26
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-03 15:02 UTC by Emmanuele Bassi (:ebassi)
Modified: 2017-02-16 16:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
scangobj: Protect style property inspection (1.01 KB, patch)
2017-02-13 21:24 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review
scangobj: Protect style property inspection (1.03 KB, patch)
2017-02-16 16:40 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description Emmanuele Bassi (:ebassi) 2017-02-03 15:02:14 UTC
Currently, GTK-Doc will inspect the type of a class and apply additional introspection rules:

 - for GtkWidget, it will try to extract style properties
 - for GtkContainer, it will try to extract child properties

Of course, this assumes that GTK+ will always ship with those two features.

Sadly, GTK+ 4.x is in the process of deprecating and subsequently removing style properties from GtkWidget; additionally, child properties are not exceedingly loved and may be on the chopping block in a future major API development cycle.

We still want GTK-Doc to generate documentation for style and child properties when dealing with GTK+ and projects based on GTK+ from the 3.x API series, but for we should also have an escape hatch for newer releases without those two sources of properties.

Since this is part of the gtkdoc-scan pass, I think a good solution would be to add a command line argument to that, e.g.

  gtkdoc-scan \
    --disable-widget-style-properties
    --disable-container-child-properties
    …

A different approach would be to check for the GTK+ version currently in use, but then gtk-doc would need to maintain an internal list of what API is available, and an additional command line argument to relay the version information from the build system to gtkdoc-scan, e.g.

  gtkdoc-scan \
    --gtk-version=3.90.1 \
    …
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2017-02-05 17:21:49 UTC
I think adding a #if GTK_CHECK_VERSION into the generated scan code is not a big deal, since this is gtk specific already anyway.
From which version on should I skip them? Are both gone in 3.90.1 already (or is it okay to ignore them starting with this version?).
Comment 2 Emmanuele Bassi (:ebassi) 2017-02-05 18:50:24 UTC
(In reply to Stefan Sauer (gstreamer, gtkdoc dev) from comment #1)
> I think adding a #if GTK_CHECK_VERSION into the generated scan code is not a
> big deal, since this is gtk specific already anyway.
> From which version on should I skip them? Are both gone in 3.90.1 already
> (or is it okay to ignore them starting with this version?).

I'd start from `(3, 89, 0)` to ignore the style properties, as that would allow releasing GTK+ itself without getting compiler warnings and/or errors. The function to list style properties itself was removed in:

https://git.gnome.org/browse/gtk+/commit/?id=6c6ed7496c10e95ba159c141c24d57f7ccd3435f
Comment 3 Emmanuele Bassi (:ebassi) 2017-02-13 21:24:53 UTC
Created attachment 345674 [details] [review]
scangobj: Protect style property inspection

The API to list style properties on GtkWidget was removed in GTK+ 3.89.

We need to protect the call to gtk_widget_class_list_style_properties()
with a version check.
Comment 4 Matthias Clasen 2017-02-14 12:25:06 UTC
this would be very nice to land; I need this patch to be able to build gtk 3.89 snapshots
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2017-02-16 11:32:33 UTC
Review of attachment 345674 [details] [review]:

Thanks for the patch
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2017-02-16 16:40:35 UTC
The following fix has been pushed:
5bd7638 scangobj: Protect style property inspection
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2017-02-16 16:40:44 UTC
Created attachment 345965 [details] [review]
scangobj: Protect style property inspection

The API to list style properties on GtkWidget was removed in GTK+ 3.89.

We need to protect the call to gtk_widget_class_list_style_properties()
with a version check.