Comment 1 for bug 2061202

Revision history for this message
peter green (plugwash) wrote :

I had a look at this and I discovered multiple issues.

The first is that the package fails to build because gir-rust-code generator needs a time64 fix that ubuntu doesn't currently have. Said fix is available in Debian experimental, you should just be able to sync it.

The second is tests failing due to a missing header include, I fixed that with the following patch.

Index: rust-glib-sys-0.19.0/tests/manual.h
===================================================================
--- rust-glib-sys-0.19.0.orig/tests/manual.h
+++ rust-glib-sys-0.19.0/tests/manual.h
@@ -2,6 +2,7 @@
.
 #include <glib.h>
 #include <glib-object.h>
+#include <glib-unix.h>
.
 // included in Gir on all platforms even though it is only present on windows
 #ifndef G_WIN32_MSG_HANDLE

The third is a cross-validation failure.

    ---- cross_validate_layout_with_c stdout ----
    Layout mismatch for GStaticMutex
    Rust: Layout { size: 8, alignment: 8 }
    C: Layout { size: 48, alignment: 8 }
    Layout mismatch for GStaticRWLock
    Rust: Layout { size: 40, alignment: 8 }
    C: Layout { size: 80, alignment: 8 }
    Layout mismatch for GStaticRecMutex
    Rust: Layout { size: 16, alignment: 8 }
    C: Layout { size: 64, alignment: 8 }

It seems that these types have a discrepancy between their defintion in C and in gir. Furthermore it seems that gir-rust-code-generator only generates bindings for these types with the glib2.0 from noble/experimental, not with the glib2.0 from sid.

I'm not sure where to go from here, the test code in question is generated by gir-rust-code-generator, which is run during the build, so editing it manually would be awkward. I tried to exclude the symbols in question from rust code generation but that caused the rust code generation to fail.