From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: bob.c.feng@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by groups.io with SMTP; Thu, 19 Sep 2019 02:10:15 -0700 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; 19 Sep 2019 02:10:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,523,1559545200"; d="scan'208";a="186744622" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga008.fm.intel.com with ESMTP; 19 Sep 2019 02:10:15 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 19 Sep 2019 02:10:14 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.146]) with mapi id 14.03.0439.000; Thu, 19 Sep 2019 17:10:13 +0800 From: "Bob Feng" To: "Fan, ZhijuX" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH V2] BaseTools:Fix the issue that build report failed Thread-Topic: [PATCH V2] BaseTools:Fix the issue that build report failed Thread-Index: AdVuyTWCzv0heTWOQ46WXN97ptp/uQAALumw Date: Thu, 19 Sep 2019 09:10:13 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D161537261@SHSMSX104.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Fan, ZhijuX=20 Sent: Thursday, September 19, 2019 5:04 PM To: devel@edk2.groups.io Cc: Gao, Liming ; Feng, Bob C Subject: [PATCH V2] BaseTools:Fix the issue that build report failed BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2201 An error occurs using special VpdPcd that is not used in the Inf file In dsc: [PcdsDynamicExVpd.common.DEFAULT] gBoardModuleTokenSpaceGuid.test1|*|{CODE({ {0x0} // terminator })} In dec: [PcdsDynamicEx] # Vpd GPIO table gBoardModuleTokenSpaceGuid.test1|{0}|GPIO_INIT_CONFIG[]|0x50000018 { Library/GpioLib.h MdePkg/MdePkg.dec } ValueError: invalid literal for int() with base 0: '*' This Patch is going to fix issue Cc: Liming Gao Cc: Bob Feng Signed-off-by: Zhiju.Fan --- Old title:Change the way that get some VpdPcd information=20 BaseTools/Source/Python/build/BuildReport.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sourc= e/Python/build/BuildReport.py index 6b26f1c3b0..880459d367 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1419,10 +1419,19 @@ class PcdReport(object): FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.= VpdOffset)) VPDPcdItem =3D (Pcd.TokenSpaceGuidCName + '.' + Pc= dTokenCName, SkuIdName, SkuInfo.VpdOffset, Pcd.MaxDatumSize, SkuInfo.Defaul= tValue) if VPDPcdItem not in VPDPcdList: - VPDPcdList.append(VPDPcdItem) + PcdGuidList =3D self.UnusedPcds.get(Pcd.TokenS= paceGuidCName) + if PcdGuidList: + PcdList =3D PcdGuidList.get(Pcd.Type) + if not PcdList: + VPDPcdList.append(VPDPcdItem) + for VpdPcd in PcdList: + if PcdTokenCName =3D=3D VpdPcd.TokenCN= ame: + break + else: + VPDPcdList.append(VPDPcdItem) if IsStructure: FiledOverrideFlag =3D False - OverrideValues =3D Pcd.SkuOverrideValues[Sku] + OverrideValues =3D Pcd.SkuOverrideValues.get(Sku) if OverrideValues: Keys =3D list(OverrideValues.keys()) OverrideFieldStruct =3D self.OverrideFieldValu= e(Pcd, OverrideValues[Keys[0]]) --=20 2.14.1.windows.1