GNOME Bugzilla – Bug 677591
Gir parser does not resolve symbols on namespace conflicts
Last modified: 2018-05-22 14:26:43 UTC
While trying to write proper metadata for the NetworkManager bindings, I stumbled upon the following error output: NMClient-1.0.gir:129.85-129.85: error: The type name `DBus.Connection' could not be found <type name="DBusGLib.Connection" c:type="DBusGConnection*"/> The cause of the problem is that I am declaring a NM.DBus namespace in a previous vapi/metadata file (for the NetworkManager-1.0.gir file, on which NMClient-1.0.gir depends): DBUS_* parent="NM.DBus" cheader_filename="NetworkManager.h" name="DBUS_(.+)" DBUS_PATH_VPN parent="NM.DBus" cheader_filename="NetworkManagerVPN.h" name="DBUS_(.+)" DBUS_PATH_VPN_CONNECTION parent="NM.DBus" cheader_filename="NetworkManagerVPN.h" name="DBUS_(.+)" DBUS_VPN_* parent="NM.DBus.VPN" cheader_filename="NetworkManagerVPN.h" name="DBUS_VPN_(.+)" Apparently the girparser won't be able to find DBus.Connection since it thinks that the Connection symbol should be inside NM.DBus.
I had exactly the same problem writing a plugin for the scratch text editor: my namespace was "Autovala.Scratch", and Vala compiler was unable to find "Scratch.Services.Interface". When I changed the namespace to "AutovalaScratch", everything worked like a charm.
Created attachment 277625 [details] An example code that triggers this bug This code creates a class inside a namespace that contains Gtk as part of it, and also tries to create a Gtk.Label. The compiler returns an error because tries to find the Label class inside the local namespace, but when can't find it, doesn't search from the root.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/306.