diff options
author | Rodriguez, Christian <christian.rodriguez@intel.com> | 2019-04-05 00:04:20 +0800 |
---|---|---|
committer | Feng, Bob C <bob.c.feng@intel.com> | 2019-04-10 13:32:11 +0800 |
commit | 2914e8153dd31a6594862ac6c0c7e7e460737991 (patch) | |
tree | fd3e7dbf9cb27c994a1599d1d1c8bb1801777add /BaseTools/Source/Python/AutoGen/AutoGen.py | |
parent | b1e27d175abbb42c4bcc8565a3e0e622d643c40f (diff) | |
download | edk2-2914e8153dd31a6594862ac6c0c7e7e460737991.tar.gz edk2-2914e8153dd31a6594862ac6c0c7e7e460737991.tar.bz2 edk2-2914e8153dd31a6594862ac6c0c7e7e460737991.zip |
BaseTools: Fix corner-cases of --hash feature
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1680
Consider modules with .inc source files as Binary Modules
and do not Skip by hash.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Christian Rodriguez <christian.rodriguez@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/AutoGen.py')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 711081e3fd..b7fbf8dd4d 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -3917,8 +3917,13 @@ class ModuleAutoGen(AutoGen): shutil.copy2(File, FileDir)
def AttemptModuleCacheCopy(self):
+ # If library or Module is binary do not skip by hash
if self.IsBinaryModule:
return False
+ # .inc is contains binary information so do not skip by hash as well
+ for f_ext in self.SourceFileList:
+ if '.inc' in str(f_ext):
+ return False
FileDir = path.join(GlobalData.gBinCacheSource, self.Arch, self.SourceDir, self.MetaFile.BaseName)
HashFile = path.join(FileDir, self.Name + '.hash')
if os.path.exists(HashFile):
@@ -4120,7 +4125,16 @@ class ModuleAutoGen(AutoGen): ## Decide whether we can skip the ModuleAutoGen process
def CanSkipbyHash(self):
+ # If library or Module is binary do not skip by hash
+ if self.IsBinaryModule:
+ return False
+ # .inc is contains binary information so do not skip by hash as well
+ for f_ext in self.SourceFileList:
+ if '.inc' in str(f_ext):
+ return False
if GlobalData.gUseHashCache:
+ # If there is a valid hash or function generated a valid hash; function will return False
+ # and the statement below will return True
return not self.GenModuleHash()
return False
|