nix-community / crate2nix

rebuild only changed crates in CI with crate2nix and nix
https://nix-community.github.io/crate2nix/
Apache License 2.0
338 stars 82 forks source link

Specify name in cleanSourceWith #282

Closed bouk closed 1 year ago

bouk commented 1 year ago

If you don't specify the name then the src name is used, which will be based on the unfiltered source tree. This means that the output still depends on the input files that are filtered out, and extra builds are done that aren't needed.

I figured this out by debugging why changing any file in my git repo flake caused everything to be rebuilt again, which happens because the src name changes every time anything is changed at all.

Ref: https://nixos.org/manual/nix/stable/language/builtins.html#builtins-filterSource

bouk commented 1 year ago

Looking at the implementation of toSourceAttributes I'm not entirely sure now... I might just be running into https://github.com/NixOS/nix/issues/5870

Fuuzetsu commented 1 year ago

225 works around it I think.