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.24; helo=mga09.intel.com; envelope-from=zhijux.fan@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 BFE77202E53C1 for ; Mon, 18 Feb 2019 01:53:12 -0800 (PST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Feb 2019 01:53:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,384,1544515200"; d="dat'59?scan'59,208,59";a="275870546" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga004.jf.intel.com with ESMTP; 18 Feb 2019 01:53:12 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 18 Feb 2019 01:53:12 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 18 Feb 2019 01:53:11 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by shsmsx102.ccr.corp.intel.com ([169.254.2.207]) with mapi id 14.03.0415.000; Mon, 18 Feb 2019 17:53:09 +0800 From: "Fan, ZhijuX" To: "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Feng, Bob C" Thread-Topic: [PATCH] BaseTools:PCD value error in structure pcd sku case. Thread-Index: AdTHb8AJr2eqycHMTGK42Cqr/Dn5Lw== Date: Mon, 18 Feb 2019 09:53:09 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [PATCH] BaseTools:PCD value error in structure pcd sku case. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 09:53:13 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Defined 2 PCDs(Test4 & Test401) and 2 SKUs(DEFAULT & _), then set "SKUID_Defines" to ALL, for FixedAtBuild gEfiStructuredPcdPkgTokenSpaceGuid. Test401 in this case, its value should get from "Default" SKU, not from "_" SKU, but we does not set value in SKU "_" in dsc, so Test401 should only display the value get from dec. Cc: Bob Feng Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan --- BaseTools/Source/Python/Common/GlobalData.py | 2 +- BaseTools/Source/Python/Workspace/DscBuildData.py | 3 +++ BaseTools/Source/Python/build/BuildReport.py | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Sourc= e/Python/Common/GlobalData.py index 5eaee06694..f117998b0b 100644 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -103,7 +103,7 @@ MixedPcd =3D {} =20 # Structure Pcd dict gStructurePcd =3D {} - +gPcdSkuOverrides=3D{} # Pcd name for the Pcd which used in the Conditional directives gConditionalPcds =3D [] =20 diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 1fd1639ab6..5daefe835e 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -1537,6 +1537,9 @@ class DscBuildData(PlatformBuildClassObject): stru_pcd.SkuOverrideValues[skuid] =3D copy.deepcopy(st= ru_pcd.SkuOverrideValues[nextskuid]) if not NoDefault else copy.deepcopy({d= efaultstorename: stru_pcd.DefaultValues for defaultstorename in DefaultStor= es} if DefaultStores else {}) #{TAB_DEFAULT_STORES_DEFAULT:stru_pcd.Default= Values}) if not NoDefault: stru_pcd.ValueChain.add((skuid, '')) + if 'DEFAULT' in stru_pcd.SkuOverrideValues and not GlobalD= ata.gPcdSkuOverrides.get((stru_pcd.TokenCName, stru_pcd.TokenSpaceGuidCName= )): + GlobalData.gPcdSkuOverrides.update( + {(stru_pcd.TokenCName, stru_pcd.TokenSpaceGuidCNam= e): {'DEFAULT':stru_pcd.SkuOverrideValues['DEFAULT']}}) if stru_pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_= HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]: for skuid in SkuIds: nextskuid =3D skuid diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sourc= e/Python/build/BuildReport.py index 0b98d62cb6..358fdd82d6 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1295,7 +1295,10 @@ class PcdReport(object): FileWrite(File, ' %-*s : %6s %10s =3D %s' % (self.MaxLen= , Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType + ')', Value)) if IsStructure: FiledOverrideFlag =3D False - OverrideValues =3D Pcd.SkuOverrideValues + if (Pcd.TokenCName,Pcd.TokenSpaceGuidCName) in GlobalData.= gPcdSkuOverrides: + OverrideValues =3D GlobalData.gPcdSkuOverrides[(Pcd.To= kenCName,Pcd.TokenSpaceGuidCName)] + else: + OverrideValues =3D Pcd.SkuOverrideValues if OverrideValues: for Data in OverrideValues.values(): Struct =3D list(Data.values()) --=20 2.14.1.windows.1