# Rust recompiling everything more often?

**URL:** <https://users.rust-lang.org/t/rust-recompiling-everything-more-often/141302>\
**Category:** uncategorized\
**Created:** [July 15, 2026, 4:05pm UTC](https://users.rust-lang.org/t/rust-recompiling-everything-more-often/141302 "2026-07-15T16:05:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Redglyph](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/redglyph/32/27961_2.png) [@Redglyph](https://users.rust-lang.org/u/Redglyph)\
**Post date:** [July 15, 2026, 4:05pm UTC](https://users.rust-lang.org/t/rust-recompiling-everything-more-often/141302/1 "2026-07-15T16:05:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kpreid](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/kpreid/32/22420_2.png) [@kpreid](https://users.rust-lang.org/u/kpreid)\
**Post date:** [July 15, 2026, 4:17pm UTC](https://users.rust-lang.org/t/rust-recompiling-everything-more-often/141302/2 "2026-07-15T16:17:39Z")

</div>

Passing `--verbose` to Cargo will tell you why it thinks things need to be rebuilt. Look for the _first_ occurrence of the word “Dirty” in the output.

---

<div class="post-metadata">

**Author:** ![simonbuchan](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/simonbuchan/32/19939_2.png) [@simonbuchan](https://users.rust-lang.org/u/simonbuchan)\
**Post date:** [July 15, 2026, 10:10pm UTC](https://users.rust-lang.org/t/rust-recompiling-everything-more-often/141302/3 "2026-07-15T22:10:23Z")

</div>

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](https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions)? But it's not really ideal...

---

<div class="post-metadata">

**Author:** ![Redglyph](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/redglyph/32/27961_2.png) [@Redglyph](https://users.rust-lang.org/u/Redglyph)\
**Post date:** [July 16, 2026, 7:25am UTC](https://users.rust-lang.org/t/rust-recompiling-everything-more-often/141302/4 "2026-07-16T07:25:43Z")

</div>

Thanks for your hints, @kpreid and @simonbuchan!

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.

---

<div class="post-metadata">

**Author:** ![Redglyph](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/redglyph/32/27961_2.png) [@Redglyph](https://users.rust-lang.org/u/Redglyph)\
**Post date:** [July 16, 2026, 12:08pm UTC](https://users.rust-lang.org/t/rust-recompiling-everything-more-often/141302/5 "2026-07-16T12:08:00Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/system/32/51372_2.png) [@system](https://users.rust-lang.org/u/system)\
**Post date:** [October 14, 2026, 12:08pm UTC](https://users.rust-lang.org/t/rust-recompiling-everything-more-often/141302/6 "2026-10-14T12:08:49Z")

</div>

Closed on October 14, 2026, 12:08pm UTC

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.
