From nobody Sat May 4 06:36:11 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+44799+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+44799+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1564673602; cv=none; d=zoho.com; s=zohoarc; b=NXvqn/btRM6KpI5Q/yM5u7NIC5WpDUoXSVzhGir0XJucGQWRUZwqmWm0eMroXFJTOo9N0dvuMhQhsDn7+KVtcfL+7/0wBa3ZcYtM8IJOB+Z5k7hKUwRT1DZ/8JThXaustDdpcrOQtSbextkn+jG6j374T4ptt5MiUqjRNalEwMw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564673602; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=4j1qxFJPhg+HdVEom7GmmWkoi5E3VMvwnYd74cDpQAk=; b=HOdKQaZq9pIvkTs5GSfBKNcpf5p9uumXnPNzj9ADOiwYlaN8PmoYoIp3zoCbjkFuN8EjZz0E5Os6+i09LSYn++MjhEs9P8N33KgtX8zGwUG2Ubx0aJdLBujx2aqCMvbbawVBSkaNsDnrUF6b5skAA3Q9uwxgV09Hgzb04XdJnl8= 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+44799+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 1564673602183930.8218462413538; Thu, 1 Aug 2019 08:33:22 -0700 (PDT) Return-Path: X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by groups.io with SMTP; Thu, 01 Aug 2019 08:33:21 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2019 08:33:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,334,1559545200"; d="scan'208";a="175285593" X-Received: from rodrigu3-desk.amr.corp.intel.com ([10.7.145.59]) by orsmga003.jf.intel.com with ESMTP; 01 Aug 2019 08:33:20 -0700 From: "Christian Rodriguez" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [edk2-devel] [Patch V2] BaseTools: Fix checking for Sources section in INF file Date: Thu, 1 Aug 2019 08:33:12 -0700 Message-Id: <20190801153312.886-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=1564673601; bh=rgm6bqZ6cNRBN8K6vCKXjv1dnPyDpd9uCi5RWBV8TIc=; h=Cc:Date:From:Reply-To:Subject:To; b=MKCoAr7bWVxGVey95WKbQYdQw1apSPM5u9CPiZ4f7xlslCXU057ZIHuiWzF9am/qE4N P4F4ywVaN5vUZRbBYVQPBCmnYLB59Hv/4XeiP9nGuR5eLbXXY5WGj5icyENHF9N5dkkJH GVTnP31TIfPhdDsUfWmeDc3GrIlX2dNLSnQ= 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 --- 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) =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 diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/= 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 ) =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 headerFileDependencySet.add(aFileName) =20 # Ensure that gModuleBuildTracking has been initialized per archit= ecture --=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 (#44799): https://edk2.groups.io/g/devel/message/44799 Mute This Topic: https://groups.io/mt/32680387/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-