Is inclusion in GIR files transitive?



When a GIR file contains an include entry as follows:

  <include name="<name>" version="<version>"/>

does that implicitly include all namespaces that have an include entry in <name>-<version>.gir?

I had been assuming not, i.e. inclusion in GIR files is not transitive. With newer versions of libraries, my GIR processor is complaining about references to namespaces that haven't been included. I see that e.g. Gtk-3.0.gir contains:

  <include name="Atk" version="1.0"/>
  <include name="Gdk" version="3.0"/>
  <include name="xlib" version="2.0"/>

whereas, for older library versions, it used to contain:

  <include name="Atk" version="1.0"/>
  <include name="GLib" version="2.0"/>
  <include name="GModule" version="2.0"/>
  <include name="GObject" version="2.0"/>
  <include name="Gdk" version="3.0"/>
  <include name="GdkPixbuf" version="2.0"/>
  <include name="Gio" version="2.0"/>
  <include name="Pango" version="1.0"/>
  <include name="cairo" version="1.0"/>
  <include name="xlib" version="2.0"/>

Lots of libraries seem to be like this so I am now assuming that inclusion in GIR files _is_ transitive. There isn't a lot to go on in
https://developer.gnome.org/gi/unstable/gi-gir-reference.html

I am now wondering whether that is the right assumption because I am finding that g_irepository_get_dependencies is not returning all transitive dependencies (see attached). It's supposed to because the documentation says so:
https://developer.gnome.org/gi/unstable/GIRepository.html#g-irepository-get-dependencies
Is that just a bug in GIRepository due to a change in the meaning of GIR files?

Thanks,
Phil

Attachment: test1.c
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]