13 ms·
Cargo already does this when building incrementally, and there are tools for doing it within an organization like sccache. > If the concern is that I could cha
by duped 4y ago
Cargo already does this when building incrementally, and there are tools for doing it within an organization like sccache.
> If the concern is that I could change something in a crate
It's possible for a change in one crate to require recompiling its dependencies and transitive dependencies, due to conditional compilation (aka, "features' [0]).
Basically you can't know which thing to compile until it's referenced by a dependent and provided a feature set.
That said, many crates don't have features and have a default feature set, but the number of variants to precompile is still quite large.
[0] https://doc.rust-lang.org/cargo/reference/features.html https://doc.rust-lang.org/cargo/reference/features.html
Note that C and C++ have the exact same problem, but it's mitigated by people never giving a shit about locking dependencies and living with the horrible bugs that result from it.