[edk2] [Patch V2] BaseTools: Fix a bug to correct SourceFileList

Yonghong Zhu posted 1 patch 6 years, 7 months ago
Failed in applying to current master (apply log)
BaseTools/Source/Python/AutoGen/GenMake.py | 7 +++++++
1 file changed, 7 insertions(+)
[edk2] [Patch V2] BaseTools: Fix a bug to correct SourceFileList
Posted by Yonghong Zhu 6 years, 7 months ago
We met a case that use two microcode files in the Microcode.inf file,
one is .mcb file, another is .txt file. then it cause build failure
because the SourceFileList include the .txt file's output file, while
this output file is still not be generated, so it cause
GetFileDependency report failure.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/Python/AutoGen/GenMake.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index 0f3ddd5..942eb44 100644
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -787,12 +787,19 @@ cleanlib:
         ForceIncludedFile = []
         for File in self._AutoGenObject.AutoGenFileList:
             if File.Ext == '.h':
                 ForceIncludedFile.append(File)
         SourceFileList = []
+        OutPutFileList = []
         for Target in self._AutoGenObject.IntroTargetList:
             SourceFileList.extend(Target.Inputs)
+            OutPutFileList.extend(Target.Outputs)
+
+        if OutPutFileList:
+            for Item in OutPutFileList:
+                if Item in SourceFileList:
+                    SourceFileList.remove(Item)
 
         self.FileDependency = self.GetFileDependency(
                                     SourceFileList,
                                     ForceIncludedFile,
                                     self._AutoGenObject.IncludePathList + self._AutoGenObject.BuildOptionIncPathList
-- 
2.6.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [Patch V2] BaseTools: Fix a bug to correct SourceFileList
Posted by Gao, Liming 6 years, 7 months ago
Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Zhu, Yonghong
>Sent: Monday, September 18, 2017 12:24 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>
>Subject: [Patch V2] BaseTools: Fix a bug to correct SourceFileList
>
>We met a case that use two microcode files in the Microcode.inf file,
>one is .mcb file, another is .txt file. then it cause build failure
>because the SourceFileList include the .txt file's output file, while
>this output file is still not be generated, so it cause
>GetFileDependency report failure.
>
>Cc: Liming Gao <liming.gao@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
>---
> BaseTools/Source/Python/AutoGen/GenMake.py | 7 +++++++
> 1 file changed, 7 insertions(+)
>
>diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py
>b/BaseTools/Source/Python/AutoGen/GenMake.py
>index 0f3ddd5..942eb44 100644
>--- a/BaseTools/Source/Python/AutoGen/GenMake.py
>+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
>@@ -787,12 +787,19 @@ cleanlib:
>         ForceIncludedFile = []
>         for File in self._AutoGenObject.AutoGenFileList:
>             if File.Ext == '.h':
>                 ForceIncludedFile.append(File)
>         SourceFileList = []
>+        OutPutFileList = []
>         for Target in self._AutoGenObject.IntroTargetList:
>             SourceFileList.extend(Target.Inputs)
>+            OutPutFileList.extend(Target.Outputs)
>+
>+        if OutPutFileList:
>+            for Item in OutPutFileList:
>+                if Item in SourceFileList:
>+                    SourceFileList.remove(Item)
>
>         self.FileDependency = self.GetFileDependency(
>                                     SourceFileList,
>                                     ForceIncludedFile,
>                                     self._AutoGenObject.IncludePathList +
>self._AutoGenObject.BuildOptionIncPathList
>--
>2.6.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel