Build fails when target file makes use of the include_str macro for reading data
cargo mutants appears to be unable to build and run a baseline when the unit test pulls in data from the filesystem via include_str!('../../some/path/to/test/data').
I imagine this happens because mutants is builds itself in its own directory and that messes up path resolution.
Any tips to address this?
Can you try building with --in-place?
Is the path an relative path pointing outside of the Cargo workspace tree?
Maybe if the baseline build fails then we should point to a doc with some debugging steps, including trying --in-place. A start on this is in https://github.com/sourcefrog/cargo-mutants/wiki/Troubleshooting.
Is the path an relative path pointing outside of the Cargo workspace tree?
Yes, and yes the baseline build did fail. I'll try with --in-place, thanks!
Perhaps a general solution to this would be to add an option giving the root of the tree to copy, rather than using the workspace root.
This seems like a somewhat niche option, so I'm not sure if it would really be earning its keep?
Users could, potentially, either copy the tree themselves or just use --in-place, and potentially if the path points outside the workspace the whole tree that would need to be copied would be very large.
On the other hand being able to copy the tree would let us use -j for these cases. If you manually copied the tree you could use sharding.