rust-glib-sys fail to pass autopkgtests

Bug #2061202 reported by Zixing Liu
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rust-glib-sys (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

rust-glib-sys fail to pass autopkgtests due to mismatch structure declarations between GIR data and C headers.

Related branches

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.

Revision history for this message
peter green (plugwash) wrote :
Revision history for this message
peter green (plugwash) wrote :
Revision history for this message
Zixing Liu (liushuyu-011) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rust-glib-sys - 0.19.0-3

---------------
rust-glib-sys (0.19.0-3) experimental; urgency=medium

  * Team upload
  * debian/patches/gir-type-size.patch: Replace the patch to remove
    problematic types instead.
  * debian/patches/add-missing-headers-definitions.patch: Replace the patch
    with the upstream variant.

 -- Zixing Liu <email address hidden> Wed, 17 Apr 2024 10:07:04 -0600

Changed in rust-glib-sys (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.