andrewchambers / bupstash

Easy and efficient encrypted backups.

Home Page:https://bupstash.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilation error on Android

mrlogick opened this issue · comments

I tried to compile bupstash on the termux app (with Android 12, aarch64). I installed the dependencies with pkg install rust libsodium.

   Compiling bupstash v0.11.1 (/data/data/com.termux/files/home/aaa)
error[E0308]: arguments to this function are incorrect
    --> src/fsutil.rs:189:22
     |
189  |             unsafe { libc::makedev(major as libc::c_uint, minor as libc::c_uint) }
     |                      ^^^^^^^^^^^^^ ---------------------  --------------------- expected `i32`, found `u32`
     |                                    |
     |                                    expected `i32`, found `u32`
     |
note: function defined here
    --> /data/data/com.termux/files/home/aaa/vendor/libc/src/unix/linux_like/android/mod.rs:2569:12
     |
2569 |     pub fn makedev(ma: ::c_int, mi: ::c_int) -> ::dev_t {
     |            ^^^^^^^
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
     |
189  |             unsafe { libc::makedev((major as libc::c_uint).try_into().unwrap(), minor as libc::c_uint) }
     |                                    +                     +++++++++++++++++++++
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
     |
189  |             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 previous error

Is it solvable? Have you ever tried on Android?

Android has been tried and works for some people - termux needs to be fixed, possibly it will be for the next release (which is a week or so away).

@mrlogick With a few modifications I had some success building. There's a record of what I tried starting around here: #302 (comment)

Oh sorry, I didn't see that post. It's better to continue there, I close this.
(I tried with libc 0.2.134, and compilation does work)