crane icon indicating copy to clipboard operation
crane copied to clipboard

Using "cleanCargoSource" with include_str and a non-rs file will break the build

Open TheNeikos opened this issue 3 years ago • 2 comments

As the title says, currently it will also clean depended files.

I understand that this is not something that is easily fixed, but I believe all the information is there to get the information.

I wonder though if cargo is able to give this list itself, or if it can be computed for the case of include_str!

TheNeikos avatar Oct 11 '22 15:10 TheNeikos

crane needs to be able to figure out this list before it starts really touching and running anything, so there's probably no way to improve it.

dpc avatar Oct 11 '22 19:10 dpc

Thanks for the report @TheNeikos! Yes cleanCargoSource is fairly aggressive in what it filters out as a nice default to avoid unnecessary rebuilds for most projects.

It is possible to write a custom filter that includes additional files for projects which do depend on additional files like this. Does this help?

ipetkov avatar Oct 11 '22 22:10 ipetkov

Closing as this is the intended behavior of cleanCargoSource, but feel free to reopen if you have other questions!

ipetkov avatar Nov 10 '22 02:11 ipetkov