AltSysrq / ensync

ENcrypted file SYNChroniser
GNU General Public License v3.0
28 stars 2 forks source link

Fails to compile on Android #9

Closed pianohacker closed 2 weeks ago

pianohacker commented 3 weeks ago

After installing Rust via Termux, cargo install ensync fails with the following error:

Compiling ensync v1.0.1
error[E0432]: unresolved import `libc::futimes`
  --> /data/data/com.termux/files/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ensync-1.0.1/src/posix/mod.rs:54:20
   |
54 | ...::{c_long, futimes, timeval, utimes};
   |               ^^^^^^^
   |               |
   |               no `futimes` in the root
   |               help: a similar name exists in the module: `utimes`

For more information about this error, try `rustc --explain E0432`.

I'm not sure, but this might be because Rust for Android is built against uclibc: https://docs.rs/libc/latest/src/libc/unix/linux_like/linux/mod.rs.html#4867

Some brief Googling suggests futimens as a more widely-available replacement.

AltSysrq commented 2 weeks ago

Could you try building the futimens branch?

pianohacker commented 2 weeks ago

That fixed the issue 👍 first sync was oddly slow, took minutes for a ~200MB root instead of the usual 30 seconds, but that could be the speed of embedded flash.

Thanks!

AltSysrq commented 2 weeks ago

Fixed in 1.0.2.

first sync was oddly slow

Thread count maybe? By default you get one thread per virtual core but on your device that might be too few for the network pipelining to be effective.