ipetkov / crane

A Nix library for building cargo projects. Never build twice thanks to incremental artifact caching.
https://crane.dev
MIT License
962 stars 92 forks source link

Add `buildInputs` but for `cargo-package-deps` not the toplevel derivation. #640

Closed zmrocze closed 5 months ago

zmrocze commented 5 months ago

I know my crate doesn't build because of system dependencies in the rust dependency for my project.

It does build if I install those system dependencies, that is:

nix-shell -p alsa-lib pkg-config -c "cargo build"

succeeds, but cargo build itself doesn't.

So now I'd like to build with crane. But adding buildInputs = [alsa-lib pkg-config] to the arguments to buildDepsOnly doesn't do the trick. I think because it only overrides deps in the toplevel built derivation.

zmrocze commented 5 months ago

i think i just need to specify it as nativeBuildInputs?