-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Problem
Installing cargo using Debian's package manage and running the compilation command in the README results in the following error:
Downloaded 73 crates (6.2 MB) in 37.24s (largest was `linux-raw-sys` at 2.3 MB)
error: failed to compile `keepass-diff v1.2.0`, intermediate artifacts can be found at `/tmp/cargo-installkk6alq`
Caused by:
package `clap_derive v4.5.32` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.63.0
Try re-running cargo install with `--locked`
Steps to reproduce
On Debian 12 (bookworm), run this:
sudo apt install -y cargo
git clone https://github.com/Narigo/keepass-diff
cd keepass-diff
RUSTFLAGS="-C target-cpu=native" cargo install keepass-diff
Solution
Based on the error message, it looks like it'd be possible to version lock to some version of linux-raw-sys which can be compiled without having to go through some special process to get a bleeding edge version of the rust compiler. I'm not a Rust developer, so I'm not familiar with how to go about this, but that seems like it would be the easiest solution.
Other options include:
- Do not depend on libraries which do not support stable versions of Debian
- Provide pre-compiled executables (which doesn't actually solve the problem of not being able to compile, but it'd be a reasonable workaround)
- Document that this project can not be compiled with the stable versions of cargo/rustc and provide the commands to install the version of the compiler which is required
Workaround
Set up a VM or container with the testing version Debian (trixie) and run the same commands in the steps to reproduce. Observe that there are not any errors and ~/.cargo/bin/keepass-diff -h works as expected.