`buildDepsOnly` fails when crate has no main.rs / lib.rs
Describe the bug
I'm setting up a flake.nix to build a workspace which contains many crates, some of which only contain tests/ and no main.rs or lib.rs. It appears makeDummySrc fails to copy tests/*.rs across. I do see some reference to tests in makeDummySrc:
${safeStubList "test" "tests"}
Reproduction
If you would expect this use case to work (tests/*.rs) copied to buildDepsOnly's dummySrc directory, then I can amend this issue with a minimal repro in ~10 hours (my morning). Else if this is known to be an unsupported use case, let me know if you recommend:
- Opening a PR against crane.
- Working around with
extraDummyScript. - Something else.
Hi @OliverNChalk thanks for the report!
This looks like a gap in our implementation: tests (and examples and benches) are detected if they are declared in Cargo.toml but we're missing the equivalent logic to auto-discover existing ones
I'll try to find the time to implement a fix for it, but feel free to take a shot at it if you'd like