gir
gir copied to clipboard
Error message is hard to understand and not very helpful
Running the gir
tool against the GLib-2.0.gir
file from glib 2.58 in sys
work mode, I get the following:
GirXml: gir-files/GLib-2.0.gir:35680:11: Missing type name
And nothing else.
It took me a very long time to understand that the "35680" was the line number in the gir file. That could be made more explicit.
Second, what does "missing type name" even mean? If it means that the <type>
tag needs a name
attribute, then that too could be made more explicit? Maybe even printing back the exact line/tag?
Something like the following maybe:
gir-files/GLib-2.0.gir at line 35680: <type> is missing a name attribute:
<type c:type="gatomicrefcount*"/>
Even better would be to keep in the amazing tradition of the Rustc/Cargo error message and suggest what should be done.
For example, if this is a bug and the gir file really should have it, then a suggestion to report the bug upstream along with an explanation of why that is wrong would be perfect. :slightly_smiling_face:
In this case it is a bug in the gir file :)
@sdroege I know, and it's already fixed upstream.
The point here is that figuring all this out could have been much easier with a better error message. @alatiera suggested I report this, to improve the UX of the gir tool.
Ah great, I wasn't sure if it was clear that this is actually a bug in the .gir file. Can you give a link to the GLib issue about this?
I agree that the error reporting from the gir
tool could be better :)
@sdroege sure, this is the one I opened to ask for the fix to be backported in the latest stable release: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/254 (it has links to the original issue and the MR that fixed it in master)
Mutter uses a lot of forward definitions in Cogl, so I've encountered tons of "
Pinging @zanderbrown as he worked already on rust bindings of mutter, so maybe you could use his work as a start
They cheated and fixed up cogl in their fork, which sadly wasn't polished and upstreamed :/
There isn't much to upstream anyway. Cogl has been archived go years at this point.