Is it me, or has the Rust compiler been recompiling everything in a project much more often since the last update 1.97.0, in dev mode? I remember seeing a similar report for release, but I'm not compiling as often in that mode.
I have a workspace with a number of packages, and now a small modification in one of them triggers all the packages to be recompiled more often than not when I run a Cargo test, which tends to take much more time for each iteration. Weird. Perhaps I'll try to switch back to 1.96 and see if that's just an impression or another cause.
It even recompiles sometimes when there's no change, actually. Just re-launching a Cargo test on a specific test after doing it for all the tests.
In my experience this is generally an inconsistent feature set, eg if you have a dev-dep that adds a feature to a low level crate you also have as a regular dep it will trigger a rebuild of all it's dependants every time you switch between running the bin and tests/examples as cargo notices the feature set changed.
A hacky way to check this might be to set resolver to 1, from the docs? But it's not really ideal...
I've added the --verbose switch. I'll see what happens the next few days and tell you if I find the cause.
I do have a feature in dev-depandencies, but I'm only running tests at the moment, and nothing changed except additional code and the recent toolchain update.
When I modify a file in the base library, the other packages that depend on it are rebuilt: first Dirty for the modified files, then Dirty messages that mention a dependency has changed. It's not always the case, but it happens much more often than before, so perhaps incremental compilation has changed (or the increased size of the project introduced a change of behaviour).
For example, I just changed one test method in the base library, a package that all the others depend on in the workspace, and I launch the tests with cargo test --workspace. Everything was recompiled, which took about 2 minutes.
I tried to reproduce the problem by removing the last change, then doing it again, and launching the tests each time. Only the base library is (very quickly) compiled, all the rest is considered Fresh. It took 20 seconds.
Also, I often noticed—long ago, before that recent apparent change—that the first test of a day generally required to recompile everything, even if nothing had changed, so I suspect the compiler recompiles everything once the timestamps are too old. Perhaps that behaviour has changed recently and it tends to recompile more often, though I'm not sure exactly what this behaviour is (I assume it considers incremental compilation dirty after a while).