When i try to install the diesel-cli with
cargo install diesel_cli --no-default-features --features sqlite
under NixOS, i get
error: linking with `cc` failed: exit status: 1
...
= note: /nix/store/kmqs0wll31ylwbqkpmlgbjrn6ny3myik-binutils-2.35.1/bin/ld: cannot find -lsqlite3
collect2: error: ld returned 1 exit status
even though the Nix packages sqlite
and pkg-config
are installed. To me this looks like sqlite
missing its static libraries, however i don't see any flag to enable in https://github.com/NixOS/nixpkgs/blob/nixos-21.05/pkgs/development/libraries/sqlite/default.nix.
Note:
- Installing the
postgres
nix package and compiling the diesel-cli with
cargo install diesel_cli --no-default-features --features postgres
works flawlessly.
- A workaround install the
diesel-cli
is using the Nix package of the same name https://github.com/NixOS/nixpkgs/blob/nixos-21.05/pkgs/development/tools/diesel-cli/default.nix which comes with enabled sqlite support. Nevertheless, i would like know how to compile it myself, and trying to compile the Rust project will fail with the same error above.