crate2nix icon indicating copy to clipboard operation
crate2nix copied to clipboard

Allow some crates to access more files than just those in their folder

Open Ten0 opened this issue 2 months ago • 0 comments

Linked to #17

I have a file architecture such that crates that build references .proto files that are not in the crate folder:

/
 xxx.proto
 xxx_crate/
           build.rs <- references ../xxx.proto

Since those proto files may be used to generate code for multiple languages, it doesn't feel like it would make much sense for the proto file to be inside the xxx_crate. However when it's outside, the crate naturally can't build.

I'd like to get this to work without altering my file architecture somehow. However I wouldn't like to trade that off for a full workspace recompilation every time a file changes in the workspace (since the workspace is big, it's very good that it only recompiles granularly, so I don't think #17 should be applied as suggested).

Having an override mechanism that would enable me to get the original path of the crate to fetch any parent proto and add them to the source would be enough for me. However it seems that currently the Cargo.nix does not export any path information, so I'm not sure how to achieve that. Any idea?

Thanks

Ten0 avatar May 01 '24 16:05 Ten0