From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::242; helo=mail-lj1-x242.google.com; envelope-from=vladimir.olovyannikov@broadcom.com; receiver=edk2-devel@lists.01.org Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5862C211B76C7 for ; Tue, 5 Feb 2019 08:58:22 -0800 (PST) Received: by mail-lj1-x242.google.com with SMTP id v1-v6so3564818ljd.0 for ; Tue, 05 Feb 2019 08:58:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:references:in-reply-to:mime-version:thread-index:date :message-id:subject:to:cc; bh=18DSr8j+oQ5G7sSmGWSIDpNb7YBJJOLiodBzulK5m1g=; b=crT7+3D50z2EF7iuy6o16/1tQq2c+6aEB9IFSOVZPSWVnnu1Rmo/JoeXc4Xg0Iqcuu n31LNqLir4gQCkT+fzK7JogcmX5o3shldgdgMAL4IwiQuznGZu7gbHT9uhAvN1nE56OK qZ9fy3L3M9gjSljpssSZTpdT8bolIVxy5b2DI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc; bh=18DSr8j+oQ5G7sSmGWSIDpNb7YBJJOLiodBzulK5m1g=; b=JZO8YTgczrzrsuXEOSI7P9oO4JW2BBHevvXawnyXIxeD5TndfZYigliqZvpBivJLZy joF8EweulHXTIw9kRwS/xuVMFcwGqQuo35Dvtw+LF8RccB0kmWHXdfklgu1tF2er4OnZ ylFbduQvGGsHxoXbjBeoxV15sAdY9WSwsr0iV3mFsUxNOv0zJi7TfYyrz7dKnPNFtm8m vgRuorl4ooOM7so14LRbHHdeUmoPO29iFGnEFNXU6G975Vhp1ydT7CSXjTZ996om1DQo 2RNQHsCFcZI7DYWG/JkoEAZMylxyil52XHnBdWDSwMpGpHmdx8Yrz3LPApOFjn08kI7q JE+w== X-Gm-Message-State: AHQUAuaECDxwwMBoey/hg7+MXeJ7MssJYIS/M+Fl2b1LG9bjoBHYnPt/ sgqETGHwSoiN3jatGw98Qih8sk7Hf8sVQm0Fl2nULQ== X-Google-Smtp-Source: AHgI3IZGeVxqMeNP5iChSx8dKtMoPL8UvEIYj/nrIjTrmEFuhEI0mjhHm4LrCtITqM8OCfHq9C3O06cXXA7UGJM/RnI= X-Received: by 2002:a2e:4819:: with SMTP id v25-v6mr3600819lja.2.1549385900181; Tue, 05 Feb 2019 08:58:20 -0800 (PST) From: Vladimir Olovyannikov References: <20190205112213.682-1-lersek@redhat.com> In-Reply-To: <20190205112213.682-1-lersek@redhat.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQKrvtQqJK8FP9G4vtDNoY7+ZluwyaQjaa4Q Date: Tue, 5 Feb 2019 08:58:18 -0800 Message-ID: <25510a796451b6ffcc9ada39be8d3d6d@mail.gmail.com> To: Laszlo Ersek , edk2-devel@lists.01.org Cc: Bob Feng , Liming Gao , Yonghong Zhu Subject: Re: [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: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 X-List-Received-Date: Tue, 05 Feb 2019 16:58:22 -0000 Content-Type: text/plain; charset="UTF-8" Laszlo, Thanks a lot for the prompt fix. Works now. Tested-by: Vladimir Olovyannikov -----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 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 PCDs not used by modules or in conditional directives section of the build report. 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). 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. 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. Reported-by: Vladimir Olovyannikov Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1513 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 --- Notes: Repo: https://github.com/lersek/edk2.git Branch: report_without_struct_pcds BaseTools/Source/Python/build/BuildReport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 = [] - StructPcdDict = GlobalData.gStructurePcd[self.Arch] + StructPcdDict = GlobalData.gStructurePcd.get(self.Arch, collections.OrderedDict()) for Name, Guid in StructPcdDict: if (Name, Guid) not in Pa.Platform.Pcds: Pcd = StructPcdDict[(Name, Guid)] -- 2.19.1.3.g30247aa5d201