SCons.CacheDir.CacheDir

Package SCons :: Module CacheDir :: Class CacheDir |
[hide private]
[frames] | no frames]

# Class CacheDir

source code

Instance Methods | [hide private]
__init__(self, path) | source code
CacheDebug(self, fmt, target, cachefile) | source code
is_enabled(self) | source code
cachepath(self, node) | source code
retrieve(self, node) This method is called from multiple threads in a parallel build, so only do thread safe stuff here. | source code
push(self, node) | source code
push_if_forced(self, node) | source code

Method Details | [hide private]

### retrieve(self, node) | source code
This method is called from multiple threads in a parallel build, so only do thread safe stuff here. Do thread unsafe stuff in built(). Note that there's a special trick here with the execute flag (one that's not normally done for other actions). Basically if the user requested a no_exec (-n) build, then SCons.Action.execute_actions is set to 0 and when any action is called, it does its showing but then just returns zero instead of actually calling the action execution operation. The problem for caching is that if the file does NOT exist in cache then the CacheRetrieveString won't return anything to show for the task, but the Action.__call__ won't call CacheRetrieveFunc; instead it just returns zero, which makes the code below think that the file was successfully retrieved from the cache, therefore it doesn't do any subsequent building. However, the CacheRetrieveString didn't print anything because it didn't actually exist in the cache, and no more build actions will be performed, so the user just sees nothing. The fix is to tell Action.__call__ to always execute the CacheRetrieveFunc and then have the latter explicitly check SCons.Action.execute_actions itself.