GNOME Bugzilla – Bug 634202
enum/quark pairing isn't working as intended
Last modified: 2015-02-07 17:03:57 UTC
_pair_quarks_with_enums() tries to use self._uscore_type_names to find enum types for quarks, but it's currently doing it wrong: short = node.symbol[:-len('_quark')] this is the full c symbol name, but things in self._uscore_type_names have the namespace prefix removed.
Created attachment 173977 [details] [review] remove namespace symbol prefix before looking up enum type
*** Bug 637025 has been marked as a duplicate of this bug. ***
Same comments on this as from 637025; nervous about the lack of tests. Investigating...
Did you make some progress on this? The bug is clear, and his patch seems correct.
It sounds reasonable but I'm wary of committing things without tests. Is this critical for anything in GNOME 3.0 or can it wait until 3.0.x or 3.2?
Given that gjs has no support for GError codes, nothing using gjs depends on this. Don't know for PyGObject or Seed though. Mine was just a ping to get it off my "opened bug list".
I don't think I ever needed this for anything. I was just trying to get g-ir-scanner to be reasonably quiet so I could see what my actual problems were. It can probably wait until I get around to adding some tests for it.
Let's pick this back up again. It's been a while. What we really need is concrete examples of affected codebases, and ideally translate those to a test we can add to tests/scanner/regress.h or the like.
Giovanni says that the current code failed for GDBusError in http://bugzilla-attachments.gnome.org/attachment.cgi?id=216567. However, if I revert Jasper's revert, regenerate Gio-2.0.gir, and run diff -u, I don't see any difference in the generated gir.
That's not the patch Jasper reverted, he reverted the next one (64f38328, reverted by e4879c84), which affects non GType registered enums. If you test GIO, which has all enums registered, you see no difference exactly because of 981f0111c39. If you apply 64f38328 and then revert 981f0111, you should see a warning for each Gio error domain. If you revert 981f0111 while keeping e4879c84, you should see a warning for GDBusError only.
(In reply to comment #10) > That's not the patch Jasper reverted, he reverted the next one (64f38328, > reverted by e4879c84), which affects non GType registered enums. > If you test GIO, which has all enums registered, you see no difference exactly > because of 981f0111c39. > If you apply 64f38328 and then revert 981f0111, you should see a warning for > each Gio error domain. If you revert 981f0111 while keeping e4879c84, you > should see a warning for GDBusError only. Thanks, that's useful. So one important factor is being registered as a GType. I've added a regression test: http://git.gnome.org/browse/gobject-introspection/commit/?id=3077744451293c0bd399866b2accf10fa6a30877 I can confirm that when I revert Jasper's revert, the test fails.
Created attachment 217871 [details] [review] Maintransfomer: fix again paring error domains with unregistered enums Previous fix was wrong, as it called to_underscores_noprefix on a prefixed type name. The actual fix is to call the transformer to do the prefix / type_name split, and turn the latter to underscores. Test case included. Ok, this one includes another test case that fails, and a fix for it.
Really, we should stop sticking in prefix stripping code at random, and just strip prefixes from every name we get back from the parser / gtype before it goes anywhere else.
Comment on attachment 173977 [details] [review] remove namespace symbol prefix before looking up enum type Earlier patch here is now obsolete
Created attachment 217873 [details] [review] Maintransfomer: fix again paring error domains with unregistered enums Previous fix was wrong, as it called to_underscores_noprefix on a prefixed type name. The actual fix is to call the transformer to do the prefix / type_name split, and turn the latter to underscores. Test case included. Prefix / name splitting the way GGod intended it.
Review of attachment 217873 [details] [review]: Ok, the test case greatly increases my confidence in this.
Attachment 217873 [details] pushed as b87a149 - Maintransfomer: fix again paring error domains with unregistered enums
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]