From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 818EE20955F3E for ; Fri, 2 Mar 2018 05:29:26 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2018 05:35:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,412,1515484800"; d="scan'208";a="21566961" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga008.fm.intel.com with ESMTP; 02 Mar 2018 05:35:35 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 2 Mar 2018 05:35:35 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 2 Mar 2018 05:35:34 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.125]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.253]) with mapi id 14.03.0319.002; Fri, 2 Mar 2018 21:35:33 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" Thread-Topic: [Patch 2/2] BaseTools: Fixed build failed issue. Thread-Index: AQHTsg7VSfDvvowx0kuDWRto7SMhXaO88olg Date: Fri, 2 Mar 2018 13:35:32 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1D66F1@SHSMSX104.ccr.corp.intel.com> References: <20180302101114.9488-1-bob.c.feng@intel.com> <20180302101114.9488-2-bob.c.feng@intel.com> In-Reply-To: <20180302101114.9488-2-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch 2/2] BaseTools: Fixed build 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: Fri, 02 Mar 2018 13:29:26 -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: Friday, March 2, 2018 6:11 PM > To: edk2-devel@lists.01.org > Cc: Feng, Bob C ; Gao, Liming > Subject: [Patch 2/2] BaseTools: Fixed build failed issue. >=20 > Case 1. A Pcd has no default sku setting in DSC. > Case 2. Build as Single SKU. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Bob Feng > Cc: Liming Gao > --- > BaseTools/Source/Python/Workspace/DscBuildData.py | 21 ++++++++++++++---= ---- > 1 file changed, 14 insertions(+), 7 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTool= s/Source/Python/Workspace/DscBuildData.py > index 239531cd1c..cd633e964d 100644 > --- a/BaseTools/Source/Python/Workspace/DscBuildData.py > +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py > @@ -1317,14 +1317,14 @@ class DscBuildData(PlatformBuildClassObject): > if str_pcd_dec: > str_pcd_obj_str =3D StructurePcd() > str_pcd_obj_str.copy(str_pcd_dec) > if str_pcd_obj: > str_pcd_obj_str.copy(str_pcd_obj) > - if str_pcd_obj.Type in [self._PCD_TYPE_STRING_[MODEL_PCD= _DYNAMIC_HII], > self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]: > - str_pcd_obj_str.DefaultFromDSC =3D {skuname:{default= store: > str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, str_p= cd_obj.SkuInfoList[skuname].HiiDefaultValue) for > defaultstore in DefaultStores} for skuname in str_pcd_obj.SkuInfoList} > - else: > - str_pcd_obj_str.DefaultFromDSC =3D {skuname:{default= store: > str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, str_p= cd_obj.SkuInfoList[skuname].DefaultValue) for defaultstore > in DefaultStores} for skuname in str_pcd_obj.SkuInfoList} > + if str_pcd_obj.Type in [self._PCD_TYPE_STRING_[MODEL= _PCD_DYNAMIC_HII], > self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]: > + str_pcd_obj_str.DefaultFromDSC =3D {skuname:{def= aultstore: > str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, str_p= cd_obj.SkuInfoList[skuname].HiiDefaultValue) for > defaultstore in DefaultStores} for skuname in str_pcd_obj.SkuInfoList} > + else: > + str_pcd_obj_str.DefaultFromDSC =3D {skuname:{def= aultstore: > str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, str_p= cd_obj.SkuInfoList[skuname].DefaultValue) for defaultstore > in DefaultStores} for skuname in str_pcd_obj.SkuInfoList} > for str_pcd_data in StrPcdSet[str_pcd]: > if str_pcd_data[3] in SkuIds: > str_pcd_obj_str.AddOverrideValue(str_pcd_data[2]= , str(str_pcd_data[6]), 'DEFAULT' if str_pcd_data[3] > =3D=3D 'COMMON' else str_pcd_data[3],'STANDARD' if str_pcd_data[4] =3D=3D= 'COMMON' else str_pcd_data[4], self.MetaFile.File if > self.WorkspaceDir not in self.MetaFile.File else self.MetaFile.File[len(s= elf.WorkspaceDir) if self.WorkspaceDir.endswith(os.path.sep) else > len(self.WorkspaceDir)+1:],LineNo=3Dstr_pcd_data[5]) > S_pcd_set[str_pcd[1], str_pcd[0]] =3D str_pcd_obj_str > else: > @@ -1762,10 +1762,13 @@ class DscBuildData(PlatformBuildClassObject): > CApp =3D CApp + "// SkuName: %s, DefaultStoreName: %s \n" % ('D= EFAULT', 'STANDARD') > inherit_OverrideValues =3D Pcd.SkuOverrideValues[SkuName] > if (SkuName,DefaultStoreName) =3D=3D ('DEFAULT','STANDARD'): > pcddefaultvalue =3D Pcd.DefaultFromDSC.get('DEFAULT',{}).get= ('STANDARD', Pcd.DefaultValue) if Pcd.DefaultFromDSC > else Pcd.DefaultValue > else: > + if not Pcd.DscRawValue: > + # handle the case that structure pcd is not appear in DS= C > + self.CopyDscRawValue(Pcd) > pcddefaultvalue =3D Pcd.DscRawValue.get(SkuName,{}).get(Defa= ultStoreName) > for FieldList in [pcddefaultvalue,inherit_OverrideValues.get(Def= aultStoreName)]: > if not FieldList: > continue > if pcddefaultvalue and FieldList =3D=3D pcddefaultvalue: > @@ -1958,12 +1961,12 @@ class DscBuildData(PlatformBuildClassObject): > CApp =3D CApp + "// SkuName: %s, DefaultStoreNa= me: %s \n" % (skuname, defaultstorenameitem) > CApp =3D CApp + self.GenerateInitValueStatement(= Pcd,skuname,defaultstorenameitem) > if skuname =3D=3D SkuName: > break > else: > - CApp =3D CApp + "// SkuName: DEFAULT, DefaultStoreName:= STANDARD \n" > - CApp =3D CApp + self.GenerateInitValueStatement(Pcd,"DEF= AULT","STANDARD") > + CApp =3D CApp + "// SkuName: %s, DefaultStoreName: STAN= DARD \n" % self.SkuIdMgr.SystemSkuId > + CApp =3D CApp + self.GenerateInitValueStatement(Pcd,self= .SkuIdMgr.SystemSkuId,"STANDARD") > CApp =3D CApp + self.GenerateCommandLineValueStatement(Pcd) > # > # Set new PCD value and size > # > CApp =3D CApp + ' PcdSetPtr (%s, %s, %s, %s, Size, (UINT8 *= )Pcd);\n' % (SkuName, DefaultStoreName, > Pcd.TokenSpaceGuidCName, Pcd.TokenCName) > @@ -2325,10 +2328,14 @@ class DscBuildData(PlatformBuildClassObject): > else: > return False > def CopyDscRawValue(self,Pcd): > if Pcd.DscRawValue is None: > Pcd.DscRawValue =3D dict() > + if Pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_FIXED_AT_BUILD]= , > self._PCD_TYPE_STRING_[MODEL_PCD_PATCHABLE_IN_MODULE]]: > + if self.SkuIdMgr.SystemSkuId not in Pcd.DscRawValue: > + Pcd.DscRawValue[self.SkuIdMgr.SystemSkuId] =3D {} > + Pcd.DscRawValue[self.SkuIdMgr.SystemSkuId]['STANDARD'] =3D P= cd.DefaultValue > for skuname in Pcd.SkuInfoList: > Pcd.DscRawValue[skuname] =3D {} > if Pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII= ], > self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]: > for defaultstore in Pcd.SkuInfoList[skuname].DefaultStor= eDict: > Pcd.DscRawValue[skuname][defaultstore] =3D Pcd.SkuIn= foList[skuname].DefaultStoreDict[defaultstore] > @@ -2339,19 +2346,19 @@ class DscBuildData(PlatformBuildClassObject): > DefaultStoreObj =3D DefaultStore(self._GetDefaultStores()) > SkuIds =3D {skuname:skuid for skuname,skuid in self.SkuIdMgr.Ava= ilableSkuIdSet.items() if skuname !=3D'COMMON'} > DefaultStores =3D set([storename for pcdobj in PcdSet.values() f= or skuobj in pcdobj.SkuInfoList.values() for storename in > skuobj.DefaultStoreDict.keys()]) > for PcdCName, TokenSpaceGuid in PcdSet: > PcdObj =3D PcdSet[(PcdCName, TokenSpaceGuid)] > + self.CopyDscRawValue(PcdObj) > if PcdObj.Type not in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNA= MIC_DEFAULT], > self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], > self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_VPD], > self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_DEFA= ULT], > self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]= , > self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_VPD]= ]: > Pcds[PcdCName, TokenSpaceGuid]=3D PcdObj > continue > - self.CopyDscRawValue(PcdObj) > PcdType =3D PcdObj.Type > if PcdType in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII]= , > self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]: > for skuid in PcdObj.SkuInfoList: > skuobj =3D PcdObj.SkuInfoList[skuid] > mindefaultstorename =3D DefaultStoreObj.GetMin(set([= defaultstorename for defaultstorename in > skuobj.DefaultStoreDict])) > -- > 2.14.3.windows.1