From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id E618C941621 for ; Tue, 6 Feb 2024 14:56:26 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=lPDiEnQzRYbM4LYkuPgEiOv1Nmj1Y1HxPycgtPv6LP4=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1707231385; v=1; b=pzvFi2DTs8eajH82OvQ06jzJ1RdTSpeTxswJmVWB7ikTAhh8kcvNyoWk+im7d3I3s7hCtnoz ApAkQmunblpLRducUXLR7ZHPFqEU/4EGDi+Vl6mrQZh6BUWux3YcqW8zdBgV/CQMgiyoehAieeh Fs7el5LAZS2QPv2322Ig6vUs= X-Received: by 127.0.0.2 with SMTP id 1Ru6YY7687511xOsdXyoEcmN; Tue, 06 Feb 2024 06:56:25 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mx.groups.io with SMTP id smtpd.web11.14794.1707193125348175918 for ; Mon, 05 Feb 2024 20:18:45 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="563734" X-IronPort-AV: E=Sophos;i="6.05,246,1701158400"; d="scan'208";a="563734" X-Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2024 20:18:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,246,1701158400"; d="scan'208";a="1189384" X-Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmviesa006.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Feb 2024 20:18:44 -0800 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 5 Feb 2024 20:18:43 -0800 X-Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 5 Feb 2024 20:18:43 -0800 X-Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.41) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 5 Feb 2024 20:18:43 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M4gBq03z8rBZC57piogSJlRcyl1/SjHwmYayVK7LwZ34Jlh0izogwwmoc5Y0cgIVxLgkyqf62NzquqvZ6zsV0Ib+RZS2FbtT60X2FvqDNsQlCWyrNbSvQoJyVLJCULJccEETUT1ShWeiXGUX/JeLePsByvV8YMyaDNOzW8LVwbXpNp4YBh7uAz5HJktk0pya75D0mvosFdudDJjOz/lRRwel0KOIAQqb2EFb/IO5Zuw8LsGUmJjZW8Rdjad4vrFWuEiiM8fdMJQVxsCKu0q6OC0WOGtSF17bjqvAJXsCuEP23Cr+ijdn/q4Xqf+U6AfDB9SgpW55TOBqAd9QpoI+Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KScvj/ZzRe48aIQwT1aEQd5DYkUhhTM0gt/tJz5Re5s=; b=MXJ9/6M+ngFrJdFMuMDHCrceaoYj4BC330DGWGTLICJBlAjE+RsycIEC8nIIpvmp1tALZrY+ctF/JAW6kwOPvKLEWZOcpSxfrjZi0cmxB0IHGl5G4u9tyFNCDILbUwGgovvcmelYmLEyvU9AU+HK4iFyurtcCE9YmyVr9ptRZ8nq0hr4jogpD/wak9jTHTCGWSTGurYEDqcw5LscdIxyVpqkYmVz1N7mxATozfY6pZ7H/eOkMUT+nUCtIwjPT0bDOIdoHByC72hhMnCTT/9cErQc3qZk85nX/jn8pY/OxdIjv7sCilaHkw3gRZ2ilxm7dD9/gtRVpsUuNrieSbvbZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from PH7PR11MB5863.namprd11.prod.outlook.com (2603:10b6:510:135::11) by MW3PR11MB4620.namprd11.prod.outlook.com (2603:10b6:303:54::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36; Tue, 6 Feb 2024 04:18:41 +0000 X-Received: from PH7PR11MB5863.namprd11.prod.outlook.com ([fe80::e4d6:ab6:b4c7:8830]) by PH7PR11MB5863.namprd11.prod.outlook.com ([fe80::e4d6:ab6:b4c7:8830%7]) with mapi id 15.20.7249.035; Tue, 6 Feb 2024 04:18:41 +0000 From: "Feng, Bob C" To: "S, Ashraf Ali" , "devel@edk2.groups.io" CC: "Chen, Christine" , Rebecca Cran , Liming Gao , "Chan, Amy" , "Chaganty, Rangasai V" , "Solanki, Digant H" Subject: Re: [edk2-devel] [PATCH V3] BaseTools: Optimize GenerateByteArrayValue and CollectPlatformGuids APIs Thread-Topic: [PATCH V3] BaseTools: Optimize GenerateByteArrayValue and CollectPlatformGuids APIs Thread-Index: AQHaVdKsxOZ3s/spsEGMgyJAI1YDfLD8tpXA Date: Tue, 6 Feb 2024 04:18:40 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR11MB5863:EE_|MW3PR11MB4620:EE_ x-ms-office365-filtering-correlation-id: c3f3f202-5712-4376-ef30-08dc26cab30a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: E1dudC380Wf9HShlMD9Wo4vhC9cVU5TMTNO5ez7Va8kADltQyhYv0a4fe9dWzwPAK5WzgzoicC6c4oT3D8LMypoiOU7SwbYN2HnRgxhNedJWdtRTFXeiehg4HU/AbCQToKntLYh3KeaMoNccl/cb8QzfA0muJLDjfQZxcp6d/g4Qj4hwxiwxsJZ+nP7PYphOGjNpLetP1qtTXQpHiblzbnj1xXW5EEZ/ptXOdG271ArMnqaLYzSCOhSZgeMc8/15lgnMIetC9mH6nVdVdncl0TnyOX+Sds0fFbQenNOB2wvToSHJ9Goe+Ou+WJpjToagQzFFZcJBGo9dr/MU1S2BZR9/PfMa+VhGK541jJ+nG/Ih+NyCaBmIoXAMdTEy0FD4KR2V1c7Ib2etn6q8GojlsSO9uxB0NjNQl38qhHTH8aH06qTljN1Rgw6aNSxudpBqoVmEIWG68Gy12JcgATZNIvzp5Hp6MFv2izZm3VEKQ1nubamHG/Jghte33p6NyB83xTCCZYaQHmvIvL+iciwOrsz+FIGEV3Swje785IqlPR+RApC5TC1QQKLieFSx8pMpgdtC+0QN1BBj4HkqzyaoAPvCR1OG79DgXEkrsVXmjWQ= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?cs9faPt1Y+MzWX5XYK57SesTsvRToWdthUcFZ9B8wHj4SgGx9QTWf3k7dANc?= =?us-ascii?Q?n4eqKJ6y7bfN2QTI/GHQlSITArpO6oK3dXliD3UE0ThJG5ZwKlBsCop1EqUL?= =?us-ascii?Q?3AeuMHp9BEx1ImBL5ZCDnEHdeQiTGbaeURF+od9eUHfiUVONiUU7QIkDd0aB?= =?us-ascii?Q?SjCxkILPZjGczA2W651KAD0jK6J17NQBgfNn4f8HjxUYygK0x2vzRRsGfZDq?= =?us-ascii?Q?6hAe7t8jqzar5S6Vyi8yGTFdu8qUPuaatdDwRLRp2ObR+FIPGKWOO6J1G+8s?= =?us-ascii?Q?XnP3NMAgNzGEHfbHCeX1/zrB8la4W3Mr6cM5Noi9E7TgzDegc+Jqd8P0Vv0P?= =?us-ascii?Q?wXT0txD9maX7PN02pHI5tDPVuvLScEqSKrB/Vvdk0zt00ai/ZPDkTNQRlG8/?= =?us-ascii?Q?7AAoU2r6do0it2s1+sozNhvKUO1gr4m6v0fxf6H1sx5UhjPKLLu5V5DLcj2r?= =?us-ascii?Q?lQcuD8yD6gqJTzk2cnU6koVhSgqQiRgw3xFvz82pdZcl2oXRnnq/99s1YNID?= =?us-ascii?Q?UkcDqrWDJ/dh7Lm5Y+mONAqVTSEIFiv0HoFnB4y/aBJW8V22IwgjrQQClR/e?= =?us-ascii?Q?9aiKuriOv117aR5ieUHg0gKtghaQTJjrjnL+LJ16ut2h62P/nml0up7ZPeIp?= =?us-ascii?Q?HXzsZoOj2dqVNZ8hKu57GOhVshbSxzea0fIS8qNuEvu6vwNnoRmiV6t/VBVB?= =?us-ascii?Q?JXfsUEgTOPcv7iKzCvq517HWMp6saevYTwGfBCeRIyvh5zzTbiI/oboMYgnL?= =?us-ascii?Q?XLmrAN/u4R6Animc45tNJBlgqaPq0zp9MO9clMq8EnRGs6aE0Lildtzum3nm?= =?us-ascii?Q?lemW/jNeNkww+HlL9QGEecEbXgm8QwLipl1qkHbo1xUGSd/XcwawzuTSe3JL?= =?us-ascii?Q?c73FVo8FD9PVbKrEUyaENp+aLc0eX3L5rvfkxn/fweoj4Z4QwKzXNae1P5PO?= =?us-ascii?Q?XUEwW78evaRdz42kiBGT3q9cr5QveqxtwV8TeZjQVg5/yScc+FFVHKF8Cubn?= =?us-ascii?Q?Alh5RKkUmfIxPBOop32RQkJvyVRTOWkQ9QhqC1se1REgeZspAsxGrR5PhgsC?= =?us-ascii?Q?es721jk5TGvwlX53Pxea8FTzknVTWo80PlUR/8i/QZzPDYAKtNcyLvntNK98?= =?us-ascii?Q?EEXmnOcvksdQMixMmogv4MuUWICY6poYjxqu7ph3cDAoaZSldzvwfmCIgJtL?= =?us-ascii?Q?B6gI/agqC+Ibfnvsivkr1EYUb7ZkYCL/MxYcHSRIgUCwiS5vnFJJNKg1L2bY?= =?us-ascii?Q?+kgkRZfWQ4Jz8P3uQIsq8dDyw0ORFnLDbW46LcQ76bGIxbiArWhU5cLKUv+L?= =?us-ascii?Q?66eX2TjYrflj2i224RkAm0S61sGflBlngZ5EF662Y+vwNsNJ8qoMfdWirycZ?= =?us-ascii?Q?yz1GEIZcoNEdRhDFL51XJodEiQE+hflLtlloloHrVxQ9UUrl7wDNwX/UY+f8?= =?us-ascii?Q?I0jRqt8B3OaqvAXQ2CCOTAcj362CHBXebohNMXxHml+X5NuY2OQlMLbc5u1z?= =?us-ascii?Q?CgX7Tj+7pqGwEx5bsIaRzkoFdcls+NHMnzYHqESpEjc6tBrBc5ImbOxRwG+l?= =?us-ascii?Q?+acmRSoQETkFWzZAc5ftNJJDawkwYzzd4hIcAOgO?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB5863.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3f3f202-5712-4376-ef30-08dc26cab30a X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Feb 2024 04:18:40.8335 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: F/daQCg6+0znbUEGjpc3vi6GDAvsANlW47eILjyVjX5VCqwD+OgjtV8IYtp3s6G4Y3h+dDrp6ZjvEpl+9tvbCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4620 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,bob.c.feng@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 0xOe7y6AmZMjmYtWcuH6FiU2x7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=pzvFi2DT; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Hi Ashraf, Thanks for updating the patch. Besides the PCD default value, I think there are still 2 more things need t= o check. These 2 things could impact the output of the PcdValueInit.exe. 1. Macros definition in BuildOption There would be a case that the Macros are used in Structure Pcd's definitio= n in header file. User can change the structure pcd's struct def via changing the Macro value= from command line or dsc file. 2. The header file list defined in DEC The [Includes] section in dec list folder that contains the structure pcd d= efinition header file. There may be case that user changes the folder under [Includes] to change t= he header file to change the structure pcd struct definition. Thanks, Bob -----Original Message----- From: S, Ashraf Ali =20 Sent: Friday, February 2, 2024 8:23 PM To: devel@edk2.groups.io Cc: S, Ashraf Ali ; Chen, Christine ; Rebecca Cran ; Liming Gao ; Feng, Bob C ; Chan, Amy ; = Chaganty, Rangasai V ; Solanki, Digant H Subject: [PATCH V3] BaseTools: Optimize GenerateByteArrayValue and CollectP= latformGuids APIs During the Incremental build GenerateByteArrayValue used to generate the By= teArrayValue even when there is no change in the PCD/VPDs. which is time co= nsuming API based on the number of PCD/VPDs and SKU IDs. The optimization is that GenerateByteArrayValue is used to store the Struct= uredPcdsData in a JSON file for each of the arch. and during the Incrementa= l build this API will check, if there is any change in the Structured PCD/V= PDs then rest of the flow remains the same. if there is no change then it will return the provious build data. Flow: during the 1st build StructuredPcdsData.json is not exists, StructuredPcdsD= ata will be dumped to json file. and it will copy the output.txt as well. Note: as the output.txt are different for different Arch, so it will be sto= red in the Arch folder. During the Incremental build check if there is any change in Structured PCD= /VPD. if there is a change in Structured VPD/PCD then recreate the Structur= edPcdsData.json, and rest of the flow remains same. if there is no change in VPD/PCD read the output.txt and return the data Unit Test: Test1: Modified the Structured Pcds default from DEC file. current flow is = executing. Test2: Override the default value of the PCD from DEC file. current flow is= executing. Test3: Modified/Override the PCD from DSC file. current flow executing Test4: Modified/Override the FDF from DSC file. current flow executing Test5: update the default value from Command Line.current flow executing Test6: Build without change in PCD in DSC, FDF, DEC and Command Line the pr= oposed changes will be executing, and the return data remains the same with= and without the changes. With these changes it's helping to save around ~2.5min to ~3.5min of Increm= ental build time in my build environment. Sample PR: https://github.com/tianocore/edk2-basetools/pull/113 Cc: Yuwei Chen Cc: Rebecca Cran Cc: Liming Gao Cc: Bob Feng Cc: Amy Chan Cc: Sai Chaganty Cc: Digant H Solanki Signed-off-by: Ashraf Ali S --- .../Source/Python/AutoGen/WorkspaceAutoGen.py | 16 ++-- .../Source/Python/Workspace/DscBuildData.py | 85 ++++++++++++++++--- 2 files changed, 79 insertions(+), 22 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py b/BaseTool= s/Source/Python/AutoGen/WorkspaceAutoGen.py index 160e3a3cd3..eec9280c8e 100644 --- a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py @@ -160,22 +160,18 @@ class WorkspaceAutoGen(AutoGen): =20 def CollectPlatformGuids(self): oriInfList =3D [] - oriPkgSet =3D set() - PlatformPkg =3D set() + pkgSet =3D set() for Arch in self.ArchList: Platform =3D self.BuildDatabase[self.MetaFile, Arch, self.Buil= dTarget, self.ToolChain] oriInfList =3D Platform.Modules for ModuleFile in oriInfList: ModuleData =3D self.BuildDatabase[ModuleFile, Platform._Ar= ch, Platform._Target, Platform._Toolchain] - oriPkgSet.update(ModuleData.Packages) - for Pkg in oriPkgSet: - Guids =3D Pkg.Guids - GlobalData.gGuidDict.update(Guids) + pkgSet.update(ModuleData.Packages) if Platform.Packages: - PlatformPkg.update(Platform.Packages) - for Pkg in PlatformPkg: - Guids =3D Pkg.Guids - GlobalData.gGuidDict.update(Guids) + pkgSet.update(Platform.Packages) + for Pkg in pkgSet: + Guids =3D Pkg.Guids + GlobalData.gGuidDict.update(Guids) =20 @cached_property def FdfProfile(self): diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 4768099343..a9a069c0d4 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -37,6 +37,8 @@ from functools import reduce from Common.Misc import Sav= eFileOnChange from Workspace.BuildClassObject import PlatformBuildClassObj= ect, StructurePcd, PcdClassObject, ModuleBuildClassObject from collections= import OrderedDict, defaultdict +import json +import shutil =20 def _IsFieldValueAnArray (Value): Value =3D Value.strip() @@ -56,6 +58,7 @@ def _IsFieldValueAnArray (Value): =20 PcdValueInitName =3D 'PcdValueInit' PcdValueCommonName =3D 'PcdValueCommon' +StructuredPcdsDataName =3D 'StructuredPcdsData.json' =20 PcdMainCHeader =3D ''' /** @@ -2750,6 +2753,23 @@ class DscBuildData(PlatformBuildClassObject): ccflags.add(item) i +=3D1 return ccflags + + def GetStructurePcdSet (self, OutputValueFile): + if not os.path.isfile(OutputValueFile): + EdkLogger.error("GetStructurePcdSet", FILE_NOT_FOUND, "Output.= txt doesn't exist", ExtraData=3DOutputValueFile) + return [] + File =3D open (OutputValueFile, 'r') + FileBuffer =3D File.readlines() + File.close() + + #start update structure pcd final value + StructurePcdSet =3D [] + for Pcd in FileBuffer: + PcdValue =3D Pcd.split ('|') + PcdInfo =3D PcdValue[0].split ('.') + StructurePcdSet.append((PcdInfo[0], PcdInfo[1], PcdInfo[2], Pc= dInfo[3], PcdValue[2].strip())) + return StructurePcdSet + def GenerateByteArrayValue (self, StructuredPcds): # # Generate/Compile/Run C application to determine if there are any= flexible array members @@ -2757,6 +2777,55 @@ class DscBuildData(PlatformB= uildClassObject): if not StructuredPcds: return =20 + StructuredPcdsData =3D {} + + for PcdName in StructuredPcds: + Pcd =3D StructuredPcds[PcdName] + TokenSpaceGuidCName =3D Pcd.TokenSpaceGuidCName + TokenCName =3D Pcd.TokenCName + + # Create a key using TokenSpaceGuidCName and TokenCName + StructuredPcdsData[f"{TokenSpaceGuidCName}_{TokenCName}"] =3D = { + "DefaultValueFromDec": Pcd.DefaultValueFromDec, + "DefaultValues": Pcd.DefaultValues, + "PcdFieldValueFromComm": Pcd.PcdFieldValueFromComm, + "PcdFieldValueFromFdf": Pcd.PcdFieldValueFromFdf, + "DefaultFromDSC": Pcd.DefaultFromDSC, + "PcdFiledValueFromDscComponent": Pcd.PcdFiledValueFromDscC= omponent + } + + # + # If the output path doesn't exists then create it + # + if not os.path.exists(self.OutputPath): + os.makedirs(self.OutputPath) + + StructuredPcdsDataPath =3D os.path.join(self.OutputPath, self._Arc= h, StructuredPcdsDataName) + PcdRecordOutputValueFile =3D os.path.join(self.OutputPath,=20 + self._Arch, 'Output.txt') + + if not os.path.exists(os.path.dirname(StructuredPcdsDataPath)): + os.makedirs(os.path.dirname(StructuredPcdsDataPath)) + # + # Check if the StructuredPcdsData.json exists or not + # if exits then it might be a incremental build then check if the = StructuredPcdsData has been changed or not. + # if changed then proceed further, if not changed then return the = stored data from earlier build + # + if os.path.isfile(StructuredPcdsDataPath): + with open(StructuredPcdsDataPath, 'r') as file: + StoredStructuredPcdsData =3D json.load(file) + if StructuredPcdsData =3D=3D StoredStructuredPcdsData: + return self.GetStructurePcdSet(PcdRecordOutputValueFil= e) + else: + # update the record as PCD Input has been changed in i= ncremental build + with open(StructuredPcdsDataPath, 'w') as file: + json.dump(StructuredPcdsData, file, indent=3D2) + else: + # + # 1st build, create the StructuredPcdsData.json + # + with open(StructuredPcdsDataPath, 'w') as file: + json.dump(StructuredPcdsData, file, indent=3D2) + InitByteValue =3D "" CApp =3D PcdMainCHeader =20 @@ -2832,8 +2901,6 @@ class DscBuildData(PlatformBuildClassObject): =20 CApp =3D CApp + PcdMainCEntry + '\n' =20 - if not os.path.exists(self.OutputPath): - os.makedirs(self.OutputPath) CAppBaseFileName =3D os.path.join(self.OutputPath, PcdValueInitNam= e) SaveFileOnChange(CAppBaseFileName + '.c', CApp, False) =20 @@ -3042,17 +3109,11 @@ class DscBuildData(PlatformBuildClassObject): if returncode !=3D 0: EdkLogger.warn('Build', COMMAND_FAILURE, 'Can not collect = output from command: %s\n%s\n%s\n' % (Command, StdOut, StdErr)) =20 - #start update structure pcd final value - File =3D open (OutputValueFile, 'r') - FileBuffer =3D File.readlines() - File.close() + # Copy update output file for each Arch + shutil.copyfile(OutputValueFile, PcdRecordOutputValueFile) =20 - StructurePcdSet =3D [] - for Pcd in FileBuffer: - PcdValue =3D Pcd.split ('|') - PcdInfo =3D PcdValue[0].split ('.') - StructurePcdSet.append((PcdInfo[0], PcdInfo[1], PcdInfo[2], Pc= dInfo[3], PcdValue[2].strip())) - return StructurePcdSet + #start update structure pcd final value + return self.GetStructurePcdSet(OutputValueFile) =20 @staticmethod def NeedUpdateOutput(OutputFile, ValueCFile, StructureInput): -- 2.39.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115168): https://edk2.groups.io/g/devel/message/115168 Mute This Topic: https://groups.io/mt/104118103/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-