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 640264 - girparser doesn't add C prefix to typelib with gobject-introspection-0.10.x
girparser doesn't add C prefix to typelib with gobject-introspection-0.10.x
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: High normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks: 628240
 
 
Reported: 2011-01-22 15:47 UTC by Serkan Kaba
Modified: 2015-02-07 17:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample program (364 bytes, text/plain)
2011-01-22 15:47 UTC, Serkan Kaba
  Details
Sample program (412 bytes, text/plain)
2011-01-23 21:31 UTC, Serkan Kaba
  Details
Fix typelib parser to use c:identifier-prefixes instead of c:prefix (1014 bytes, patch)
2011-03-20 01:18 UTC, Serkan Kaba
none Details | Review
Fix typelib parser to use c:identifier-prefixes instead of c:prefix (1.07 KB, patch)
2011-03-26 16:13 UTC, Serkan Kaba
committed Details | Review

Description Serkan Kaba 2011-01-22 15:47:07 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
Comment 1 Johan (not receiving bugmail) Dahlin 2011-01-23 19:02:33 UTC
You need to check the error you pass in to g_irepository_require().
Comment 2 Serkan Kaba 2011-01-23 21:31:42 UTC
Created attachment 179101 [details]
Sample program

There's no error in g_irepository_require. Here's the updated sample program.
Comment 3 Johan (not receiving bugmail) Dahlin 2011-01-25 17:48:10 UTC
(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.
Comment 4 Serkan Kaba 2011-01-25 18:03:26 UTC
(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.
Comment 5 Serkan Kaba 2011-03-20 01:18:00 UTC
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.
Comment 6 Colin Walters 2011-03-26 14:48:35 UTC
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?
Comment 7 Serkan Kaba 2011-03-26 15:30:16 UTC
(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?
Comment 8 Colin Walters 2011-03-26 15:37:47 UTC
(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?
Comment 9 Serkan Kaba 2011-03-26 15:41:26 UTC
(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.
Comment 10 Colin Walters 2011-03-26 15:44:36 UTC
(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.
Comment 11 Serkan Kaba 2011-03-26 16:13:15 UTC
Created attachment 184300 [details] [review]
Fix typelib parser to use c:identifier-prefixes instead of c:prefix
Comment 12 André Klapper 2015-02-07 17:00:00 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]