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=liming.gao@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 51C59222447BF for ; Mon, 25 Dec 2017 19:36:09 -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:41:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,458,1508828400"; d="scan'208";a="5591793" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga008.jf.intel.com with ESMTP; 25 Dec 2017 19:41:03 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 25 Dec 2017 19:41:02 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 25 Dec 2017 19:41:02 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.213]) with mapi id 14.03.0319.002; Tue, 26 Dec 2017 11:41:01 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: Fix building FatPkg failed issue Thread-Index: AQHTffpXlg0jHSwPCECV+m+hGpFinqNU+rhw Date: Tue, 26 Dec 2017 03:41:00 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1985CB@SHSMSX104.ccr.corp.intel.com> References: <20171226033333.3396-1-bob.c.feng@intel.com> In-Reply-To: <20171226033333.3396-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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:36:11 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Feng, Bob C >Sent: Tuesday, December 26, 2017 11:34 AM >To: edk2-devel@lists.01.org >Cc: Feng, Bob C ; Gao, Liming >Subject: [Patch] BaseTools: Fix building FatPkg failed issue > >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 i= n DEC files. Arch: >['%s']" % (str_pcd[0], str_pcd[1], self._Arch), > File=3Dself.MetaFile,Line =3D StrPcdSet[str_p= cd][0][5]) > # Add the Structure PCD that only defined in DEC, don't have over= ride 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 =3D StructurePcd() > str_pcd_obj_str.copy(self._DecPcds[Pcd]) > str_pcd_obj =3D 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] =3D PcdClassObject(Name, Guid, '', '', = '', '', '', {}, >False, None) > self.Pcds[Name, Guid].DefaultValue =3D Value >- >+ @property >+ def DecPcds(self): >+ if self._DecPcds =3D=3D None: >+ FdfInfList =3D [] >+ if GlobalData.gFdfParser: >+ FdfInfList =3D GlobalData.gFdfParser.Profile.InfList >+ PkgSet =3D set() >+ for Inf in FdfInfList: >+ ModuleFile =3D PathClass(NormPath(Inf), GlobalData.gWorks= pace, >Arch=3Dself._Arch) >+ if ModuleFile in self._Modules: >+ continue >+ ModuleData =3D self._Bdb[ModuleFile, self._Arch, self._Ta= rget, >self._Toolchain] >+ PkgSet.update(ModuleData.Packages) >+ self._DecPcds =3D GetDeclaredPcd(self, self._Bdb, self._Arch, >self._Target, self._Toolchain,PkgSet) >+ return self._DecPcds > _Macros =3D property(_GetMacros) > Arch =3D property(_GetArch, _SetArch) > Platform =3D property(_GetPlatformName) > PlatformName =3D property(_GetPlatformName) > Guid =3D property(_GetFileGuid) >-- >2.14.3.windows.1