From nobody Mon Dec 23 05:33:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 151989973149153.49552355751223; Thu, 1 Mar 2018 02:22:11 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E3B1D223C178F; Thu, 1 Mar 2018 02:16:01 -0800 (PST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 EB32722423852 for ; Thu, 1 Mar 2018 02:15:59 -0800 (PST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2018 02:22:08 -0800 Received: from shwdeopenpsi105.ccr.corp.intel.com ([10.239.9.129]) by fmsmga006.fm.intel.com with ESMTP; 01 Mar 2018 02:22:07 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,408,1515484800"; d="scan'208";a="208042934" From: BobCF To: edk2-devel@lists.01.org Date: Thu, 1 Mar 2018 18:22:03 +0800 Message-Id: <20180301102203.35884-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 Subject: [edk2] [Patch] 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: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Case 1. A Pcd has no default sku setting in DSC. Case 2. Build as Single SKU. 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(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 06d2f2fbcd..9dcdcfcf1c 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1304,14 +1304,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_D= YNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]: - str_pcd_obj_str.DefaultFromDSC =3D {skuname:{defaultst= ore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, st= r_pcd_obj.SkuInfoList[skuname].HiiDefaultValue) for defaultstore in Default= Stores} for skuname in str_pcd_obj.SkuInfoList} - else: - str_pcd_obj_str.DefaultFromDSC =3D {skuname:{defaultst= ore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, st= r_pcd_obj.SkuInfoList[skuname].DefaultValue) for defaultstore in DefaultSto= res} for skuname in str_pcd_obj.SkuInfoList} + if str_pcd_obj.Type in [self._PCD_TYPE_STRING_[MODEL_P= CD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]: + str_pcd_obj_str.DefaultFromDSC =3D {skuname:{defau= ltstore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore= , str_pcd_obj.SkuInfoList[skuname].HiiDefaultValue) for defaultstore in Def= aultStores} for skuname in str_pcd_obj.SkuInfoList} + else: + str_pcd_obj_str.DefaultFromDSC =3D {skuname:{defau= ltstore: str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore= , str_pcd_obj.SkuInfoList[skuname].DefaultValue) for defaultstore in Defaul= tStores} 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_dat= a[4], self.MetaFile.File if self.WorkspaceDir not in self.MetaFile.File els= e self.MetaFile.File[len(self.WorkspaceDir) if self.WorkspaceDir.endswith(o= s.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: @@ -1729,10 +1729,13 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + "// SkuName: %s, DefaultStoreName: %s \n" % ('DEF= AULT', '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 DSC + self.CopyDscRawValue(Pcd) pcddefaultvalue =3D Pcd.DscRawValue.get(SkuName,{}).get(Defaul= tStoreName) for FieldList in [pcddefaultvalue,inherit_OverrideValues.get(Defau= ltStoreName)]: if not FieldList: continue if pcddefaultvalue and FieldList =3D=3D pcddefaultvalue: @@ -1925,12 +1928,12 @@ class DscBuildData(PlatformBuildClassObject): CApp =3D CApp + "// SkuName: %s, DefaultStoreName= : %s \n" % (skuname, defaultstorenameitem) CApp =3D CApp + self.GenerateInitValueStatement(Pc= d,skuname,defaultstorenameitem) if skuname =3D=3D SkuName: break else: - CApp =3D CApp + "// SkuName: DEFAULT, DefaultStoreName: S= TANDARD \n" - CApp =3D CApp + self.GenerateInitValueStatement(Pcd,"DEFAU= LT","STANDARD") + CApp =3D CApp + "// SkuName: %s, DefaultStoreName: STANDA= RD \n" % self.SkuIdMgr.SystemSkuId + CApp =3D CApp + self.GenerateInitValueStatement(Pcd,self.S= kuIdMgr.SystemSkuId,"STANDARD") CApp =3D CApp + self.GenerateCommandLineValueStatement(Pcd) # # Set new PCD value and size # CApp =3D CApp + ' PcdSetPtr (%s, %s, %s, %s, Size, (UINT8 *)P= cd);\n' % (SkuName, DefaultStoreName, Pcd.TokenSpaceGuidCName, Pcd.TokenCNa= me) @@ -2292,10 +2295,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 Pcd= .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].DefaultStoreD= ict: Pcd.DscRawValue[skuname][defaultstore] =3D Pcd.SkuInfo= List[skuname].DefaultStoreDict[defaultstore] @@ -2306,19 +2313,19 @@ class DscBuildData(PlatformBuildClassObject): DefaultStoreObj =3D DefaultStore(self._GetDefaultStores()) SkuIds =3D {skuname:skuid for skuname,skuid in self.SkuIdMgr.Avail= ableSkuIdSet.items() if skuname !=3D'COMMON'} DefaultStores =3D set([storename for pcdobj in PcdSet.values() for= skuobj in pcdobj.SkuInfoList.values() for storename in skuobj.DefaultStore= Dict.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_DYNAMI= C_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_DEFAUL= T], 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([de= faultstorename for defaultstorename in skuobj.DefaultStoreDict])) --=20 2.14.3.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel