[Scons-dev] retrieving from cache and recalculating hash

Tom Tanner (BLOOMBERG/ LONDON) ttanner2 at bloomberg.net
Wed Sep 26 06:24:57 EDT 2012


I think I've found a small problem when retrieving something from the cache: Basically whether or not the content hash gets recalculated depends on how old (or new) the object from the cache is.

Given this isn't a particularly predictable thing - for instance, you could be editting something that hasn't been touched for a while (at least longer than your drift setting), and then undo the edits. Or you could have a tool that is pretty gungo-ho about time stamps (we have one that sets the timestamp of the generated file to -the same- as the input file for build avoidance purposes).

Anyway, this messes up the cache usage unless you disable the caching of the contents hash.

For a small experiment I changed FS.py to set a flag on the object if it retrieved it from the cache to force the hash to be recalculated in get_max_drift_csig, but I'm not sure if that should be done in more places, as bits of get_csig are called all over the place. Any thoughts?


More information about the Scons-dev mailing list