Reviewed-by: Bob Feng <bob.c.f...@intel.com>
-----Original Message----- From: Rodriguez, Christian Sent: Friday, April 5, 2019 12:04 AM To: devel@edk2.groups.io Cc: Feng, Bob C <bob.c.f...@intel.com>; Gao, Liming <liming....@intel.com>; Zhu, Yonghong <yonghong....@intel.com> Subject: [Patch V2 1/4] 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.rodrig...@intel.com> Cc: Bob Feng <bob.c.f...@intel.com> Cc: Liming Gao <liming....@intel.com> Cc: Yonghong Zhu <yonghong....@intel.com> --- BaseTools/Source/Python/AutoGen/AutoGen.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 8c7c20a386..792bc99f54 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -3923,8 +3923,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): @@ -4126,7 +4131,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 -- 2.19.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#38685): https://edk2.groups.io/g/devel/message/38685 Mute This Topic: https://groups.io/mt/30897894/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-