GNOME Bugzilla – Bug 640264
girparser doesn't add C prefix to typelib with gobject-introspection-0.10.x
Last modified: 2015-02-07 17:00:00 UTC
Created attachment 179042 [details] Sample program I can't correctly query c prefix of any namespace with the given function. Attached program prints the following text: GOBJ METADATA
You need to check the error you pass in to g_irepository_require().
Created attachment 179101 [details] Sample program There's no error in g_irepository_require. Here's the updated sample program.
(In reply to comment #2) > Created an attachment (id=179101) [details] > Sample program > > There's no error in g_irepository_require. Here's the updated sample program. If this program prints out GOBJ METADATA then it's a bug in g_irepository_require() or a broken typelib in which case the g-ir-compiler is broken.
(In reply to comment #3) > (In reply to comment #2) > > Created an attachment (id=179101) [details] [details] > > Sample program > > > > There's no error in g_irepository_require. Here's the updated sample program. > > If this program prints out GOBJ METADATA then it's a bug in > g_irepository_require() or a broken typelib in which case the g-ir-compiler is > broken. I can provide more debug data if instructions are given for preparing them.
Created attachment 183831 [details] [review] Fix typelib parser to use c:identifier-prefixes instead of c:prefix This bug was introduced with http://git.gnome.org/browse/gobject-introspection/commit/?id=36aa515f1036978ced8d4ffb808260844f7229e0 due to rename of c:prefix to c:identifier-prefixes. The attached patch fixes the issue.
So this reveals an issue that there is no longer necessarily just one prefix. And actually there are two different types of prefixes. I think we should put them both in the typelib, and change g_irepository_get_c_prefix to return the *first* identifier-prefix. Note they're comma separated. Hmm...actually, maybe in practice no one uses multiple identifier prefixes. However, GLib-2.0.gir *does* have multiple symbol prefixes: c:symbol-prefixes="g,glib" Maybe we can say "don't care" though. What are you using the c:prefix for?
(In reply to comment #6) > What are you using the c:prefix for? I'm using it as a replacement for in-module attribute of .defs files. Is there anything that I can use for it?
(In reply to comment #7) > (In reply to comment #6) > > What are you using the c:prefix for? > I'm using it as a replacement for in-module attribute of .defs files. Is there > anything that I can use for it? I don't know offhand what in-module from .defs helps with. Is it actually the identifier-prefix we use in introspection? I.e. the first part of the name for classes?
(In reply to comment #8) > I don't know offhand what in-module from .defs helps with. Is it actually the > identifier-prefix we use in introspection? I.e. the first part of the name for > classes? Indeed, but the parser still queries c:prefix attribute, and the patch fixes it.
(In reply to comment #9) > (In reply to comment #8) > > I don't know offhand what in-module from .defs helps with. Is it actually the > > identifier-prefix we use in introspection? I.e. the first part of the name for > > classes? > > Indeed, but the parser still queries c:prefix attribute, and the patch fixes > it. I'm fine with committing this patch, but can you fix the commit message to have more detail? Just including what you wrote above: This bug was introduced with http://git.gnome.org/browse/gobject-introspection/commit/?id=36aa515f1036978ced8d4ffb808260844f7229e0 due to rename of c:prefix to c:identifier-prefixes. The attached patch fixes the issue. Is fine.
Created attachment 184300 [details] [review] Fix typelib parser to use c:identifier-prefixes instead of c:prefix
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]