[Bug] Wrong alignment on armel/armhf
With the latest libgweather uploaded to debian unstable the build failed on armel/hf:
Compiling libgweather v4.4.0 (/<<PKGBUILDDIR>>)
Running `CARGO=/usr/bin/cargo CARGO_CRATE_NAME=libgweather CARGO_MANIFEST_DIR=/<<PKGBUILDDIR>> CARGO_PKG_AUTHORS='Jamie Murphy <hello@itsjamie.dev>' CARGO_PKG_DESCRIPTION='Rust bindings for libgweather' CARGO_PKG_HOMEPAGE='https://gitlab.gnome.org/World/Rust/libgweather-rs' CARGO_PKG_LICENSE=MIT CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=libgweather CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://gitlab.gnome.org/World/Rust/libgweather-rs' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=4.4.0 CARGO_PKG_VERSION_MAJOR=4 CARGO_PKG_VERSION_MINOR=4 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='/<<PKGBUILDDIR>>/target/debug/deps:/usr/lib' rustc --crate-name libgweather --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 -C metadata=65f00c279e546e64 -C extra-filename=-65f00c279e546e64 --out-dir /<<PKGBUILDDIR>>/target/armv5te-unknown-linux-gnueabi/debug/deps --target armv5te-unknown-linux-gnueabi -C incremental=/<<PKGBUILDDIR>>/target/armv5te-unknown-linux-gnueabi/debug/incremental -L dependency=/<<PKGBUILDDIR>>/target/armv5te-unknown-linux-gnueabi/debug/deps -L dependency=/<<PKGBUILDDIR>>/target/debug/deps --extern gio=/<<PKGBUILDDIR>>/target/armv5te-unknown-linux-gnueabi/debug/deps/libgio-90ae9f12e305c680.rmeta --extern glib=/<<PKGBUILDDIR>>/target/armv5te-unknown-linux-gnueabi/debug/deps/libglib-3785702f4df9c862.rmeta --extern ffi=/<<PKGBUILDDIR>>/target/armv5te-unknown-linux-gnueabi/debug/deps/libgweather_sys-d0caf56463f01bec.rmeta --extern libc=/<<PKGBUILDDIR>>/target/armv5te-unknown-linux-gnueabi/debug/deps/liblibc-1afcce694188a589.rmeta -C debuginfo=2 --cap-lints warn -C linker=arm-linux-gnueabi-gcc -C link-arg=-Wl,-z,relro --remap-path-prefix /<<PKGBUILDDIR>>=/usr/share/cargo/registry/libgweather-4.4.0 --remap-path-prefix /<<PKGBUILDDIR>>/debian/cargo_registry=/usr/share/cargo/registry`
error[E0308]: mismatched types
--> src/info.rs:18:22
|
18 | Some(value.assume_init())
| ---- ^^^^^^^^^^^^^^^^^^^ expected `i32`, found `i64`
| |
| arguments to this enum variant are incorrect
|
help: the type constructed contains `i64` due to the type of the argument passed
--> src/info.rs:18:17
|
18 | Some(value.assume_init())
| ^^^^^-------------------^
| |
| this argument influences the type of `Some`
note: tuple variant defined here
--> /usr/src/rustc-1.70.0/library/core/src/option.rs:572:5
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
|
18 | Some(value.assume_init().try_into().unwrap())
| ++++++++++++++++++++
The following patch fixes this:
--- a/src/info.rs
+++ b/src/info.rs
@@ -15,7 +15,7 @@
value.as_mut_ptr(),
));
if ret {
- Some(value.assume_init())
+ Some(value.assume_init().try_into().unwrap())
} else {
None
}
I can't make a MR since Gitlab is borked somehow.