From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by ml01.01.org (Postfix) with ESMTP id 2CA161A1E1E for ; Wed, 3 Aug 2016 02:45:51 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 03 Aug 2016 02:45:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,465,1464678000"; d="scan'208";a="1018823831" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.144]) by fmsmga001.fm.intel.com with ESMTP; 03 Aug 2016 02:45:50 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Liming Gao Date: Wed, 3 Aug 2016 17:45:37 +0800 Message-Id: <1470217537-63644-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch] BaseTools: Fix the bug when use FILE_GUID override the module in DSC X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2016 09:45:51 -0000 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 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu --- 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