In this context it might be worth mentioning two projects of mine, one simple/lightweight and the other complex and semi-abandoned. I will not describe them here in detail because the links do so.
This is a lightweight, unambitious, but reliable way of figuring out which files were used during the course of a build. It works well in local disk and some NFS configurations; I'm currently battling some NFS caching issues which make its reliability dependent on things like server vendor and mount options. In other words the current version works for some NFS configurations and not yet others but it should work in any filesystem supporting the relatime mount option (which is the default in modern Linux). It's just a matter of figuring out how to force cache flushes which varies per server implementation.
This is/was a large project aimed at recording not only the files used by a given build but the commands as well, thus a goal similar to the .COMMANDCHANGE and .CACHE features being explored here. Rather than relying on strace/ptrace technology it intercepts system calls using LD_PRELOAD semantics. The original goal was to replicate the ClearCase file auditing and "wink-in" capabilities, for those who remember that system, in pure Linux without any special filesystem. It was going quite well some years ago but then, as often happens, my day job and personal life had other ideas so I had to drop it though not for any technical reason. IIRC the client (recording) side was stable on Linux; I'd also written a server to handle wink-ins from distributed builds but the first attempt was a mess. I had a design for a server rewrite which is where things stopped when I had to drop the project. However, the client works standalone for build auditing and I still use it from time to time. The output format is a little mysterious but it comes with a few Python scripts to parse and interpret it.
David B