Build regression when using GObject-Introspection 1.81.x
With GNOME/gobject-introspection> 1.81.4 (which should be functionally equivalent to the 1.82.0 stable release), t/structs.t
fails:
t/structs.t ...................
1..6
ok 1
ok 2
Cannot convert record value of unknown type GIMarshallingTestsPointerStruct (94216787708512) to SV at t/structs.t line 26.
# Looks like your test exited with 255 just after 2.
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 4/6 subtests
The build and tests succeed with GObject-Introspection 1.80.1. Comparing the typelibs from a build with 1.80.1 and a build with 1.81.4, I see that 1.80.1 did not include the glib:type-name
, glib:get-type
and c:symbol-prefix
attributes on the <record>
for GIMarshallingTestsPointerStruct
:
--- with 1.80.1
+++ with 1.81.4
- <record name="PointerStruct" c:type="GIMarshallingTestsPointerStruct">
- <source-position filename="gimarshallingtests.h" line="1460"/>
+ <record name="PointerStruct"
+ c:type="GIMarshallingTestsPointerStruct"
+ glib:type-name="GIMarshallingTestsPointerStruct"
+ glib:get-type="gi_marshalling_tests_pointer_struct_get_type"
+ c:symbol-prefix="pointer_struct">
+ <source-position filename="gimarshallingtests.h" line="1415"/>
<field name="long_" writable="1">
<type name="glong" c:type="glong"/>
</field>
and 1.80.1 recorded its get_type()
function as just an ordinary function, whereas 1.81.4 did not:
--- with 1.80.1
+++ with 1.81.4
</parameters>
</function>
- <function name="pointer_struct_get_type"
- c:identifier="gi_marshalling_tests_pointer_struct_get_type">
- <source-position filename="gimarshallingtests.h" line="1464"/>
- <return-value transfer-ownership="none">
- <type name="GType" c:type="GType"/>
- </return-value>
- </function>
<function name="pointer_struct_returnv"
This is probably a behaviour change in g-ir-scanner, rather than a difference between the versions of gimarshallingtests.[ch]
that were used: the code for PointerStruct
in the two versions of gimarshallingtests.[ch]
seems to be functionally equivalent.
I can work around this by editing the GIR XML in build/GIMarshallingTests-1.0.gir
to remove the glib:*
attributes:
--- with 1.81.4
+++ workaround
<record name="PointerStruct"
c:type="GIMarshallingTestsPointerStruct"
- glib:type-name="GIMarshallingTestsPointerStruct"
- glib:get-type="gi_marshalling_tests_pointer_struct_get_type"
c:symbol-prefix="pointer_struct">
and recompiling build/GIMarshallingTests-1.0.typelib
from the edited file, which makes the test pass. I'm fairly sure that isn't a solution, but hopefully it can point someone who is better at g-i / Perl to where the problem might be?
cc @ebassi