Package: rust-leptonica-sys The autopkgtests for rust-leptonica-sys are failing on i386 due to a bindgen layout test failure. Doing some digging it seems the type involved is a system type and appears to be built-in to gcc/clang rather than defined in a header.
This issue has been around for a while, but the new version of bindgen changed the way layout tests work. This means that while with the old bindgen this only caused an autopkgtest failure in rust-leptonica-sys, with the new version it also causes autopkgtest failures in the reverse dependencies of rust-leptonica-sys. This is blocking the migration of the new version of bindgen to testing. I've filed a bug report about this with bindgen, but in the meantime it seems the most sensible thing to do is to blocklist the type in question. I've attatched a patch for leptonica-sys that does that and I have tested that with this patch applied I can successfully run the autopkgtests for rust-leptonica-sys, rust-leptonica-plumbing, rust-tesseract-sys and rust-tesseract-plumbing.
diff -Nru rust-leptonica-sys-0.4.8/debian/changelog rust-leptonica-sys-0.4.8/debian/changelog --- rust-leptonica-sys-0.4.8/debian/changelog 2024-11-23 13:34:05.000000000 +0000 +++ rust-leptonica-sys-0.4.8/debian/changelog 2024-11-26 02:40:08.000000000 +0000 @@ -1,3 +1,11 @@ +rust-leptonica-sys (0.4.8-3.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Blocklist type max_align_t, it causes bindgen layout + test failures and is not used by leptonica. + + -- Peter Michael Green <plugw...@debian.org> Tue, 26 Nov 2024 02:40:08 +0000 + rust-leptonica-sys (0.4.8-3) unstable; urgency=medium * autopkgtest-depend on dh-rust (not dh-cargo) diff -Nru rust-leptonica-sys-0.4.8/debian/patches/1002_blocklist_max_align_t.patch rust-leptonica-sys-0.4.8/debian/patches/1002_blocklist_max_align_t.patch --- rust-leptonica-sys-0.4.8/debian/patches/1002_blocklist_max_align_t.patch 1970-01-01 00:00:00.000000000 +0000 +++ rust-leptonica-sys-0.4.8/debian/patches/1002_blocklist_max_align_t.patch 2024-11-26 02:37:12.000000000 +0000 @@ -0,0 +1,19 @@ +Description: blacklist max_align_t + max_align_t seems to be a built-in type in clang that is not handled + correctly by bindgen, leading to failure in bindgen layout tests. + + This type does not appear to be used by leptonica, so we just tell + bingen to blocklist it. +Author: Peter Michael Green <plugw...@debian.org> + +--- rust-leptonica-sys-0.4.8.orig/build.rs ++++ rust-leptonica-sys-0.4.8/build.rs +@@ -84,6 +84,8 @@ fn main() { + bindings = bindings.clang_arg(format!("-I{}", include_path)); + } + ++ bindings = bindings.blocklist_type("max_align_t"); ++ + let bindings = bindings + .parse_callbacks(Box::new(bindgen::CargoCallbacks)) + .generate() diff -Nru rust-leptonica-sys-0.4.8/debian/patches/series rust-leptonica-sys-0.4.8/debian/patches/series --- rust-leptonica-sys-0.4.8/debian/patches/series 2023-09-05 04:46:14.000000000 +0000 +++ rust-leptonica-sys-0.4.8/debian/patches/series 2024-11-26 02:37:21.000000000 +0000 @@ -1,2 +1,3 @@ 1001_bindgen.patch 2002_no_windows.patch +1002_blocklist_max_align_t.patch