Open peterneutron opened 9 months ago
Closing. See https://github.com/Morganamilo/paru/issues/1085
This error occurs on the current 3.0.x on aarch64
@7Ji FYI
@kwankiu
Strangely, pacman from vanilla Arch Linux on x86_64 and pacman from Arch Linux ARM on aarch64 pack the exactly same alpm.h
and alpm_list.h
, 1:1. Yet they would produce different bindgen for alpm-sys
even on the same rust-bindgen
, rust
, clang
and llvm-libs
version.
The following is how ffi.rs
would be generated differently on ALARM aarch64:
diff --git a/alpm-sys/src/ffi.rs b/alpm-sys/src/ffi.rs
index f735def..80f7401 100644
--- a/alpm-sys/src/ffi.rs
+++ b/alpm-sys/src/ffi.rs
@@ -1,10 +1,10 @@
-/* automatically generated by rust-bindgen 0.68.1 */
+/* automatically generated by rust-bindgen 0.69.4 */
pub type __mode_t = ::std::os::raw::c_uint;
pub type __off_t = ::std::os::raw::c_long;
pub type mode_t = __mode_t;
pub type off_t = __off_t;
-pub type va_list = __builtin_va_list;
+pub type va_list = [u64; 4usize];
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct archive {
@@ -3324,7 +3324,7 @@ pub type alpm_cb_log = ::std::option::Option<
ctx: *mut ::std::os::raw::c_void,
level: alpm_loglevel_t,
fmt: *const ::std::os::raw::c_char,
- args: *mut __va_list_tag,
+ args: va_list,
),
>;
extern "C" {
@@ -4221,67 +4221,3 @@ extern "C" {
#[doc = " Get the capabilities of the library.\n @return a bitmask of the capabilities"]
pub fn alpm_capabilities() -> ::std::os::raw::c_int;
}
-pub type __builtin_va_list = [__va_list_tag; 1usize];
-#[repr(C)]
-#[derive(Debug, Copy, Clone)]
-pub struct __va_list_tag {
- pub gp_offset: ::std::os::raw::c_uint,
- pub fp_offset: ::std::os::raw::c_uint,
- pub overflow_arg_area: *mut ::std::os::raw::c_void,
- pub reg_save_area: *mut ::std::os::raw::c_void,
-}
-#[test]
-fn bindgen_test_layout___va_list_tag() {
- const UNINIT: ::std::mem::MaybeUninit<__va_list_tag> = ::std::mem::MaybeUninit::uninit();
- let ptr = UNINIT.as_ptr();
- assert_eq!(
- ::std::mem::size_of::<__va_list_tag>(),
- 24usize,
- concat!("Size of: ", stringify!(__va_list_tag))
- );
- assert_eq!(
- ::std::mem::align_of::<__va_list_tag>(),
- 8usize,
- concat!("Alignment of ", stringify!(__va_list_tag))
- );
- assert_eq!(
- unsafe { ::std::ptr::addr_of!((*ptr).gp_offset) as usize - ptr as usize },
- 0usize,
- concat!(
- "Offset of field: ",
- stringify!(__va_list_tag),
- "::",
- stringify!(gp_offset)
- )
- );
- assert_eq!(
- unsafe { ::std::ptr::addr_of!((*ptr).fp_offset) as usize - ptr as usize },
- 4usize,
- concat!(
- "Offset of field: ",
- stringify!(__va_list_tag),
- "::",
- stringify!(fp_offset)
- )
- );
- assert_eq!(
- unsafe { ::std::ptr::addr_of!((*ptr).overflow_arg_area) as usize - ptr as usize },
- 8usize,
- concat!(
- "Offset of field: ",
- stringify!(__va_list_tag),
- "::",
- stringify!(overflow_arg_area)
- )
- );
- assert_eq!(
- unsafe { ::std::ptr::addr_of!((*ptr).reg_save_area) as usize - ptr as usize },
- 16usize,
- concat!(
- "Offset of field: ",
- stringify!(__va_list_tag),
- "::",
- stringify!(reg_save_area)
- )
- );
-}
@Morganamilo
As a temporary workaround, projects using alpm.rs
could enable its generate
feature to generate the bindings on the fly, e.g. on one of my projects:
diff --git a/Cargo.toml b/Cargo.toml
index 32cacb3..71a9ac0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
-alpm = "3.0"
+alpm = { version = "3.0", features = [ "generate" ] }
blake2 = "0.10"
crc = "3"
env_logger = "0.10"
This would introduce a few deps both into the project and into system (pacman -S rust-bindgen
would satisfy that)
@7Ji Builds successfully with proposed fix.
alpm = { version = "3.0.4", features = [ "generate" ] }
Affected Version
alpm.rs 144ced6 on aarch64 cargo 1.74.0
Description
Building from source fails, resulting in the error provided below.
Output