From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.6700.1676429043979267164 for ; Tue, 14 Feb 2023 18:44:04 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=PSykCDbn; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: yuwei.chen@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676429044; x=1707965044; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=2vAYjEJMsi+YCZtlu62+1YYKGS+XhI8z7IP+9JtLVCI=; b=PSykCDbniAgkBIjEAGQUnS0tHvkQ6YXDe7XfN6HNRQStZA29OhukFiLS +a4iBBu3HWO6466yjrJOx48EmzIYAX7oYQr90cE9Hla4wOSF+LZkPUoX1 KBCCcyRxHlDH+IyDfk51kQEyY/JXQbiZdrcFNJJcLcrTmcLkXzdCrxXYV hqTggga4/+nnJQ3V3gsTzOEtlzqhwow/7c19zMpxjrRaFeqBn34/Ads3a P94BSr0nnVcl9iScuNpebMHEQEDEniAcjTGRW4YhOg28kOx72nzCHEviO HMYG2svNUhxuovcscXNhUKfVlVk3gJkBEqssVkUpYwqtmkUQbS085L5E+ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="331333801" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="331333801" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Feb 2023 18:44:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="843399079" X-IronPort-AV: E=Sophos;i="5.97,298,1669104000"; d="scan'208";a="843399079" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga005.jf.intel.com with ESMTP; 14 Feb 2023 18:44:00 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 14 Feb 2023 18:44:00 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) 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.16; Tue, 14 Feb 2023 18:43:59 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.16 via Frontend Transport; Tue, 14 Feb 2023 18:43:59 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Tue, 14 Feb 2023 18:43:59 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mkkJX8WK3UxnvlSK4aKMhbW6XbPC4vQbTS9nAMmoJgsD/0KrcQxjxjITv7wd3UkBC1/uTUJYxkcG72cyNNzNHGU380XW1ZMlcAd6utPJv87BQDHalt2pW9v+p62F5ZEkB0wCqPUB5YreEDSzK/fba0K8tW/ljXFzRvS8jO5119GX8T6Jw2BLY+lQR4621Eefav5hBP67KbFdZIJj4qxdgzwiEKXkrNmkQ7L00yE7YwLObY3G2Poc6rzg813UzWxBZTERMf7hxxKY7msd/xl5tqrAK/dB7fWD3LyHBDBOlDSgRlTFJnLy8SnRUF9AseybvYpuPRHR//TUsNl+9NBbBQ== 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=RPOQ85zDKCni/OeTy8HggehqRojDDWVHKZF5zvQSKII=; b=Yqt8t4bx9rsFWiHAtAcQiQvdPNlu3rFe1+CULlONKFPk/qgWA/cT3R6bQwOb5913TDmPeXafpLtMOHwi4ySXHcO4l//jVtuTn/YM25CEkUD0eSND3e0INNKbCU8cTu/7qOjD14g5vv8me2aSyKEkLPSU0WCP4BFz/jjhQPJ9XeG8gtUrHAuUXNqNlBpPF1PLKWgM8RPzcZ+1u3mcPEmSPhmUUDm+gcbtrXMeBnB5LgsL6cRI/fdOYQDgm/9/T/gXI8HJlu6oekARjcnGFEBmzE6Ys6U1zjnuvRoVHiPrkqqc/So9lVQJPZqKoamrOAnIksdRnrk6+IZ0XpmVGnOglA== 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 Received: from MW5PR11MB5906.namprd11.prod.outlook.com (2603:10b6:303:1a0::21) by SJ0PR11MB6718.namprd11.prod.outlook.com (2603:10b6:a03:477::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.24; Wed, 15 Feb 2023 02:43:57 +0000 Received: from MW5PR11MB5906.namprd11.prod.outlook.com ([fe80::d610:f67a:d742:521b]) by MW5PR11MB5906.namprd11.prod.outlook.com ([fe80::d610:f67a:d742:521b%5]) with mapi id 15.20.6086.026; Wed, 15 Feb 2023 02:43:57 +0000 From: "Yuwei Chen" To: "Palomino Sosa, Guillermo A" , "devel@edk2.groups.io" CC: "Feng, Bob C" , "Gao, Liming" Subject: Re: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile information in build report Thread-Topic: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile information in build report Thread-Index: AQHZOqFPgO4Xf0lJDE60jEmtZdLsXa7PWLqg Date: Wed, 15 Feb 2023 02:43:57 +0000 Message-ID: References: <320a45f265969df1a108777713e5ac954a75be56.1675735858.git.guillermo.a.palomino.sosa@intel.com> In-Reply-To: <320a45f265969df1a108777713e5ac954a75be56.1675735858.git.guillermo.a.palomino.sosa@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW5PR11MB5906:EE_|SJ0PR11MB6718:EE_ x-ms-office365-filtering-correlation-id: c95bccf3-c01d-4d0a-1c21-08db0efe7c69 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HMrCjIacvSBtlP3cZ/nBSXgxQh4Nrk33YNYkhm8kuJuEb4tlZjTvlNhGPpEaRXX5+7PJ02YG4jevMLF2H0rDkroVordGr7C7+nRfD2+FhlCMki36qq1XsEkdHNsCgmL+sK5p9X224730qv+ARMcvsHpEun5zCjfNNwu94vGym04kU00Mv7yTHgDwHHQsOxVEGCMAuMeBeCelKR25Fz4E8OV2RQFFmvJWNqMQNMSEacJKq1xtIGjuQ234EkQqUzr+J/WqtxIiJL/NU6aYqO14gBIE15LNLGRRvIWlJmNdDNzI4dScBboZdbFh+h0K3ACmIAKjQ8p6s+xmlbJPX6VZAJZrqN5mVrOhikb8V5dM5t4oiuIgFT09hiSEz/3AyH3KVm/2+hY3LFzmkIiKthGyY/VLcODC+4vF93Vh/muuwDcn5OmffAOy2DcAJwbewdCTaeDePZgmmTymRp/b9DXhxHGHASU47f1+AhgQ7oSrUrJAnwt4pbJR1GWZQ0RIyIKoLjRi2YJnmTFnEjEzAjPpYmgKRxrbbhSRO3zlUtsUQiYCWoaTePi5Y2EY53tEltsAxOHiJbYl3Q/lo5RWWgKwF7nmLBi7Y5YOZDBadVfiKjv4x/38jT3JaVYJG/sxK9WoK7mAQhKJv1ki/eE+2L5X9u03zhmn4ivdUlnnqtz4dik93L9ydY3Q0PbDyEWb+H2E x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW5PR11MB5906.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(366004)(39860400002)(346002)(376002)(136003)(396003)(451199018)(5660300002)(41300700001)(52536014)(30864003)(2906002)(66476007)(8936002)(53546011)(66556008)(64756008)(66946007)(76116006)(4326008)(66446008)(8676002)(55016003)(316002)(110136005)(6506007)(54906003)(478600001)(7696005)(26005)(186003)(9686003)(71200400001)(86362001)(122000001)(38100700002)(33656002)(83380400001)(82960400001)(38070700005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qlTDqxbIChGFpYri+rUQDCkGcUnHNTNZvtAr9OPYfZJ9GAQ29mfDo21utJZd?= =?us-ascii?Q?8ltWnnklXSYGA1v+bcbSxODG13hxtmhxsR7uhfpR+9ZhL1Lm/6HhMwdw6/fX?= =?us-ascii?Q?uErIVHs6qTMSofGTyUraSM1DvAuucjPjkkRA1CT+MqbOfL+VWVxPjctbDEBM?= =?us-ascii?Q?1pryeWkjEIO0Yu4JjiWEG0XOPFDfqaWZds0Dplw+7wXQt9P9zjBknIpmsfi2?= =?us-ascii?Q?o20KTeESBMFcqFn5fX0VeuqQ4GUFPrlWrGdMCRCh3JcREUkZMoslBGbQ1oEb?= =?us-ascii?Q?EUfqfc2ZB3kcPXhkng71VTTGXKmT9QVECi1R6O287g+LgSIIqb7E1BNVUN6f?= =?us-ascii?Q?FCsRp8ous6TDbFnPV+hVoKHY8kOqL8g37I0PcqR2Iwh+GMXX4rGGw6WHK4Gd?= =?us-ascii?Q?rHVFquc+urZbaU3jseVmWtMpjQr8TjltPxWJXKqoD35ab40Cb1iOYNgalwAl?= =?us-ascii?Q?4BiScpAZyKIMXYY86++6HhcHvn82FHpcc5UNX1SuL6svdcALomBtfqENscSf?= =?us-ascii?Q?O6VwOCEOccgO2vn8GEN7oHbMu+/nzdO2j2btVuWBwfwLUFxQUu/xe6GqCsEm?= =?us-ascii?Q?wg3fgjX+O0p4H8KypkYLm6YzujZ5zMS7OGh1nqb+E8MNqW3Xth76BhHCl+aj?= =?us-ascii?Q?GWKPMWA6e9wQW+SpbwteuWkycgfocAp7GVvqzHx2HQGEQzg/sztVWy0CL0eO?= =?us-ascii?Q?R6KXWmWRoV0NS/kyUjFw5YhH/uoyIyYm1XglEvEK2KUT1corJKUZMb+e1o7N?= =?us-ascii?Q?PnzQCQ3XQNopq6eR2NfO/s4zeGgwVK4Mkd7pu24NQOUJNr2J35Ma/66u2Ne+?= =?us-ascii?Q?9zt5943Ch5mg7H6EzH7SNV64oRg7iKSwMNq2bfRcPz6HbEKwy8XL09gsI6qR?= =?us-ascii?Q?DhQ86iAv+Q26mgS5d5TJjccDJHlxyrklQDj0PwadBsiOkHaFYtanu/ak4weB?= =?us-ascii?Q?0UHI5tfZhSfjyhfLO1hKXfYO5YOgyoKRISVxY05aYhHd6KdcH9r7Tgsg/fqy?= =?us-ascii?Q?iX4xKK2WzmM3S2uyl5PEkAaUjEfwKPTUUn390vV3/EI3EtHLsfIhIlQW1B6v?= =?us-ascii?Q?aJDT+KFbmDS5zHcSL0I2FwxA5MW33o/xxoiuxdz94wpNUPE6K5RW4xBKGm10?= =?us-ascii?Q?SKvmN2OIS+EcWzKLlSYEd26PYbN/DCeX8r1jttLTf0DZW91kLgFiZA0BXsqs?= =?us-ascii?Q?N+lkx2MGBJhFYsXpi9BZcBIqCijBNWE4yWwkqB6M0RtD0Ux+4GUYZu99UhVV?= =?us-ascii?Q?dvBRaeI846L1BCzYKkw6uSgm+1SRwigTklNzg37SBUZdhM9M6q4Ipujo+uBE?= =?us-ascii?Q?FtgsZ5eHJ6ZqxD1LryftiwaZjqHg5okHmC1HZBlWyhe0kxW1/0pac8gFDNYz?= =?us-ascii?Q?M8uUSIsgUURotd1MoHC5Z6iYeq/fqJaIKD9p2Xm3Z/3DRcKtHDrereKVxgVd?= =?us-ascii?Q?c4tRJDdFacYB2iEJWIHfNRCAhBw458bkrN/UtEAlILQFxLZNxRs8MmB7/l5I?= =?us-ascii?Q?LbbqRLMUSAFVEyKQg/vu36smYIqGO1RagPjXB7Iqfp0goMK4UCArb7wHoakj?= =?us-ascii?Q?PM5f7UbbSIskOcxkFVs1aDSppDfYePxQ0STxoF1B?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW5PR11MB5906.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c95bccf3-c01d-4d0a-1c21-08db0efe7c69 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Feb 2023 02:43:57.4332 (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: mvnNvsuGetE5yIn0tG1yTKjzbbE/dCGL/Zl5mUZw+WakzTpWMWWS1VjdxB6dcSpVlnZd4vCyveDOvPChlERlXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB6718 Return-Path: yuwei.chen@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yuwei Chen > -----Original Message----- > From: Palomino Sosa, Guillermo A > Sent: Tuesday, February 7, 2023 11:07 AM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > ; Chen, Christine > Subject: [edk2-devel][PATCH V1 1/1] BaseTools: Generate compile > information in build report >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2850 >=20 > Add "-Y REPORT_INFO" option to build command to generate compile > information as part of BuildReport. > This option generates files to be used by external tools as IDE's to enha= nce > functionality. > Files are created inside build folder: > ///CompileInfo >=20 > Files created: > * compile_commands.json - Compilation Database. To be used by IDE's > to enable advance features > * cscope.files - List of files used in compilation. Used by Cscope to par= se > C code and provide browse functionality. > * module_report.json - Module data form buildReport in Json format. >=20 > Signed-off-by: Guillermo Antonio Palomino Sosa > > --- > BaseTools/Source/Python/build/BuildReport.py | 139 > +++++++++++++++++++- > BaseTools/Source/Python/build/buildoptions.py | 4 +- > 2 files changed, 140 insertions(+), 3 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/build/BuildReport.py > b/BaseTools/Source/Python/build/BuildReport.py > index 468772930c..33b43d471f 100644 > --- a/BaseTools/Source/Python/build/BuildReport.py > +++ b/BaseTools/Source/Python/build/BuildReport.py > @@ -10,6 +10,8 @@ >=20 > ## Import Modules > # > +import json > +from pathlib import Path > import Common.LongFilePathOs as os > import re > import platform > @@ -41,6 +43,7 @@ from Common.DataType import * import collections > from Common.Expression import * from GenFds.AprioriSection import > DXE_APRIORI_GUID, PEI_APRIORI_GUID > +from AutoGen.IncludesAutoGen import IncludesAutoGen >=20 > ## Pattern to extract contents in EDK DXS files gDxsDependencyPattern = =3D > re.compile(r"DEPENDENCY_START(.+)DEPENDENCY_END", re.DOTALL) @@ - > 2298,6 +2301,10 @@ class BuildReport(object): > def GenerateReport(self, BuildDuration, AutoGenTime, MakeTime, > GenFdsTime): > if self.ReportFile: > try: > + > + if "COMPILE_INFO" in self.ReportType: > + self.GenerateCompileInfo() > + > File =3D [] > for (Wa, MaList) in self.ReportList: > PlatformReport(Wa, MaList, > self.ReportType).GenerateReport(File, BuildDuration, AutoGenTime, > MakeTime, GenFdsTime, self.ReportType) @@ -2310,7 +2317,137 @@ class > BuildReport(object): > EdkLogger.error("BuildReport", CODE_ERROR, "Unknown fata= l > error when generating build report", ExtraData=3Dself.ReportFile, > RaiseError=3DFalse) > EdkLogger.quiet("(Python %s on %s\n%s)" % > (platform.python_version(), sys.platform, traceback.format_exc())) >=20 > + > + ## > + # Generates compile data files to be used by external tools. > + # Compile information will be generated in > ///CompileInfo > + # Files generated: compile_commands.json, cscope.files, > modules_report.json > + # > + # @param self The object pointer > + # > + def GenerateCompileInfo(self): > + try: > + # Lists for the output elements > + compile_commands =3D [] > + used_files =3D set() > + module_report =3D [] > + > + for (Wa, MaList) in self.ReportList: > + # Obtain list of all processed Workspace files > + for file_path in Wa._GetMetaFiles(Wa.BuildTarget, Wa.Too= lChain): > + used_files.add(file_path) > + > + for autoGen in Wa.AutoGenObjectList: > + > + # Loop through all modules > + for module in (autoGen.LibraryAutoGenList + > autoGen.ModuleAutoGenList): > + > + used_files.add(module.MetaFile.Path) > + > + # Main elements of module report > + module_report_data =3D {} > + module_report_data["Name"] =3D module.Name > + module_report_data["Arch"] =3D module.Arch > + module_report_data["Path"] =3D module.MetaFile.P= ath > + module_report_data["Guid"] =3D module.Guid > + module_report_data["BuildType"] =3D module.Build= Type > + module_report_data["IsLibrary"] =3D module.IsLib= rary > + module_report_data["SourceDir"] =3D module.Sourc= eDir > + module_report_data["Files"] =3D [] > + > + # Files used by module > + for data_file in module.SourceFileList: > + module_report_data["Files"].append({"Name": > + data_file.Name, "Path": data_file.Path}) > + > + # Libraries used by module > + module_report_data["Libraries"] =3D [] > + for data_library in module.LibraryAutoGenList: > + > + module_report_data["Libraries"].append({"Path": > + data_library.MetaFile.Path}) > + > + # Packages used by module > + module_report_data["Packages"] =3D [] > + for data_package in module.PackageList: > + module_report_data["Packages"].append({"Path= ": > data_package.MetaFile.Path, "Includes": []}) > + # Includes path used in package > + for data_package_include in data_package.Inc= ludes: > + > + module_report_data["Packages"][- > 1]["Includes"].append(data_package_inc > + lude.Path) > + > + # PPI's in module > + module_report_data["PPI"] =3D [] > + for data_ppi in module.PpiList.keys(): > + module_report_data["PPI"].append({"Name": > + data_ppi, "Guid": module.PpiList[data_ppi]}) > + > + # Protocol's in module > + module_report_data["Protocol"] =3D [] > + for data_protocol in module.ProtocolList.keys(): > + > + module_report_data["Protocol"].append({"Name": data_protocol, "Guid": > + module.ProtocolList[data_protocol]}) > + > + # PCD's in module > + module_report_data["Pcd"] =3D [] > + for data_pcd in module.LibraryPcdList: > + module_report_data["Pcd"].append({"Space": > data_pcd.TokenSpaceGuidCName, > + "Name": da= ta_pcd.TokenCName, > + "Value": d= ata_pcd.TokenValue, > + "Guid": da= ta_pcd.TokenSpaceGuidValue, > + "DatumType= ": data_pcd.DatumType, > + "Type": da= ta_pcd.Type, > + "DefaultVa= lue": data_pcd.DefaultValue}) > + # Add module to report > + module_report.append(module_report_data) > + > + # Include file dependencies to used files > + includes_autogen =3D IncludesAutoGen(module.Make= FileDir, > module) > + for dep in includes_autogen.DepsCollection: > + used_files.add(dep) > + > + inc_flag =3D "-I" # Default include flag > + if module.BuildRuleFamily =3D=3D TAB_COMPILER_MS= FT: > + inc_flag =3D "/I" > + > + for source in module.SourceFileList: > + used_files.add(source.Path) > + compile_command =3D {} > + if source.Ext in [".c", ".cc", ".cpp"]: > + # > + # Generate compile command for each c fi= le > + # > + compile_command["file"] =3D source.Path > + compile_command["directory"] =3D source.= Dir > + build_command =3D > module.BuildRules[source.Ext].CommandList[0] > + build_command_variables =3D re.findall(r= "\$\((.*?)\)", > build_command) > + for var in build_command_variables: > + var_tokens =3D var.split("_") > + var_main =3D var_tokens[0] > + if len(var_tokens) =3D=3D 1: > + var_value =3D module.BuildOption= [var_main]["PATH"] > + else: > + var_value =3D > module.BuildOption[var_main][var_tokens[1]] > + build_command =3D build_command.repl= ace(f"$({var})", > var_value) > + include_files =3D f" {inc_flag}".joi= n(module.IncludePathList) > + build_command =3D build_command.repl= ace("${src}", > include_files) > + build_command =3D > + build_command.replace("${dst}", module.OutputDir) > + > + # Remove un defined macros > + compile_command["command"] =3D re.sub(r"= \$\(.*?\)", "", > build_command) > + > + compile_commands.append(compile_command) > + > + # Create output folder if doesn't exist > + compile_info_folder =3D Path(Wa.BuildDir).joinpath("Comp= ileInfo") > + compile_info_folder.mkdir(exist_ok=3DTrue) > + > + # Sort and save files > + compile_commands.sort(key=3Dlambda x: x["file"]) > + > + > SaveFileOnChange(compile_info_folder.joinpath(f"compile_commands.json" > + ),json.dumps(compile_commands, indent=3D2), False) > + > + > + SaveFileOnChange(compile_info_folder.joinpath(f"cscope.files"), > + "\n".join(sorted(used_files)), False) > + > + module_report.sort(key=3Dlambda x: x["Path"]) > + > + SaveFileOnChange(compile_info_folder.joinpath(f"module_report.json"), > + json.dumps(module_report, indent=3D2), False) > + > + except: > + EdkLogger.error("BuildReport", CODE_ERROR, "Unknown fatal er= ror > when generating build report compile information", > ExtraData=3Dself.ReportFile, RaiseError=3DFalse) > + EdkLogger.quiet("(Python %s on %s\n%s)" % > + (platform.python_version(), sys.platform, traceback.format_exc())) > + > # This acts like the main() function for the script, unless it is 'impor= t'ed into > another script. > if __name__ =3D=3D '__main__': > pass > - > diff --git a/BaseTools/Source/Python/build/buildoptions.py > b/BaseTools/Source/Python/build/buildoptions.py > index 8334604b46..5ec561f7ec 100644 > --- a/BaseTools/Source/Python/build/buildoptions.py > +++ b/BaseTools/Source/Python/build/buildoptions.py > @@ -84,8 +84,8 @@ class MyOptionParser(): > Parser.add_option("-D", "--define", action=3D"append", type=3D"s= tring", > dest=3D"Macros", help=3D"Macro: \"Name [=3D Value]\".") >=20 > Parser.add_option("-y", "--report-file", action=3D"store", > dest=3D"ReportFile", help=3D"Create/overwrite the report to the specified > filename.") > - Parser.add_option("-Y", "--report-type", action=3D"append", > type=3D"choice", choices=3D['PCD', 'LIBRARY', 'FLASH', 'DEPEX', 'BUILD_FL= AGS', > 'FIXED_ADDRESS', 'HASH', 'EXECUTION_ORDER'], dest=3D"ReportType", > default=3D[], > - help=3D"Flags that control the type of build report to gener= ate. Must be > one of: [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS, HASH, > EXECUTION_ORDER]. "\ > + Parser.add_option("-Y", "--report-type", action=3D"append", > type=3D"choice", choices=3D['PCD', 'LIBRARY', 'FLASH', 'DEPEX', 'BUILD_FL= AGS', > 'FIXED_ADDRESS', 'HASH', 'EXECUTION_ORDER', 'COMPILE_INFO'], > dest=3D"ReportType", default=3D[], > + help=3D"Flags that control the type of build report to > + generate. Must be one of: [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS, > + FIXED_ADDRESS, HASH, EXECUTION_ORDER, COMPILE_INFO]. "\ > "To specify more than one flag, repeat this option on t= he command > line and the default flag set is [PCD, LIBRARY, FLASH, DEPEX, HASH, > BUILD_FLAGS, FIXED_ADDRESS]") > Parser.add_option("-F", "--flag", action=3D"store", type=3D"stri= ng", > dest=3D"Flag", > help=3D"Specify the specific option to parse EDK UNI file. M= ust be one of: > [-c, -s]. -c is for EDK framework UNI file, and -s is for EDK UEFI UNI fi= le. "\ > -- > 2.28.0.windows.1