1 Notes to developers hacking on GObjectIntrospection
2 ===================================================
7 Some bindings are not generated by the libraries themselves, usually
8 for dependency reasons, but are updated through some ad hoc utilities.
10 Updating GLib, Gio, GModule, GObject bindings:
12 $ git clone https://gitlab.gnome.org/GNOME/glib.git
15 $ ./misc/update-glib-annotations.py glib/
18 In short, build gobject-introspection in the `_build` directory, and
19 run the script on a `glib` checkout.
24 * You can use the GI_SCANNER_DEBUG environment variable; see utils.py
25 for a list of debug flags.
27 * It is possible to debug the various g-ir-* tools using PyDev's remote debugger.
29 - locate the directory that contains the pydevd.py file matching the PyDev version
30 running in your Eclipse instance. This might look like:
31 /usr/lib64/eclipse/dropins/pydev-core/eclipse/plugins/org.python.pydev_4.0.0.201505131500/pysrc/)
32 - open the "Debug" perspective in your Eclipse instance, open the "PyDev" menu and start the
34 - execute the g-ir-* tool setting the GI_SCANNER_DEBUG and PYDEVDPATH environment variables.
36 GI_SCANNER_DEBUG="pydevd" PYDEVDPATH="/usr/lib64/eclipse/dropins/pydev-core/eclipse/plugins/org.python.pydev_4.0.0.201505131500/pysrc/" g-ir-scanner <parameters>
37 - In the example above, the PyDev debugger will run g-ir-scanner and stop execution in the main
38 script. You can then set extra breakpoints, step through the code, inspect variables at the
39 current scope, inspect the stack and so forth.
45 * If you add a new warning to annotationparser.py, you should add new
46 tests for it in tests/scanner/annotationparser/gi/
48 * If you add a new warning elsewhere (maintransformer.py, etc), you
49 should add a new test for it in tests/warn/
51 * Before pushing code to the repository, make sure to run 'make check' or
54 * While hacking on annotationparser.py it is a good idea to:
55 1) Update your GLib build to git master.
56 2) Run the following command from your gobject-introspection source directory before making
57 changes to annotationparser.py (adapt GLib source and/or build directory as required):
58 (cd misc && ./update-glib-annotations.py /path/to/gnome.org/checkout/glib/)
59 3) Ensure changes to the following files are as expected, meaning they are caused by
60 updated GLib annotations and not by stray modifications to annotationparser.py:
64 When satisfied, commit these files adding "Update GLib annotations to master" as the
66 4) Only now start editing annotationparser.py.
68 6) Run update-glib-annotations.py again and carefully study the changes (if any) to:
72 Ensure changes in these files are as intended and caused by the modifications done to
73 annotationparser.py. Commit the changes to annotationparser.py and the above
74 files as a single patch.