nix-community / crate2nix

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

Fix: Use mkDerivation with src instead of runCommand for test derivation #357

Closed Kranzes closed 3 months ago

Kranzes commented 3 months ago

The problem with using runCommand and recreating the src directory with lndir is that it changes the file types of individual files, they will now be a symlink instead of a regular file. If you have a crate that tests that a file is of regular type then it will fail inside the crate2nix derivation.

apoelstra commented 3 months ago

As a user with a ton of disk space I would prefer this (many of my uses of crate2nix involve nasty hacks to un-symlink files so that I can either modify them or just pass "file exists and is -f checks".

But this will use more disk space and slow things down, possibly by a lot on large repos.

Kranzes commented 3 months ago

I think people should filter their src's properly with something like lib.fileset. They shouldn't be copying over the entire repo to the nix store. It's not that bad IMO.