kimono-koans / httm

Interactive, file-level Time Machine-like tool for ZFS/btrfs/nilfs2 (and even Time Machine and Restic backups!)
https://crates.io/crates/httm
Mozilla Public License 2.0
1.34k stars 28 forks source link

httm isn't portable across linux #17

Closed CompuRoot closed 2 years ago

CompuRoot commented 2 years ago

The issue: ./httm: /lib/x86_64-linux-gnu/libm.so.6: version 'GLIBC_2.29' not found (required by ./httm)

Happens of officially supported debian/buster.

Is there any choice to compile it against musl instead of glibc or at least lower requirement to have only most recent version ? It would be also pretty useful if utility would be truly statically compiled to avoid any dependencies that allows to use it across all Linuxes regardless of distribution and versions

kimono-koans commented 2 years ago

Yeah, you should be able to just use musl. No need to compile it. Just:

cargo target install x86_64-unknown-linux-musl
cargo install --target x86_64-unknown-linux-musl --path ./httm

I'm loath to explain musl should be the default for Linux when, for most distros, it works fine, and this method of installation also works on FreeBSD and MacOS too. I'll try to think up a note for the README to explain the situation though.

My view on compiled versions -- PRs are welcome. Right now, for me, building and packaging httm is less interesting that writing httm. But, if you know someone who likes writing build scripts and wants to contribute to this little project, their PRs would be very welcome.

PrplHaz4 commented 1 year ago

Did you ever get this sorted? I'm trying to build and run on Buster and getting the following:

 Compiling httm v0.18.2 (/usr/local/cargo/git/checkouts/httm-06074a082ad4c88e/0375596)
error[E0308]: mismatched types
   --> src/library/utility.rs:68:33
    |
68  |         ret = libc::setpriority(priority_type as u32, tid, priority_level)
    |               ----------------- ^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32`
    |               |
    |               arguments to this function are incorrect
    |
note: function defined here
   --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.138/src/unix/linux_like/linux/musl/mod.rs:733:12
    |
733 |     pub fn setpriority(which: ::c_int, who: ::id_t, prio: ::c_int) -> ::c_int;
    |            ^^^^^^^^^^^
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
    |
68  |         ret = libc::setpriority((priority_type as u32).try_into().unwrap(), tid, priority_level)
    |                                 +                    +++++++++++++++++++++

For more information about this error, try `rustc --explain E0308`.
error: could not compile `httm` due to previous error
error: failed to compile `httm v0.18.2 (https://github.com/kimono-koans/httm.git?tag=0.18.2#03755960)`, intermediate artifacts can be found at `/tmp/cargo-installKsWLW7`
The command '/bin/sh -c cargo install --git https://github.com/kimono-koans/httm.git --tag "0.18.2" --target x86_64-unknown-linux-musl' returned a non-zero code: 101
CompuRoot commented 1 year ago

Did you ever get this sorted?

The only way to compile x86_64 binary on linux is to compile it against musl. I recently reported the same issue with another project written in rust , and that's how it was resolve

PrplHaz4 commented 1 year ago

Did you ever get this sorted?

The only way to compile x86_64 binary on linux is to compile it against musl. I recently reported the same issue with another project written in rust , and that's how it was resolve

Thanks - you guys put me on the right path! My resolution is in issue #61 - I didn't want to run the whole rust toolchain so built it in docker.