6 ms·
One of my favorite SCons features is that it determines the necessary build operations from file hashes rather than timestamps. Working on a project with a lon
by jcl 7y ago
One of my favorite SCons features is that it determines the necessary build operations from file hashes rather than timestamps. Working on a project with a long link step, it was wonderful to be able to rephrase comments, rename local variables, or tidy code formatting and skip the link step, since scons saw the object files had the same hash.
A few times, the skipped link step revealed to me that the code change I had just made had no effect on the compiler output, usually because the compiler's optimizer was already doing the same thing.
Likewise, hash-based compilation made git operations much smoother, since things like rebasing or jumping back and forth between branches can update timestamps without affecting content.
I know it's possible to hack similar functionality into some other build systems by adding a layer of intermediate hash file targets everywhere. But I'm a bit surprised the idea hasn't seen broader adoption... Having build artifacts indexed by hash seems like it'd be a requirement for any system that eventually wants to support large, distributed builds.