Closed bepvte closed 5 years ago
Seems you need fix .gir file before processing: type
element must have name
attribute, Ex.
<type name="guint" c:type="guint"/>
The problem was that the type had the attribute "introspectable=0", which it doesnt look like this respects.
Strange, I thought that type
element can't have introspectable
attribute.
Can you show part of file here or link full file from somewhere?
<record name="CursorShape"
c:type="SpiceCursorShape"
glib:type-name="SpiceCursorShape"
glib:get-type="spice_cursor_shape_get_type"
c:symbol-prefix="cursor_shape">
<doc xml:space="preserve"
filename="channel-cursor.h"
line="41">The #SpiceCursorShape structure defines the remote cursor's shape.</doc>
<source-position filename="channel-cursor.h" line="61"/>
<field name="type" introspectable="0" writable="1">
<doc xml:space="preserve"
filename="channel-cursor.h"
line="43">a #SpiceCursorType of @data</doc>
<type c:type="SpiceCursorType"/>
</field>
<field name="width" writable="1">
<doc xml:space="preserve"
filename="channel-cursor.h"
line="44">a width of the remote cursor</doc>
<type name="guint16" c:type="guint16"/>
</field>
my apologies, the introspectable attribute was on the "field"
Strange, SpiceCursorType
not found more in this file, so I propose just remove field
completely.
will do, thanks!
While that made it progress farther, I still get some errors, starting with the "vreader" virtual smartcard features I dont use:
thread 'main' panicked at 'Incomplete library, unresolved: ["SpiceClientGLib.VReader"]', src/library_postprocessing.rs:62:13
But adding this to the ignore array did not work, so I instead deleted all smartcard features from the GIR xml. Then I am getting vague and similar errors about the "URL" class, which I do need for my project. How should I debug these?
Sorry "glib::boxed" type currently not supported, so VReader can be only ignored.
<glib:boxed glib:name="VReader"
c:symbol-prefix="smartcard_reader"
glib:type-name="VReader"
glib:get-type="spice_smartcard_reader_get_type">
</glib:boxed>
I don't see any URL class in my version of SpiceClientGLib-2.0.gir (from https://packages.ubuntu.com/eoan/libspice-client-glib-2.0-dev),
can you link repo with your file and Gir.toml
?
I managed to fix the problem by more carefully removing the smartcard related components in an editor with collapsing xml. The problem was most likely incorrect XML syntax that was my fault. The class I was talking about (which is fixed now) is the URI class, sorry for misspelling it. Thank you for your patience and this very useful software.
Can gir ignore introspectable=0
elements instead of requiring the user to manually remove them?
No because many of those are actually used by gir
You don't have to remove them, just mark them as ignored on the Gir.toml btw
On using it with SpiceClientGLib-2.0.gir, I get this error and the generation fails. I dont understand introspection too well, so if I'm leaving out details you need let me know.