uefisettings icon indicating copy to clipboard operation
uefisettings copied to clipboard

32 bit builds are broken

Open jameshilliard opened this issue 1 year ago • 3 comments

When integrating uefisettings into buildroot it was noticed that 32 bit builds fail.

jameshilliard avatar Nov 09 '24 21:11 jameshilliard

Indeed:

xaionaro@void:~/src/uefisettings$ cargo build --target i686-unknown-linux-gnu
   Compiling proc-macro2 v1.0.56
   Compiling quote v1.0.27
   Compiling libc v0.2.144
   Compiling syn v1.0.109
   Compiling memchr v2.5.0
   Compiling serde_derive v1.0.162
   Compiling cfg-if v1.0.0
   Compiling slab v0.4.8
   Compiling bitflags v1.3.2
   Compiling pin-utils v0.1.0
   Compiling linux-raw-sys v0.3.7
   Compiling futures-sink v0.3.28
   Compiling num-traits v0.2.15
   Compiling pin-project-lite v0.2.9
   Compiling futures-io v0.3.28
   Compiling futures v0.1.31
   Compiling io-lifetimes v1.0.10
   Compiling serde v1.0.162
   Compiling futures-core v0.3.28
   Compiling futures-channel v0.3.28
   Compiling futures-task v0.3.28
   Compiling rustix v0.37.19
   Compiling thiserror v1.0.40
   Compiling futures-util v0.3.28
   Compiling proc-macro-error-attr v1.0.4
   Compiling anyhow v1.0.71
   Compiling async-trait v0.1.68
   Compiling serde_json v1.0.96
   Compiling value-bag v1.0.0-alpha.9
   Compiling proc-macro-error v1.0.4
   Compiling ryu v1.0.13
   Compiling itoa v1.0.6
   Compiling unicase v2.6.0
   Compiling indexmap v1.9.3
   Compiling memoffset v0.7.1
   Compiling base64 v0.11.0
   Compiling regex-syntax v0.7.1
   Compiling panic-message v0.3.0
   Compiling log v0.4.17
   Compiling sval v1.0.0-alpha.5
   Compiling binrw_derive v0.10.0
   Compiling either v1.8.1
   Compiling aho-corasick v1.0.1
   Compiling os_str_bytes v6.5.0
   Compiling heck v0.4.1
   Compiling unicode-width v0.1.10
   Compiling owo-colors v3.5.0
   Compiling hashbrown v0.12.3
   Compiling once_cell v1.17.1
   Compiling httparse v1.8.0
   Compiling termcolor v1.2.0
   Compiling ppv-lite86 v0.2.17
   Compiling strsim v0.10.0
   Compiling humantime v2.1.0
   Compiling bytemuck v1.13.1
   Compiling static_assertions v1.1.0
   Compiling fastrand v1.9.0
   Compiling clap_lex v0.2.4
   Compiling array-init v2.1.0
   Compiling libloading v0.8.0
   Compiling syn v2.0.15
   Compiling getrandom v0.2.9
   Compiling atty v0.2.14
   Compiling nix v0.26.2
   Compiling rand_core v0.6.4
   Compiling rand_chacha v0.3.1
   Compiling rand v0.8.5
   Compiling regex v1.8.1
   Compiling terminal_size v0.2.6
   Compiling is-terminal v0.4.7
   Compiling tempfile v3.5.0
   Compiling textwrap v0.16.0
   Compiling futures-macro v0.3.28
   Compiling thiserror-impl v1.0.40
   Compiling ghost v0.1.9
   Compiling num-derive v0.3.3
   Compiling ctor v0.1.26
   Compiling clap_derive v3.2.25
   Compiling partition-identity v0.3.0
   Compiling proc-mounts v0.3.0
   Compiling env_logger v0.10.0
   Compiling clap v3.2.25
   Compiling futures-executor v0.3.28
   Compiling futures v0.3.28
   Compiling binrw v0.10.0
   Compiling bytes v1.4.0
   Compiling ordered-float v1.1.1
   Compiling bufsize v1.0.5
   Compiling fbthrift v0.0.3
   Compiling uefisettings_thrift v0.1.0 (/home/xaionaro/src/uefisettings/thrift/rust/uefisettings_thrift)
   Compiling spellings_db_thrift v0.1.0 (/home/xaionaro/src/uefisettings/thrift/rust/spellings_db_thrift)
warning: unused import: `self::errors::*`
 --> thrift/rust/spellings_db_thrift/spellings_db.rs:8:9
  |
8 | pub use self::errors::*;
  |         ^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `self::errors::*`
 --> thrift/rust/uefisettings_thrift/uefisettings.rs:7:9
  |
7 | pub use self::errors::*;
  |         ^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

   Compiling uefisettings v0.1.0 (/home/xaionaro/src/uefisettings)
warning: `spellings_db_thrift` (lib) generated 1 warning (run `cargo fix --lib -p spellings_db_thrift` to apply 1 suggestion)
warning: `uefisettings_thrift` (lib) generated 1 warning (run `cargo fix --lib -p uefisettings_thrift` to apply 1 suggestion)
error[E0308]: mismatched types
  --> src/lib/chattr.rs:51:32
   |
51 |         ioctl_fs_get_attrs(fd, attrs_ptr).context("ioctl failed")?;
   |         ------------------     ^^^^^^^^^ expected `*mut i32`, found `*mut i64`
   |         |
   |         arguments to this function are incorrect
   |
   = note: expected raw pointer `*mut i32`
              found raw pointer `*mut i64`
note: function defined here
  --> src/lib/chattr.rs:20:5
   |
19 | / nix::ioctl_read!(
20 | |     ioctl_fs_get_attrs,
   | |     ^^^^^^^^^^^^^^^^^^
21 | |     FS_IOC_MAGIC,
22 | |     FS_IOC_GETFLAGS,
23 | |     ::std::os::raw::c_long
24 | | );
   | |_-

error[E0308]: mismatched types
  --> src/lib/chattr.rs:75:32
   |
75 |         ioctl_fs_set_attrs(fd, attrs_ptr).context("ioctl failed")?;
   |         ------------------     ^^^^^^^^^ expected `*const i32`, found `*mut i64`
   |         |
   |         arguments to this function are incorrect
   |
   = note: expected raw pointer `*const i32`
              found raw pointer `*mut i64`
note: function defined here
  --> src/lib/chattr.rs:27:5
   |
26 | / nix::ioctl_write_ptr!(
27 | |     ioctl_fs_set_attrs,
   | |     ^^^^^^^^^^^^^^^^^^
28 | |     FS_IOC_MAGIC,
29 | |     FS_IOC_SETFLAGS,
30 | |     ::std::os::raw::c_long
31 | | );
   | |_-

For more information about this error, try `rustc --explain E0308`.
error: could not compile `uefisettings` (lib) due to 2 previous errors

Thanks for the report!


UPDATE:

He-he, found this in the code.

xaionaro avatar May 24 '25 19:05 xaionaro

@jameshilliard : Added a fix to the bugfix/issue4 branch. Could you check if it works for you?

xaionaro avatar May 24 '25 19:05 xaionaro

Could you check if it works for you?

Yeah, seems to build now for 32 bit systems.

jameshilliard avatar Sep 30 '25 17:09 jameshilliard