Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type mismach error building mount.bcachefs on armhf (32 bit) #120

Open
iav opened this issue Apr 13, 2022 · 1 comment
Open

type mismach error building mount.bcachefs on armhf (32 bit) #120

iav opened this issue Apr 13, 2022 · 1 comment

Comments

@iav
Copy link

iav commented Apr 13, 2022

make mount.bcachefs on armhf platform, cargo v.1.60 produces errors:

LIBBCACHEFS_LIB=/root/bcachefs-tools \
LIBBCACHEFS_INCLUDE=/root/bcachefs-tools \
cargo  build --release --manifest-path rust-src/mount/Cargo.toml
warning: `extern` block uses type `bch_option__bindgen_ty_1__bindgen_ty_1`, which is not FFI-safe
 --> /root/bcachefs-tools/rust-src/mount/target/release/build/bch_bindgen-2a69a3c6add74005/out/bcachefs.rs:3:288247
  |
3 | ...n __bch2_opt_set_sb ( arg1 : * mut bch_sb , arg2 : * const bch_option , arg3 : u64_ ) ; } extern "C" { pub fn bch2_opt_set_sb ( arg1 :...
  |                                                       ^^^^^^^^^^^^^^^^^^ not FFI-safe
  |
  = note: `#[warn(improper_ctypes)]` on by default
  = help: consider adding a member to this struct
  = note: this struct has no fields
note: the type is defined here
 --> /root/bcachefs-tools/rust-src/mount/target/release/build/bch_bindgen-2a69a3c6add74005/out/bcachefs.rs:3:281352
  |
3 | ...ult , Copy , Clone , PartialEq , Eq ) ] pub struct bch_option__bindgen_ty_1__bindgen_ty_1 { } # [ test ] fn bindgen_test_layout_bch_op...
  |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: `extern` block uses type `bch_option__bindgen_ty_1__bindgen_ty_1`, which is not FFI-safe
 --> /root/bcachefs-tools/rust-src/mount/target/release/build/bch_bindgen-2a69a3c6add74005/out/bcachefs.rs:3:288353
  |
3 | ... fn bch2_opt_set_sb ( arg1 : * mut bch_fs , arg2 : * const bch_option , arg3 : u64_ ) ; } extern "C" { pub fn bch2_opt_lookup ( arg1 :...
  |                                                       ^^^^^^^^^^^^^^^^^^ not FFI-safe
  |
  = help: consider adding a member to this struct
  = note: this struct has no fields
note: the type is defined here
 --> /root/bcachefs-tools/rust-src/mount/target/release/build/bch_bindgen-2a69a3c6add74005/out/bcachefs.rs:3:281352
  |
3 | ...ult , Copy , Clone , PartialEq , Eq ) ] pub struct bch_option__bindgen_ty_1__bindgen_ty_1 { } # [ test ] fn bindgen_test_layout_bch_op...
  |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: `extern` block uses type `bch_option__bindgen_ty_1__bindgen_ty_1`, which is not FFI-safe
 --> /root/bcachefs-tools/rust-src/mount/target/release/build/bch_bindgen-2a69a3c6add74005/out/bcachefs.rs:3:288560
  |
3 | ...; } extern "C" { pub fn bch2_opt_validate ( arg1 : * const bch_option , arg2 : u64_ , arg3 : * mut printbuf ) -> :: std :: os :: raw :...
  |                                                       ^^^^^^^^^^^^^^^^^^ not FFI-safe
  |
  = help: consider adding a member to this struct
  = note: this struct has no fields
note: the type is defined here
 --> /root/bcachefs-tools/rust-src/mount/target/release/build/bch_bindgen-2a69a3c6add74005/out/bcachefs.rs:3:281352
  |
3 | ...ult , Copy , Clone , PartialEq , Eq ) ] pub struct bch_option__bindgen_ty_1__bindgen_ty_1 { } # [ test ] fn bindgen_test_layout_bch_op...
  |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: `extern` block uses type `bch_option__bindgen_ty_1__bindgen_ty_1`, which is not FFI-safe
 --> /root/bcachefs-tools/rust-src/mount/target/release/build/bch_bindgen-2a69a3c6add74005/out/bcachefs.rs:3:288721
  |
3 | ...b fn bch2_opt_parse ( arg1 : * mut bch_fs , arg2 : * const bch_option , arg3 : * const :: std :: os :: raw :: c_char , arg4 : * mut u6...
  |                                                       ^^^^^^^^^^^^^^^^^^ not FFI-safe
  |
  = help: consider adding a member to this struct
  = note: this struct has no fields
note: the type is defined here
 --> /root/bcachefs-tools/rust-src/mount/target/release/build/bch_bindgen-2a69a3c6add74005/out/bcachefs.rs:3:281352
  |
3 | ...ult , Copy , Clone , PartialEq , Eq ) ] pub struct bch_option__bindgen_ty_1__bindgen_ty_1 { } # [ test ] fn bindgen_test_layout_bch_op...
  |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: `extern` block uses type `bch_option__bindgen_ty_1__bindgen_ty_1`, which is not FFI-safe
 --> /root/bcachefs-tools/rust-src/mount/target/release/build/bch_bindgen-2a69a3c6add74005/out/bcachefs.rs:3:288983
  |
3 | ...arg2 : * mut bch_fs , arg3 : * mut bch_sb , arg4 : * const bch_option , arg5 : u64_ , arg6 : :: std :: os :: raw :: c_uint ) ; } exter...
  |                                                       ^^^^^^^^^^^^^^^^^^ not FFI-safe
  |
  = help: consider adding a member to this struct
  = note: this struct has no fields
note: the type is defined here
 --> /root/bcachefs-tools/rust-src/mount/target/release/build/bch_bindgen-2a69a3c6add74005/out/bcachefs.rs:3:281352
  |
3 | ...ult , Copy , Clone , PartialEq , Eq ) ] pub struct bch_option__bindgen_ty_1__bindgen_ty_1 { } # [ test ] fn bindgen_test_layout_bch_op...
  |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: `bch_bindgen` (lib) generated 5 warnings
   Compiling bcachefs-mount v0.3.1 (/root/bcachefs-tools/rust-src/mount)
error[E0308]: mismatched types
   --> src/filesystem.rs:105:45
    |
105 |         unsafe { libc::mount(src, target, fstype, mountflags, data) }
    |                                                   ^^^^^^^^^^ expected `u32`, found `u64`
    |
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
    |
105 |         unsafe { libc::mount(src, target, fstype, mountflags.try_into().unwrap(), data) }
    |                                                             ++++++++++++++++++++

error[E0308]: mismatched types
  --> src/key.rs:60:4
   |
60 |             std::mem::size_of::<bch_encrypted_key>() as u64,
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u64`
   |
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
   |
60 |             (std::mem::size_of::<bch_encrypted_key>() as u64).try_into().unwrap(),
   |             +                                               +++++++++++++++++++++

error[E0308]: mismatched types
  --> src/key.rs:74:5
   |
74 |                 std::mem::size_of::<bch_key>() as u64,
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u64`
   |
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
   |
74 |                 (std::mem::size_of::<bch_key>() as u64).try_into().unwrap(),
   |                 +                                     +++++++++++++++++++++

error[E0308]: mismatched types
   --> src/filesystem.rs:154:3
    |
154 |         flags,
    |         ^^^^^ expected `u64`, found `u32`
    |
help: you can convert a `u32` to a `u64`
    |
154 |         flags.into(),
    |              +++++++

For more information about this error, try `rustc --explain E0308`.
error: could not compile `bcachefs-mount` due to 4 previous errors
make: *** [Makefile:122: mount.bcachefs] Error 101
@firestack
Copy link

Some of these are maybe worth looking into, at least making sure they don't pop up when building rust in the future,
some of these are unnecessary to look into as the next pass of integrating rust should have them fall away,
and, I think, some are related to rust-lang/rust-bindgen#1651

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants