+\r
+ ## Error handling for hash feature\r
+ #\r
+ # On BuildTask error, iterate through the Module Build tracking\r
+ # dictionary to determine wheather a module failed to build. Invalidate\r
+ # the hash associated with that module by removing it from storage.\r
+ #\r
+ #\r
+ def invalidateHash(self):\r
+ # GlobalData.gModuleBuildTracking contains only modules that cannot be skipped by hash\r
+ for moduleAutoGenObj in GlobalData.gModuleBuildTracking.keys():\r
+ # False == FAIL : True == Success\r
+ # Skip invalidating for Successful module builds\r
+ if GlobalData.gModuleBuildTracking[moduleAutoGenObj] == True:\r
+ continue\r
+\r
+ # The module failed to build or failed to start building, from this point on\r
+\r
+ # Remove .hash from build\r
+ if GlobalData.gUseHashCache:\r
+ ModuleHashFile = path.join(moduleAutoGenObj.BuildDir, moduleAutoGenObj.Name + ".hash")\r
+ if os.path.exists(ModuleHashFile):\r
+ os.remove(ModuleHashFile)\r
+\r
+ # Remove .hash file from cache\r
+ if GlobalData.gBinCacheSource:\r
+ FileDir = path.join(GlobalData.gBinCacheSource, moduleAutoGenObj.Arch, moduleAutoGenObj.SourceDir, moduleAutoGenObj.MetaFile.BaseName)\r
+ HashFile = path.join(FileDir, moduleAutoGenObj.Name + '.hash')\r
+ if os.path.exists(HashFile):\r
+ os.remove(HashFile)\r
+\r