Reviewed-by: Bob Feng <bob.c.f...@intel.com>

-----Original Message-----
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Christian 
Rodriguez
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: [edk2-devel] [Patch V2 4/4] BaseTools: Fix corner-cases of --hash 
feature

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1680

Re-use libraries, since they have already been hashed.

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/GenMake.py |  6 +++---
 BaseTools/Source/Python/build/build.py     | 14 +++++++++++++-
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py 
b/BaseTools/Source/Python/AutoGen/GenMake.py
index b441817b52..537314e33b 100644
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -983,7 +983,7 @@ cleanlib:
     ## For creating makefile targets for dependent libraries
     def ProcessDependentLibrary(self):
         for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:
-            if not LibraryAutoGen.IsBinaryModule:
+            if not LibraryAutoGen.IsBinaryModule and not 
LibraryAutoGen.CanSkipbyHash():
                 
self.LibraryBuildDirectoryList.append(self.PlaceMacro(LibraryAutoGen.BuildDir, 
self.Macros))
 
     ## Return a list containing source file's dependencies @@ -1486,7 +1486,7 
@@ cleanlib:
     def GetLibraryBuildDirectoryList(self):
         DirList = []
         for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:
-            if not LibraryAutoGen.IsBinaryModule:
+            if not LibraryAutoGen.IsBinaryModule and not 
LibraryAutoGen.CanSkipbyHash():
                 DirList.append(os.path.join(self._AutoGenObject.BuildDir, 
LibraryAutoGen.BuildDir))
         return DirList
 
@@ -1622,7 +1622,7 @@ class TopLevelMakefile(BuildFile):
     def GetLibraryBuildDirectoryList(self):
         DirList = []
         for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList:
-            if not LibraryAutoGen.IsBinaryModule:
+            if not LibraryAutoGen.IsBinaryModule and not 
LibraryAutoGen.CanSkipbyHash():
                 DirList.append(os.path.join(self._AutoGenObject.BuildDir, 
LibraryAutoGen.BuildDir))
         return DirList
 
diff --git a/BaseTools/Source/Python/build/build.py 
b/BaseTools/Source/Python/build/build.py
index de641fb452..8c59fc9e84 100644
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -1775,7 +1775,8 @@ class Build():
                     for Module in Pa.Platform.Modules:
                         if self.ModuleFile.Dir == Module.Dir and 
self.ModuleFile.Name == Module.Name:
                             Ma = ModuleAutoGen(Wa, Module, BuildTarget, 
ToolChain, Arch, self.PlatformFile)
-                            if Ma is None: continue
+                            if Ma is None:
+                                continue
                             MaList.append(Ma)
                             if Ma.CanSkipbyHash():
                                 self.HashSkipModules.append(Ma) @@ -2149,10 
+2150,21 @@ class Build():
             RemoveDirectory(os.path.dirname(GlobalData.gDatabasePath), True)
 
     def CreateAsBuiltInf(self):
+        all_lib_set = set()
+        all_mod_set = set()
         for Module in self.BuildModules:
             Module.CreateAsBuiltInf()
+            all_mod_set.add(Module)
         for Module in self.HashSkipModules:
             Module.CreateAsBuiltInf(True)
+            all_mod_set.add(Module)
+        for Module in all_mod_set:
+            for lib in Module.LibraryAutoGenList:
+                all_lib_set.add(lib)
+        for lib in all_lib_set:
+            lib.CreateAsBuiltInf(True)
+        all_lib_set.clear()
+        all_mod_set.clear()
         self.BuildModules = []
         self.HashSkipModules = []
     ## Do some clean-up works when error occurred
--
2.19.1.windows.1





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#38686): https://edk2.groups.io/g/devel/message/38686
Mute This Topic: https://groups.io/mt/30897897/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to