From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: christian.rodriguez@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Wed, 31 Jul 2019 11:01:05 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jul 2019 11:01:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,330,1559545200"; d="scan'208";a="163202065" Received: from rodrigu3-desk.amr.corp.intel.com ([10.7.145.59]) by orsmga007.jf.intel.com with ESMTP; 31 Jul 2019 11:01:04 -0700 From: "Christian Rodriguez" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [PATCH] BaseTools: Fix checking for Sources section in INF file Date: Wed, 31 Jul 2019 11:01:01 -0700 Message-Id: <20190731180101.613-1-christian.rodriguez@intel.com> X-Mailer: git-send-email 2.22.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 of 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 | 15 ++++++++++++--- 2 files changed, 27 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):=0D return sum(len(inc)+1 for inc in self.IncludePathList)=0D =0D + ## Get the list of include paths from the packages=0D + #=0D + # @IncludesList list The list path=0D + #=0D + @cached_property=0D + def PackageIncludePathList(self):=0D + IncludesList =3D []=0D + for Package in self.Module.Packages:=0D + PackageDir =3D mws.join(self.WorkspaceDir, Package.MetaFile.Di= r)=0D + IncludesList =3D Package.Includes=0D + if Package._PrivateIncludes:=0D + if not self.MetaFile.Path.startswith(PackageDir):=0D + IncludesList =3D list(set(Package.Includes).difference= (set(Package._PrivateIncludes)))=0D + return IncludesList=0D +=0D ## Get HII EX PCDs which maybe used by VFR=0D #=0D # efivarstore used by VFR may relate with HII EX PCDs=0D diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/= Python/AutoGen/GenMake.py index 5802ae5ae4..8dd08201aa 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=0D )=0D =0D + # Get a set of unique package includes from MetaFile=0D + parentMetaFileIncludes =3D set()=0D + for aInclude in self._AutoGenObject.PackageIncludePathList:=0D + aIncludeName =3D str(aInclude)=0D + parentMetaFileIncludes.add(aIncludeName.lower())=0D +=0D # Check if header files are listed in metafile=0D - # Get a list of unique module header source files from MetaFile=0D + # Get a set of unique module header source files from MetaFile=0D headerFilesInMetaFileSet =3D set()=0D for aFile in self._AutoGenObject.SourceFileList:=0D aFileName =3D str(aFile)=0D @@ -915,24 +921,27 @@ cleanlib: continue=0D headerFilesInMetaFileSet.add(aFileName.lower())=0D =0D - # Get a list of unique module autogen files=0D + # Get a set of unique module autogen files=0D localAutoGenFileSet =3D set()=0D for aFile in self._AutoGenObject.AutoGenFileList:=0D localAutoGenFileSet.add(str(aFile).lower())=0D =0D - # Get a list of unique module dependency header files=0D + # Get a set of unique module dependency header files=0D # Exclude autogen files and files not in the source directory=0D headerFileDependencySet =3D set()=0D localSourceDir =3D str(self._AutoGenObject.SourceDir).lower()=0D for Dependency in FileDependencyDict.values():=0D for aFile in Dependency:=0D aFileName =3D str(aFile).lower()=0D + aFileDirectory =3D os.path.dirname(aFileName)=0D if not aFileName.endswith('.h'):=0D continue=0D if aFileName in localAutoGenFileSet:=0D continue=0D if localSourceDir not in aFileName:=0D continue=0D + if aFileDirectory in parentMetaFileIncludes:=0D + continue=0D headerFileDependencySet.add(aFileName)=0D =0D # Ensure that gModuleBuildTracking has been initialized per archit= ecture=0D --=20 2.22.0.windows.1