From nobody Sat Apr 20 05:06:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+45460+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+45460+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1565623935; cv=none; d=zoho.com; s=zohoarc; b=YNeLxOZpv41e1buFmH0dLhhc2Np7Jss/CxhBc6kT2M+ieoBLzGIq9yiJgA9RXc9c0BZMjhY5jpTZ8SU16UPlwjcIbc81966rUZGtoX4g9NRSdkZ57IAlGwhYB5PPIaNrTmMAID1uXpxHP7zDM9yF+TCvd79i2BEYcl1psQezrCs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565623935; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=vVMhav+WVsO+uooq4/Ljd2+jsmv0NLja183vxbg7fMQ=; b=Z7Hxq2ePW8Tt5odFaNYeVwqx8c2OdMc6NKtFCbf7wOvJo+od2BuGVpmqRKi+x3yGCp33f5gFSWbTGHg69jncX0RL1LvxKZ/bO4Q0BMyApxAyoimu3RpnldfxuWlrSsWBl29bhd2vm9o98jJavWyZCp7gu+YWesdbZaETYpKSCJw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+45460+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1565623935876822.9943405215517; Mon, 12 Aug 2019 08:32:15 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by groups.io with SMTP; Mon, 12 Aug 2019 08:32:15 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Aug 2019 08:32:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,377,1559545200"; d="scan'208";a="166753657" X-Received: from rodrigu3-desk.amr.corp.intel.com ([10.7.145.59]) by orsmga007.jf.intel.com with ESMTP; 12 Aug 2019 08:32:14 -0700 From: "Christian Rodriguez" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [edk2-devel] [Patch V3] BaseTools: Fix checking for Sources section in INF file Date: Mon, 12 Aug 2019 08:32:11 -0700 Message-Id: <20190812153211.1791-1-christian.rodriguez@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,christian.rodriguez@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1565623935; bh=btxDJnhqVcpmkHrtb1d0M5rKgkHMLJgd8jOrcc9OZvc=; h=Cc:Date:From:Reply-To:Subject:To; b=OdaVesO8VoNgPmWph2qvnWL5Q6MKg31+E/wnumPGkyInjw+Ex55MByMLz3HUyCje73x 5465zakMQQsX404PRuEi8GtvA4T9/VBKldzhdzRFx0wc5GLb3gToBSZX8PiTNEGPrIiZ5 alrLpHRuHAZml+gLqp9T6MWIWOSNR7Ihkro= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 Tested-by: Liming Gao --- BaseTools/Source/Python/AutoGen/GenMake.py | 25 ++++++++++++++++++++= ++--- BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 15 +++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/= Python/AutoGen/GenMake.py index 5802ae5ae4..499ef82aea 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 ) =20 + # Get a set of unique package includes from MetaFile + parentMetaFileIncludes =3D set() + for aInclude in self._AutoGenObject.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 header source files from MetaFile headerFilesInMetaFileSet =3D set() for aFile in self._AutoGenObject.SourceFileList: aFileName =3D str(aFile) @@ -915,24 +921,37 @@ cleanlib: continue headerFilesInMetaFileSet.add(aFileName.lower()) =20 - # Get a list of unique module autogen files + # Get a set of unique module autogen files localAutoGenFileSet =3D set() for aFile in self._AutoGenObject.AutoGenFileList: localAutoGenFileSet.add(str(aFile).lower()) =20 - # Get a list of unique module dependency header files + # Get a set of unique module dependency 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 FileDependencyDict.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 localAutoGenFileSet: continue + # Exclude include out of local scope if localSourceDir not in aFileName: continue + # Exclude files covered by package includes + pathNeeded =3D True + for aIncludePath in parentMetaFileIncludes: + if aIncludePath in aFileName: + pathNeeded =3D False + break + if not pathNeeded: + continue + # Keep the file to be checked headerFileDependencySet.add(aFileName) =20 # Ensure that gModuleBuildTracking has been initialized per archit= ecture diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py b/BaseTools/S= ource/Python/AutoGen/ModuleAutoGen.py index ed6822334e..aaea8767ef 100644 --- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py @@ -1114,6 +1114,21 @@ class ModuleAutoGen(AutoGen): def IncludePathLength(self): return sum(len(inc)+1 for inc in self.IncludePathList) =20 + ## Get the list of include paths from the packages + # + # @IncludesList list The list path + # + @cached_property + def PackageIncludePathList(self): + IncludesList =3D [] + for Package in self.Module.Packages: + PackageDir =3D mws.join(self.WorkspaceDir, Package.MetaFile.Di= r) + IncludesList =3D Package.Includes + if Package._PrivateIncludes: + if not self.MetaFile.Path.startswith(PackageDir): + IncludesList =3D list(set(Package.Includes).difference= (set(Package._PrivateIncludes))) + return IncludesList + ## Get HII EX PCDs which maybe used by VFR # # efivarstore used by VFR may relate with HII EX PCDs --=20 2.22.0.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 (#45460): https://edk2.groups.io/g/devel/message/45460 Mute This Topic: https://groups.io/mt/32841936/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-