I am using cargo
, maturin
and pytest
to build a mixed Python/Rust project. During development, I frequently cycle through the commands:
$ cargo test -p mypkg --release
$ maturin develop --release
$ python -m pytest --failed-first my_pkg
It seemed like cargo and maturin were compiling dependencies when there was not a reason to do so. After some experimentation, I found that if I run
cargo ...
maturin ...
cargo ...
maturin ...
the second run of cargo
and maturin
would recompile the dependencies, even though I had not manually changed any of the source files.
I don't have a small example to reproduce this, so I am trying to debug it with the full system. To do that, I would like to know what files cargo and/or maturin think are out of date. Once I know that, the full solution will probably be obvious.
However, there don't seem to be flags that I can pass that give me that information. cargo -vv test ...
produces a lot of output about what it is compiling and how, but not why. maturin
does not even seem to have a -v
flag available.
I found cargo-outdated
, but that appears to be about dependency versions.
I have two Rust packages, each with 5-10 direct dependencies and about 100 total dependencies.
How can I figure out what files are causing cargo
/maturin
to rebuild the dependencies?