From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0434821CB87A1 for ; Mon, 25 Dec 2017 19:28:51 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Dec 2017 19:33:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,458,1508828400"; d="scan'208";a="5588948" Received: from shwdeopenpsi105.ccr.corp.intel.com ([10.239.9.129]) by orsmga008.jf.intel.com with ESMTP; 25 Dec 2017 19:33:44 -0800 From: BobCF To: edk2-devel@lists.01.org Cc: Bob Feng , Liming Gao Date: Tue, 26 Dec 2017 11:33:33 +0800 Message-Id: <20171226033333.3396-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 Subject: [Patch] BaseTools: Fix building FatPkg failed issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Dec 2017 03:28:52 -0000 Using property instead of vairable for DecPcds. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng CC: Liming Gao --- BaseTools/Source/Python/Workspace/DscBuildData.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index b60c0fdf3..dcc70e8ba 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1010,11 +1010,11 @@ class DscBuildData(PlatformBuildClassObject): else: EdkLogger.error('build', PARSER_ERROR, "Pcd (%s.%s) defined in DSC is not declared in DEC files. Arch: ['%s']" % (str_pcd[0], str_pcd[1], self._Arch), File=self.MetaFile,Line = StrPcdSet[str_pcd][0][5]) # Add the Structure PCD that only defined in DEC, don't have override in DSC file - for Pcd in self._DecPcds: + for Pcd in self.DecPcds: if type (self._DecPcds[Pcd]) is StructurePcd: if Pcd not in S_pcd_set: str_pcd_obj_str = StructurePcd() str_pcd_obj_str.copy(self._DecPcds[Pcd]) str_pcd_obj = Pcds.get(Pcd, None) @@ -1987,11 +1987,25 @@ class DscBuildData(PlatformBuildClassObject): # def AddPcd(self, Name, Guid, Value): if (Name, Guid) not in self.Pcds: self.Pcds[Name, Guid] = PcdClassObject(Name, Guid, '', '', '', '', '', {}, False, None) self.Pcds[Name, Guid].DefaultValue = Value - + @property + def DecPcds(self): + if self._DecPcds == None: + FdfInfList = [] + if GlobalData.gFdfParser: + FdfInfList = GlobalData.gFdfParser.Profile.InfList + PkgSet = set() + for Inf in FdfInfList: + ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch=self._Arch) + if ModuleFile in self._Modules: + continue + ModuleData = self._Bdb[ModuleFile, self._Arch, self._Target, self._Toolchain] + PkgSet.update(ModuleData.Packages) + self._DecPcds = GetDeclaredPcd(self, self._Bdb, self._Arch, self._Target, self._Toolchain,PkgSet) + return self._DecPcds _Macros = property(_GetMacros) Arch = property(_GetArch, _SetArch) Platform = property(_GetPlatformName) PlatformName = property(_GetPlatformName) Guid = property(_GetFileGuid) -- 2.14.3.windows.1