From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: christian.rodriguez@intel.com) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by groups.io with SMTP; Wed, 29 May 2019 07:05:24 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2019 07:05:23 -0700 X-ExtLoop1: 1 Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by orsmga006.jf.intel.com with ESMTP; 29 May 2019 07:05:23 -0700 Received: from orsmsx116.amr.corp.intel.com (10.22.240.14) by ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 29 May 2019 07:05:23 -0700 Received: from orsmsx112.amr.corp.intel.com ([169.254.3.79]) by ORSMSX116.amr.corp.intel.com ([169.254.7.165]) with mapi id 14.03.0415.000; Wed, 29 May 2019 07:05:23 -0700 From: "Christian Rodriguez" To: "devel@edk2.groups.io" , "Rodriguez, Christian" CC: "Feng, Bob C" , "Gao, Liming" , "Zhu, Yonghong" Subject: Re: [edk2-devel] [Patch V3 1/2] BaseTools: Add a checking for Sources section in INF file [Part 1/2] Thread-Topic: [edk2-devel] [Patch V3 1/2] BaseTools: Add a checking for Sources section in INF file [Part 1/2] Thread-Index: AQHVEj6sFqk4mvM3MUyKpMs6VnRziaaCKpXg Date: Wed, 29 May 2019 14:05:22 +0000 Message-ID: <3A7DCC9A944C6149BF832E1C9B718ABC01F24A77@ORSMSX112.amr.corp.intel.com> References: <20190524144027.9552-1-christian.rodriguez@intel.com> <15A1A56CC74451E6.22107@groups.io> In-Reply-To: <15A1A56CC74451E6.22107@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDVhMjU1Y2MtOTE0YS00NjRmLWIwODMtMGQ3YTczNzYxNjViIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVVgyYUxiWmc0VFRnZ3g1RndPcDFLZGdJZnRmWTk3MXJ5VDFpM0EyY1pUNVh0ajd4ckVOUmlDK1lGcGRrZkNVNSJ9 dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Return-Path: christian.rodriguez@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Please review. Bump. >-----Original Message----- >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of >Christian Rodriguez >Sent: Friday, May 24, 2019 7:40 AM >To: devel@edk2.groups.io >Cc: Feng, Bob C ; Gao, Liming >; Zhu, Yonghong >Subject: [edk2-devel] [Patch V3 1/2] BaseTools: Add a checking for Source= s >section in INF file [Part 1/2] > >BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1804 > >In V3: Seperate checker and hashing into individual patches In V2: Enable >check for all builds, move conditional to hash invalidation In the Edk2 I= NF spec >3.9, it states, All HII Unicode format files must be listed in [Sources] = section. >Add a check to see if [Sources] section lists all the "source" type files= of a >module. Performance impact should be minimal with this patch since >information is already being fetched for Makefile purposes. All other >information is already cached in memory. No extra IO time is needed. Part= 1 is >checker only. > >Signed-off-by: Christian Rodriguez >Cc: Bob Feng >Cc: Liming Gao >Cc: Yonghong Zhu >--- > BaseTools/Source/Python/AutoGen/GenMake.py | 38 >++++++++++++++++++++ > 1 file changed, 38 insertions(+) > >diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py >b/BaseTools/Source/Python/AutoGen/GenMake.py >index 0e0f9fd9b0..5c992d7c26 100644 >--- a/BaseTools/Source/Python/AutoGen/GenMake.py >+++ b/BaseTools/Source/Python/AutoGen/GenMake.py >@@ -905,6 +905,44 @@ cleanlib: > ForceIncludedFile, > self._AutoGenObject.IncludePathList = + >self._AutoGenObject.BuildOptionIncPathList > ) >+ >+ # Check if header files are listed in metafile >+ # Get a list of unique module header source files from MetaFile >+ headerFilesInMetaFileSet =3D set() >+ for aFile in self._AutoGenObject.SourceFileList: >+ aFileName =3D str(aFile) >+ if not aFileName.endswith('.h'): >+ continue >+ headerFilesInMetaFileSet.add(aFileName.lower()) >+ >+ # Get a list of unique module autogen files >+ localAutoGenFileSet =3D set() >+ for aFile in self._AutoGenObject.AutoGenFileList: >+ localAutoGenFileSet.add(str(aFile).lower()) >+ >+ # Get a list of unique module dependency header files >+ # Exclude autogen files and files not in the source directory >+ headerFileDependencySet =3D set() >+ localSourceDir =3D str(self._AutoGenObject.SourceDir).lower() >+ for Dependency in FileDependencyDict.values(): >+ for aFile in Dependency: >+ aFileName =3D str(aFile).lower() >+ if not aFileName.endswith('.h'): >+ continue >+ if aFileName in localAutoGenFileSet: >+ continue >+ if localSourceDir not in aFileName: >+ continue >+ headerFileDependencySet.add(aFileName) >+ >+ # Check if a module dependency header file is missing from the m= odule's >MetaFile >+ for aFile in headerFileDependencySet: >+ if aFile in headerFilesInMetaFileSet: >+ continue >+ EdkLogger.warn("build","Module MetaFile [Sources] is missing= local >header!", >+ ExtraData =3D "Local Header: " + aFile + " not f= ound in " + >self._AutoGenObject.MetaFile.Path >+ ) >+ > DepSet =3D None > for File,Dependency in FileDependencyDict.items(): > if not Dependency: >-- >2.19.1.windows.1 > > >