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.126; helo=mga18.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 35E752034A8A6 for ; Mon, 5 Feb 2018 23:15:08 -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 orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Feb 2018 23:20:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,467,1511856000"; d="scan'208";a="15773723" Received: from shwdeopenpsi105.ccr.corp.intel.com ([10.239.9.129]) by orsmga008.jf.intel.com with ESMTP; 05 Feb 2018 23:20:49 -0800 From: BobCF To: edk2-devel@lists.01.org Cc: Bob Feng , Liming Gao Date: Tue, 6 Feb 2018 15:20:46 +0800 Message-Id: <20180206072046.12032-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 Subject: [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: , X-List-Received-Date: Tue, 06 Feb 2018 07:15:08 -0000 If the PCD is not used in DSC file and user set that PCD value from Command line, build will fail. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng Cc: Liming Gao --- BaseTools/Source/Python/Workspace/DscBuildData.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 1da4f03ab8..6e3cd0f3f1 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -896,11 +896,12 @@ class DscBuildData(PlatformBuildClassObject): else: pcdobj = self._Pcds.get((pcd[1],pcd[0])) if pcdobj: pcdset.append((pcd[0],pcd[1], pcdobj.DefaultValue)) else: - pcdset.append((pcd[0],pcd[1],pcd[3])) + pcdvalue = pcd[3] if len(pcd) == 4 else pcd[2] + pcdset.append((pcd[0],pcd[1],pcdvalue)) GlobalData.BuildOptionPcd = pcdset def GetFieldValueFromComm(self,ValueStr,TokenSpaceGuidCName, TokenCName, FieldName): PredictedFieldType = "VOID*" if ValueStr.startswith('L'): if not ValueStr[1]: @@ -2163,14 +2164,18 @@ class DscBuildData(PlatformBuildClassObject): for pcd in Pcds.values(): SkuInfoObj = pcd.SkuInfoList.values()[0] pcdDecObject = self._DecPcds[pcd.TokenCName, pcd.TokenSpaceGuidCName] + pcd.DatumType = pcdDecObject.DatumType # Only fix the value while no value provided in DSC file. for sku in pcd.SkuInfoList.values(): if (sku.HiiDefaultValue == "" or sku.HiiDefaultValue == None): sku.HiiDefaultValue = pcdDecObject.DefaultValue + for default_store in sku.DefaultStoreDict: + sku.DefaultStoreDict[default_store]=pcdDecObject.DefaultValue + pcd.DefaultValue = pcdDecObject.DefaultValue if 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in pcd.SkuInfoList.keys(): valuefromDec = pcdDecObject.DefaultValue SkuInfo = SkuInfoClass('DEFAULT', '0', SkuInfoObj.VariableName, SkuInfoObj.VariableGuid, SkuInfoObj.VariableOffset, valuefromDec,VariableAttribute=SkuInfoObj.VariableAttribute,DefaultStore={DefaultStore:valuefromDec}) pcd.SkuInfoList['DEFAULT'] = SkuInfo elif 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' in pcd.SkuInfoList.keys(): -- 2.14.3.windows.1