bupstash: Fails to build on ARM64 (Termux)

Trying to build it on my phone using termux I get this error:


error[E0308]: mismatched types
   --> src/fsutil.rs:383:36
    |
383 |             unsafe { libc::makedev(major as libc::c_uint, minor as libc::c_uint) }
    |                                    ^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
    |
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
    |
383 |             unsafe { libc::makedev((major as libc::c_uint).try_into().unwrap(), minor as libc::c_uint) }
    |                                    +                     +++++++++++++++++++++

error[E0308]: mismatched types
   --> src/fsutil.rs:383:59
    |
383 |             unsafe { libc::makedev(major as libc::c_uint, minor as libc::c_uint) }
    |                                                           ^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
    |
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
    |
383 |             unsafe { libc::makedev(major as libc::c_uint, (minor as libc::c_uint).try_into().unwrap()) }
    |                                                           +                     +++++++++++++++++++++

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

Steps to reproduce:

  • Install termux
  • Using termux execute:
pkg install git
git clone https://github.com/termux/termux-packages
cd termux-packages
./scripts/setup-termux.sh
pkg install libsodium binutils
git clone https://github.com/andrewchambers/bupstash
cd bupstash
git checkout v0.11.0
cargo build --release

I found some related issues which may be useful. Issue Commit

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 15 (12 by maintainers)

Most upvoted comments

Thanks for investigating this btw - I will try to get setup later and test your investigation too.

I still see those 3 lines so although I haven’t tested I suspect it still is an issue.

IIUC though, this is an Android-specific thing – see this comment.