]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools: Fix corner-cases of --hash feature
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / AutoGen.py
index 711081e3fd88eb71ea2d91c1adc7a274918cc09a..b7fbf8dd4d17bc891a7476492051c50d88ce8cf1 100644 (file)
@@ -3917,8 +3917,13 @@ class ModuleAutoGen(AutoGen):
                     shutil.copy2(File, FileDir)\r
 \r
     def AttemptModuleCacheCopy(self):\r
+        # If library or Module is binary do not skip by hash\r
         if self.IsBinaryModule:\r
             return False\r
+        # .inc is contains binary information so do not skip by hash as well\r
+        for f_ext in self.SourceFileList:\r
+            if '.inc' in str(f_ext):\r
+                return False\r
         FileDir = path.join(GlobalData.gBinCacheSource, self.Arch, self.SourceDir, self.MetaFile.BaseName)\r
         HashFile = path.join(FileDir, self.Name + '.hash')\r
         if os.path.exists(HashFile):\r
@@ -4120,7 +4125,16 @@ class ModuleAutoGen(AutoGen):
 \r
     ## Decide whether we can skip the ModuleAutoGen process\r
     def CanSkipbyHash(self):\r
+        # If library or Module is binary do not skip by hash\r
+        if self.IsBinaryModule:\r
+            return False\r
+        # .inc is contains binary information so do not skip by hash as well\r
+        for f_ext in self.SourceFileList:\r
+            if '.inc' in str(f_ext):\r
+                return False\r
         if GlobalData.gUseHashCache:\r
+            # If there is a valid hash or function generated a valid hash; function will return False\r
+            # and the statement below will return True\r
             return not self.GenModuleHash()\r
         return False\r
 \r