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.100; helo=mga07.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 ECB87211BD5E6 for ; Wed, 6 Feb 2019 15:08:55 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2019 15:08:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,342,1544515200"; d="scan'208";a="131645310" Received: from orsmsx109.amr.corp.intel.com ([10.22.240.7]) by FMSMGA003.fm.intel.com with ESMTP; 06 Feb 2019 15:08:54 -0800 Received: from orsmsx155.amr.corp.intel.com (10.22.240.21) by ORSMSX109.amr.corp.intel.com (10.22.240.7) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 6 Feb 2019 15:08:54 -0800 Received: from orsmsx153.amr.corp.intel.com ([169.254.12.50]) by ORSMSX155.amr.corp.intel.com ([169.254.7.147]) with mapi id 14.03.0415.000; Wed, 6 Feb 2019 15:08:54 -0800 From: "Carsey, Jaben" To: 'Vladimir Olovyannikov' , Laszlo Ersek , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] BaseTools/BuildReport: fix report for platforms/arches without struct PCDs Thread-Index: AQHUvUUTTb85IxYQF0unJsdgysad9aXR844AgAFTFfCAACCEIA== Date: Wed, 6 Feb 2019 23:08:54 +0000 Message-ID: References: <20190205112213.682-1-lersek@redhat.com> <25510a796451b6ffcc9ada39be8d3d6d@mail.gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTg5N2YwMTUtYzA5YS00YTkwLWI0NzMtM2E2MjE2ZDc3MzNmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibDQ3R1FhUTJienh0c0I1bDZQd1lzMDdRNUdUdzVxTmk5bkc3Rk13R2UwYUhkSml0YXB6OU9yN25rR1NIXC9IN0EifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Subject: FW: [PATCH] BaseTools/BuildReport: fix report for platforms/arches without struct PCDs 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: Wed, 06 Feb 2019 23:08:56 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I sent this earlier, but failed the mailing list part. Reviewed-by: Jaben Carsey And pushed. > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Vladimir Olovyannikov via edk2-devel > Sent: Tuesday, February 05, 2019 8:58 AM > To: Laszlo Ersek ; edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: Re: [edk2] [PATCH] BaseTools/BuildReport: fix report for > platforms/arches without struct PCDs >=20 > Laszlo, > Thanks a lot for the prompt fix. Works now. >=20 > Tested-by: Vladimir Olovyannikov >=20 > -----Original Message----- > From: Laszlo Ersek [mailto:lersek@redhat.com] > Sent: Tuesday, February 5, 2019 3:22 AM > To: edk2-devel@lists.01.org > Cc: Bob Feng; Liming Gao; Vladimir Olovyannikov; Yonghong Zhu > Subject: [PATCH] BaseTools/BuildReport: fix report for platforms/arches > without struct PCDs >=20 > The goal of commit 97c8f5b9e7d3 ("BaseTools:StructurePCD value display > incorrect in "Not used" section.", 2019-02-02) was to display the full > contents of such structure PCDs in the build report that were set in the > platform DSC or the FDF, but not used in any module INFs. The listings > would appear in the >=20 > PCDs not used by modules or in conditional directives >=20 > section of the build report. >=20 > Commit 97c8f5b9e7d3 assumed that any (platform, architecture) > combination > would have a (possibly empty) set of structure PCD (and so the set of the > structure PCDs could be filtered for set-but-unused ones). >=20 > This is not the case: in "DscBuildData.py", in method > UpdateStructuredPcds(), if "S_pcd_set" remains an empty OrderedDict(), > then it is not added to "GlobalData.gStructurePcd" *at all*, for the > current (platform, architecture) combination. >=20 > As a result, when the PCD report tries to fetch the set of structure PCDs > for the current (platform, architecture), "GlobalData.gStructurePcd" does > not return an empty OrderedDict(); instead, it raises a KeyError. Fix it > by defaulting to an empty OrderedDict(), with the get() method. >=20 > Reported-by: Vladimir Olovyannikov > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1513 > Fixes: 97c8f5b9e7d3136b6051a05cf056ce5ca9e79893 > Cc: Bob Feng > Cc: Liming Gao > Cc: Vladimir Olovyannikov > Cc: Yonghong Zhu > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek > --- >=20 > Notes: > Repo: https://github.com/lersek/edk2.git > Branch: report_without_struct_pcds >=20 > BaseTools/Source/Python/build/BuildReport.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/BaseTools/Source/Python/build/BuildReport.py > b/BaseTools/Source/Python/build/BuildReport.py > index e457660fcef3..0b98d62cb6aa 100644 > --- a/BaseTools/Source/Python/build/BuildReport.py > +++ b/BaseTools/Source/Python/build/BuildReport.py > @@ -780,7 +780,7 @@ class PcdReport(object): > # Collect the PCD defined in DSC/FDF file, but not used in > module > # > UnusedPcdFullList =3D [] > - StructPcdDict =3D GlobalData.gStructurePcd[self.Arch] > + StructPcdDict =3D GlobalData.gStructurePcd.get(self.Arch, > collections.OrderedDict()) > for Name, Guid in StructPcdDict: > if (Name, Guid) not in Pa.Platform.Pcds: > Pcd =3D StructPcdDict[(Name, Guid)] > -- > 2.19.1.3.g30247aa5d201 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel