mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
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>
This commit is contained in:
parent
b1e27d175a
commit
2914e8153d
@ -3917,8 +3917,13 @@ class ModuleAutoGen(AutoGen):
|
|||||||
shutil.copy2(File, FileDir)
|
shutil.copy2(File, FileDir)
|
||||||
|
|
||||||
def AttemptModuleCacheCopy(self):
|
def AttemptModuleCacheCopy(self):
|
||||||
|
# If library or Module is binary do not skip by hash
|
||||||
if self.IsBinaryModule:
|
if self.IsBinaryModule:
|
||||||
return False
|
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)
|
FileDir = path.join(GlobalData.gBinCacheSource, self.Arch, self.SourceDir, self.MetaFile.BaseName)
|
||||||
HashFile = path.join(FileDir, self.Name + '.hash')
|
HashFile = path.join(FileDir, self.Name + '.hash')
|
||||||
if os.path.exists(HashFile):
|
if os.path.exists(HashFile):
|
||||||
@ -4120,7 +4125,16 @@ class ModuleAutoGen(AutoGen):
|
|||||||
|
|
||||||
## Decide whether we can skip the ModuleAutoGen process
|
## Decide whether we can skip the ModuleAutoGen process
|
||||||
def CanSkipbyHash(self):
|
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 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 not self.GenModuleHash()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user