public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Fix the bug when use FILE_GUID override the module in DSC
@ 2016-08-03  9:45 Yonghong Zhu
  2016-08-08  2:38 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2016-08-03  9:45 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao

In last commit 2502b73, it doesn't cover the case that in the DSC file
use FILE_GUID to override the module.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 9c548be..0484a5d 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -328,32 +328,41 @@ class WorkspaceAutoGen(AutoGen):
             for fvname in self.FvTargetList:
                 if fvname.upper() not in self.FdfProfile.FvDict:
                     EdkLogger.error("build", OPTION_VALUE_INVALID,
                                     "No such an FV in FDF file: %s" % fvname)
 
+            # In DSC file may use FILE_GUID to override the module, then in the Platform.Modules use FILE_GUIDmodule.inf as key,
+            # but the path (self.MetaFile.Path) is the real path
             for key in self.FdfProfile.InfDict:
                 if key == 'ArchTBD':
                     Platform_cache = {}
+                    MetaFile_cache = {}
                     for Arch in self.ArchList:
                         Platform_cache[Arch] = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]
+                        MetaFile_cache[Arch] = []
+                        for Pkey in Platform_cache[Arch].Modules.keys():
+                            MetaFile_cache[Arch].append(Platform_cache[Arch].Modules[Pkey].MetaFile)
                     for Inf in self.FdfProfile.InfDict[key]:
                         ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch)
                         for Arch in self.ArchList:
-                            if ModuleFile in Platform_cache[Arch].Modules:
+                            if ModuleFile in MetaFile_cache[Arch]:
                                 break
                         else:
                             ModuleData = self.BuildDatabase[ModuleFile, Arch, Target, Toolchain]
                             if not ModuleData.IsBinaryModule:
                                 EdkLogger.error('build', PARSER_ERROR, "Module %s NOT found in DSC file; Is it really a binary module?" % ModuleFile)
 
                 else:
                     for Arch in self.ArchList:
                         if Arch == key:
                             Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]
+                            MetaFileList = []
+                            for Pkey in Platform.Modules.keys():
+                                MetaFileList.append(Platform.Modules[Pkey].MetaFile)
                             for Inf in self.FdfProfile.InfDict[key]:
                                 ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch)
-                                if ModuleFile in Platform.Modules:
+                                if ModuleFile in MetaFileList:
                                     continue
                                 ModuleData = self.BuildDatabase[ModuleFile, Arch, Target, Toolchain]
                                 if not ModuleData.IsBinaryModule:
                                     EdkLogger.error('build', PARSER_ERROR, "Module %s NOT found in DSC file; Is it really a binary module?" % ModuleFile)
 
-- 
2.6.1.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-08  2:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-03  9:45 [Patch] BaseTools: Fix the bug when use FILE_GUID override the module in DSC Yonghong Zhu
2016-08-08  2:38 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox