[edk2-devel] [Patch V2] BaseTools: Fix checking for Sources section in INF file

Christian Rodriguez christian.rodriguez at intel.com
Thu Aug 1 22:57:42 UTC 2019


Yes that can be done. Please add the BZ dependency on Bugzilla.

Thanks,
Christian

>-----Original Message-----
>From: Feng, Bob C
>Sent: Thursday, August 1, 2019 3:57 PM
>To: devel at edk2.groups.io; Rodriguez, Christian
><christian.rodriguez at intel.com>
>Cc: Gao, Liming <liming.gao at intel.com>
>Subject: RE: [edk2-devel] [Patch V2] BaseTools: Fix checking for Sources
>section in INF file
>
>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-
>processes AutoGen being pushed.
>
>Thanks,
>Bob
>
>
>-----Original Message-----
>From: devel at edk2.groups.io [mailto:devel at edk2.groups.io] On Behalf Of
>Christian Rodriguez
>Sent: Thursday, August 1, 2019 11:33 PM
>To: devel at edk2.groups.io
>Cc: Feng, Bob C <bob.c.feng at intel.com>; Gao, Liming
><liming.gao at intel.com>
>Subject: [edk2-devel] [Patch V2] BaseTools: Fix checking for Sources section in
>INF file
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1804
>
>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 <christian.rodriguez at intel.com>
>Cc: Bob Feng <bob.c.feng at intel.com>
>Cc: Liming Gao <liming.gao at intel.com>
>---
> 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 packages+
>#+    #   @IncludesList     list             The list path+    #+    @cached_property+
>def PackageIncludePathList(self):+        IncludesList = []+        for Package in
>self.Module.Packages:+            PackageDir = mws.join(self.WorkspaceDir,
>Package.MetaFile.Dir)+            IncludesList = Package.Includes+            if
>Package._PrivateIncludes:+                if not
>self.MetaFile.Path.startswith(PackageDir):+                    IncludesList =
>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 PCDsdiff --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                                     ) +        # Get a
>set of unique package includes from MetaFile+        parentMetaFileIncludes =
>set()+        for aInclude in self._AutoGenObject.PackageIncludePathList:+
>aIncludeName = 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 = set()         for aFile in
>self._AutoGenObject.SourceFileList:             aFileName = str(aFile)@@ -915,24
>+921,37 @@ cleanlib:
>                 continue             headerFilesInMetaFileSet.add(aFileName.lower()) -
># Get a list of unique module autogen files+        # Get a set of unique module
>autogen files         localAutoGenFileSet = set()         for aFile in
>self._AutoGenObject.AutoGenFileList:
>localAutoGenFileSet.add(str(aFile).lower()) -        # 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 = set()         localSourceDir =
>str(self._AutoGenObject.SourceDir).lower()         for Dependency in
>FileDependencyDict.values():             for aFile in Dependency:
>aFileName = 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 = True+                for aIncludePath in parentMetaFileIncludes:+
>if aIncludePath in aFileName:+                        pathNeeded = False+
>break+                if not pathNeeded:+                    continue+                # Keep the file
>headerFileDependencySet.add(aFileName)          # Ensure that
>gModuleBuildTracking has been initialized per architecture--
>2.22.0.windows.1
>
>
>-=-=-=-=-=-=
>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 at edk2.groups.io
>Unsubscribe: https://edk2.groups.io/g/devel/unsub  [bob.c.feng at intel.com]
>-=-=-=-=-=-=


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#44814): https://edk2.groups.io/g/devel/message/44814
Mute This Topic: https://groups.io/mt/32680387/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list