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: bob.c.feng@intel.com) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by groups.io with SMTP; Thu, 01 Aug 2019 15:56:39 -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; 01 Aug 2019 15:56:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,335,1559545200"; d="scan'208";a="177978852" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga006.jf.intel.com with ESMTP; 01 Aug 2019 15:56:38 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 1 Aug 2019 15:56:37 -0700 Received: from shsmsx105.ccr.corp.intel.com ([169.254.11.15]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.62]) with mapi id 14.03.0439.000; Fri, 2 Aug 2019 06:56:36 +0800 From: "Bob Feng" To: "devel@edk2.groups.io" , "Rodriguez, Christian" CC: "Gao, Liming" Subject: Re: [edk2-devel] [Patch V2] BaseTools: Fix checking for Sources section in INF file Thread-Topic: [edk2-devel] [Patch V2] BaseTools: Fix checking for Sources section in INF file Thread-Index: AQHVSH53QAeYQPrBb0Oi6m86t0Ocoqbm5qtg Date: Thu, 1 Aug 2019 22:56:35 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D160B51796@SHSMSX105.ccr.corp.intel.com> References: <20190801153312.886-1-christian.rodriguez@intel.com> In-Reply-To: <20190801153312.886-1-christian.rodriguez@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjhkODFkMGMtMmM2Zi00YzFmLWFjZDUtNDA1MjI1MmI5ZjdiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTFFqMEtDWUhjdnNNNUVFQjZzaStPM1ZOUXpkYjYyQ2NlSDVCUTVCbjJCZHZXVG5hMnRNbEs3MmM0THI5U0JvdiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Christian and Liming, Since this patch changes AutoGen.py, I hope this patch can be created based= on Multiple-processes AutoGen patch set, and pushed after Multiple-process= es AutoGen being pushed. Thanks, Bob -----Original Message----- From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Chris= tian Rodriguez Sent: Thursday, August 1, 2019 11:33 PM To: devel@edk2.groups.io Cc: Feng, Bob C ; Gao, Liming Subject: [edk2-devel] [Patch V2] BaseTools: Fix checking for Sources sectio= n in INF file BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1804 The check to see if [Sources] section lists all the header type files of a = module is missing the exclusion of source files that fall under the scope o= f Package includes. This change adds the exclusions. Signed-off-by: Christian Rodriguez Cc: Bob Feng Cc: Liming Gao --- BaseTools/Source/Python/AutoGen/AutoGen.py | 15 +++++++++++++++ BaseTools= /Source/Python/AutoGen/GenMake.py | 25 ++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 2df055a109..02bf58160b 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -3454,6 +3454,21 @@ class ModuleAutoGen(AutoGen): def IncludePathLength(self): return sum(len(inc)+1 for inc in = self.IncludePathList) + ## Get the list of include paths from the packag= es+ #+ # @IncludesList list The list path+ #+ = @cached_property+ def PackageIncludePathList(self):+ IncludesLis= t =3D []+ for Package in self.Module.Packages:+ PackageDi= r =3D mws.join(self.WorkspaceDir, Package.MetaFile.Dir)+ Include= sList =3D Package.Includes+ if Package._PrivateIncludes:+ = if not self.MetaFile.Path.startswith(PackageDir):+ = IncludesList =3D list(set(Package.Includes).difference(set(Package._Pri= vateIncludes)))+ return IncludesList+ ## Get HII EX PCDs which m= aybe used by VFR # # efivarstore used by VFR may relate with HII E= X PCDsdiff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/S= ource/Python/AutoGen/GenMake.py index 5802ae5ae4..1df55e5d61 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -906,8 +906,14 @@ cleanlib: self._AutoGenObject.IncludePathList + = self._AutoGenObject.BuildOptionIncPathList = ) + # Get a set of unique package includes from MetaFile+ = parentMetaFileIncludes =3D set()+ for aInclude in self._AutoGenObje= ct.PackageIncludePathList:+ aIncludeName =3D str(aInclude)+ = parentMetaFileIncludes.add(aIncludeName.lower())+ # Check if= header files are listed in metafile- # Get a list of unique module = header source files from MetaFile+ # Get a set of unique module head= er source files from MetaFile headerFilesInMetaFileSet =3D set() = for aFile in self._AutoGenObject.SourceFileList: aFileNam= e =3D str(aFile)@@ -915,24 +921,37 @@ cleanlib: continue headerFilesInMetaFileSet.add(aFileNam= e.lower()) - # Get a list of unique module autogen files+ # G= et a set of unique module autogen files localAutoGenFileSet =3D set= () for aFile in self._AutoGenObject.AutoGenFileList: lo= calAutoGenFileSet.add(str(aFile).lower()) - # Get a list of unique m= odule dependency header files+ # Get a set of unique module dependen= cy header files # Exclude autogen files and files not in the source= directory+ # and files that are under the package include list = headerFileDependencySet =3D set() localSourceDir =3D str(self._= AutoGenObject.SourceDir).lower() for Dependency in FileDependencyDi= ct.values(): for aFile in Dependency: aFileName= =3D str(aFile).lower()+ # Exclude non-header files = if not aFileName.endswith('.h'): continue+ = # Exclude autogen files if aFileName in localAut= oGenFileSet: continue+ # Exclude include= out of local scope if localSourceDir not in aFileName: = continue+ # Exclude files covered by packag= e includes+ pathNeeded =3D True+ for aInclude= Path in parentMetaFileIncludes:+ if aIncludePath in aFil= eName:+ pathNeeded =3D False+ = break+ if not pathNeeded:+ continue+ = # Keep the file headerFileDependencySet.add(aFi= leName) # Ensure that gModuleBuildTracking has been initialized pe= r architecture--=20 2.22.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D Groups.io Links: You receive all messages sent to this group. View/Reply Online (#44799): https://edk2.groups.io/g/devel/message/44799 Mute This Topic: https://groups.io/mt/32680387/1768742 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [bob.c.feng@intel.com] -= =3D-=3D-=3D-=3D-=3D-=3D