Home | Trees | Indices | Help |
|
---|
|
object --+ | CacheDir
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
hit_ratio | |||
misses | |||
Inherited from |
|
Initialize a CacheDir object. The cache configuration is stored in the object. It is read from the config file in the supplied path if one exists, if not the config file is created and the default config is written, as well as saved in the object.
|
Python3 version of reading the cache config. If directory or config file do not exist, create. Take advantage of Py3 capability in os.makedirs() and in file open(): just try the operation and handle failure appropriately. Omit the check for old cache format, assume that's old enough there will be none of those left to worry about.
|
Python2 version of reading cache config. See if there is a config file in the cache directory. If there is, use it. If there isn't, and the directory exists and isn't empty, produce a warning. If the directory does not exist or is empty, write a config file.
|
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. |
|
hit_ratio
|
misses
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Jul 21 02:32:24 2019 | http://epydoc.sourceforge.net |