5 ms·
If they add 'reuse' of old compilation intermediate results, the test for whether the source has changed should not be timestamp-based. That never works reliab
by Animats 11y ago
If they add 'reuse' of old compilation intermediate results, the test for whether the source has changed should not be timestamp-based. That never works reliably, which is why "make clean; make" is so common. The source files must be compared by some cryptographic hash.
- dbaupp 11y agoContent-sensitivity is actually required for this to be most useful with Rust. The file isn't a hard organisational boundary with Rust, incremental compilation would work either at the module level or the function level (i.e. the goal is to be incremental on the actual structures the compiler works with). In any case, it has so many more benefits than just being actually-correct (as you say), e.g. one can edit comments/whitespace without forcing rebuilds.
- gregwtmtno 11y agoIs that how they're doing it now? (I have experienced some trouble with cargo detecting changes to source files on my Mac, but I can't reproduce it reliably enough to file a bug.)
- dbaupp 11y agoThe compiler itself (rustc) does no form of incremental compilation: it just takes an input crate and compiles it entirely, unconditionally. I believe cargo (which calls out to rustc) is using timestamps at the moment.
- gregwtmtno 11y agoOh, interesting. That definitely sounds like the source of my problem. I'll have to look in to it. Thanks.