When doing a build, store the exact commands that are run & the outputs they produce into a state file. When re-running a build, also tag files that now have a different command as needing a rebuild, even if the timestamps and hashes don't make it needed. When not rebuilding a file, re-output the logs from the last time it was built.
Output is in status file. Exact command plus input TU (and includes transitively) are hashed into a value used as key for store of results. All benefits here listed are there.
When doing a build, store the exact commands that are run & the outputs they produce into a state file. When re-running a build, also tag files that now have a different command as needing a rebuild, even if the timestamps and hashes don't make it needed. When not rebuilding a file, re-output the logs from the last time it was built.