[Pkg-rust-maintainers] Bug#1103580: FTBFS: attempt to compute `16_usize - 24_usize`, which would overflow

Charalampos Mitrodimas charmitro at posteo.net
Sun Apr 20 16:01:09 BST 2025


On Sat, 19 Apr 2025 13:11:59 +0200 Chris Hofstaedtler <zeha at debian.org> 
wrote:
 > Source: rust-libxml
 > Version: 0.3.4-1
 > Severity: serious
 > Tags: ftbfs
 > Justification: ftbfs
 > User: debian-qa at lists.debian.org
 > Usertags: i386
 >
 > 0.3.3-1 built on i386, but 0.3.4-1 fails:
 >
 > 
https://buildd.debian.org/status/fetch.php?pkg=rust-libxml&arch=i386&ver=0.3.4-1&stamp=1744884797&raw=0
 >
 > [libxml 0.3.4] Failed to run rustfmt: No such file or directory (os 
error 2) (non-fatal, continuing)
 > Running `CARGO=/usr/bin/cargo CARGO_CRATE_NAME=libxml 
CARGO_MANIFEST_DIR=/build/reproducible-path/rust-libxml-0.3.4 
CARGO_MANIFEST_PATH=/build/reproducible-path/rust-libxml-0.3.4/Cargo.toml 
CARGO_PKG_AUTHORS='Andreas Franzén <andreas at devil.se>:Deyan Ginev 
<deyan.ginev at gmail.com>:Jan Frederik Schaefer 
<j.schaefer at jacobs-university.de>' CARGO_PKG_DESCRIPTION='A Rust wrapper 
for libxml2 - the XML C parser and toolkit developed for the Gnome 
project' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=MIT 
CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=libxml 
CARGO_PKG_README=README.md 
CARGO_PKG_REPOSITORY='https://github.com/KWARC/rust-libxml' 
CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.3.4 
CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=3 
CARGO_PKG_VERSION_PATCH=4 CARGO_PKG_VERSION_PRE='' 
CARGO_PRIMARY_PACKAGE=1 
LD_LIBRARY_PATH=/build/reproducible-path/rust-libxml-0.3.4/target/debug/deps 
OUT_DIR=/build/reproducible-path/rust-libxml-0.3.4/target/i686-unknown-linux-gnu/debug/build/libxml-71efd5eb7ddfc9ba/out 
rustc --crate-name libxml --edition=2021 src/lib.rs --error-format=json 
--json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type 
lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 
--check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C 
metadata=ad87879a69037324 -C extra-filename=-a99a53e479f7069c --out-dir 
/build/reproducible-path/rust-libxml-0.3.4/target/i686-unknown-linux-gnu/debug/deps 
--target i686-unknown-linux-gnu -C 
incremental=/build/reproducible-path/rust-libxml-0.3.4/target/i686-unknown-linux-gnu/debug/incremental 
-L 
dependency=/build/reproducible-path/rust-libxml-0.3.4/target/i686-unknown-linux-gnu/debug/deps 
-L 
dependency=/build/reproducible-path/rust-libxml-0.3.4/target/debug/deps 
--extern 
libc=/build/reproducible-path/rust-libxml-0.3.4/target/i686-unknown-linux-gnu/debug/deps/liblibc-0a4bc9978ad2a583.rmeta 
-C debuginfo=2 -C strip=none --cap-lints warn -C 
linker=i686-linux-gnu-gcc -C link-arg=-Wl,-z,relro --remap-path-prefix 
/build/reproducible-path/rust-libxml-0.3.4=/usr/share/cargo/registry/libxml-0.3.4 
--remap-path-prefix 
/build/reproducible-path/rust-libxml-0.3.4/debian/cargo_registry=/usr/share/cargo/registry 
-L native=/usr/lib/i386-linux-gnu -l xml2`
 > error[E0080]: evaluation of constant value failed
 > --> 
/usr/share/cargo/registry/libxml-0.3.4/target/i686-unknown-linux-gnu/debug/build/libxml-71efd5eb7ddfc9ba/out/bindings.rs:3:62968
 > |
 > 3 | ...n_t"] [:: std :: mem :: size_of :: < max_align_t > () - 
24usize] ; ["Alignment of max_align_t"] [:: std :: mem :: align_of :: < 
max_al...
 > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to 
compute `16_usize - 24_usize`, which would overflow
 >
 > For more information about this error, try `rustc --explain E0080`.
 > error: could not compile `libxml` (lib) due to 1 previous error

Hi,

On 32-bit targets like i386, `size_of::<max_align_t>()` is 16, which
causes an underflow in const context.

There have been earlier reports of this in rust-bindgen; see [1].

Adding `.opaque_type("max_align_t")` to `build.rs` fixes the FTBFS.

Also submitted an upstream PR[2].


[1]: https://github.com/rust-lang/rust-bindgen/issues/1338
[2]: https://github.com/KWARC/rust-libxml/pull/148

                         C. Mitrodimas

 >
 > Caused by:
 > process didn't exit successfully: `CARGO=/usr/bin/cargo 
CARGO_CRATE_NAME=libxml 
CARGO_MANIFEST_DIR=/build/reproducible-path/rust-libxml-0.3.4 
CARGO_MANIFEST_PATH=/build/reproducible-path/rust-libxml-0.3.4/Cargo.toml 
CARGO_PKG_AUTHORS='Andreas Franzén <andreas at devil.se>:Deyan Ginev 
<deyan.ginev at gmail.com>:Jan Frederik Schaefer 
<j.schaefer at jacobs-university.de>' CARGO_PKG_DESCRIPTION='A Rust wrapper 
for libxml2 - the XML C parser and toolkit developed for the Gnome 
project' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=MIT 
CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=libxml 
CARGO_PKG_README=README.md 
CARGO_PKG_REPOSITORY='https://github.com/KWARC/rust-libxml' 
CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.3.4 
CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=3 
CARGO_PKG_VERSION_PATCH=4 CARGO_PKG_VERSION_PRE='' 
CARGO_PRIMARY_PACKAGE=1 
LD_LIBRARY_PATH=/build/reproducible-path/rust-libxml-0.3.4/target/debug/deps 
OUT_DIR=/build/reproducible-path/rust-libxml-0.3.4/target/i686-unknown-linux-gnu/debug/build/libxml-71efd5eb7ddfc9ba/out 
rustc --crate-name libxml --edition=2021 src/lib.rs --error-format=json 
--json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type 
lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 
--check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C 
metadata=ad87879a69037324 -C extra-filename=-a99a53e479f7069c --out-dir 
/build/reproducible-path/rust-libxml-0.3.4/target/i686-unknown-linux-gnu/debug/deps 
--target i686-unknown-linux-gnu -C 
incremental=/build/reproducible-path/rust-libxml-0.3.4/target/i686-unknown-linux-gnu/debug/incremental 
-L 
dependency=/build/reproducible-path/rust-libxml-0.3.4/target/i686-unknown-linux-gnu/debug/deps 
-L 
dependency=/build/reproducible-path/rust-libxml-0.3.4/target/debug/deps 
--extern 
libc=/build/reproducible-path/rust-libxml-0.3.4/target/i686-unknown-linux-gnu/debug/deps/liblibc-0a4bc9978ad2a583.rmeta 
-C debuginfo=2 -C strip=none --cap-lints warn -C 
linker=i686-linux-gnu-gcc -C link-arg=-Wl,-z,relro --remap-path-prefix 
/build/reproducible-path/rust-libxml-0.3.4=/usr/share/cargo/registry/libxml-0.3.4 
--remap-path-prefix 
/build/reproducible-path/rust-libxml-0.3.4/debian/cargo_registry=/usr/share/cargo/registry 
-L native=/usr/lib/i386-linux-gnu -l xml2` (exit status: 1)
 > dh_auto_test: error: /usr/share/cargo/bin/cargo build returned exit 
code 101
 > make: *** [debian/rules:3: binary-arch] Error 25



More information about the Pkg-rust-maintainers mailing list