[edk2] [Patch] BaseTools: Fix the bug to re-build uni file for Library

Yonghong Zhu posted 1 patch 7 years, 1 month ago
Failed in applying to current master (apply log)
BaseTools/Source/Python/AutoGen/AutoGen.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
[edk2] [Patch] BaseTools: Fix the bug to re-build uni file for Library
Posted by Yonghong Zhu 7 years, 1 month ago
The root cause is Module's self.CanSkip() is before LibraryAutoGen,
then when a uni file of library is changed, Module's self.CanSkip() is
still true which cause the library is not regenerated.
This patch change Module's self.CanSkip() after LibraryAutoGen.

Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=759
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/AutoGen.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 5317921..b3e7089 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -4227,17 +4227,18 @@ class ModuleAutoGen(AutoGen):
         if self.IsBinaryModule:
             return
 
         if self.IsMakeFileCreated:
             return
-        if self.CanSkip():
-            return
 
         if not self.IsLibrary and CreateLibraryMakeFile:
             for LibraryAutoGen in self.LibraryAutoGenList:
                 LibraryAutoGen.CreateMakeFile()
 
+        if self.CanSkip():
+            return
+
         if len(self.CustomMakefile) == 0:
             Makefile = GenMake.ModuleMakefile(self)
         else:
             Makefile = GenMake.CustomMakefile(self)
         if Makefile.Generate():
@@ -4261,12 +4262,10 @@ class ModuleAutoGen(AutoGen):
     #                                       dependent libraries will be created
     #
     def CreateCodeFile(self, CreateLibraryCodeFile=True):
         if self.IsCodeFileCreated:
             return
-        if self.CanSkip():
-            return
 
         # Need to generate PcdDatabase even PcdDriver is binarymodule
         if self.IsBinaryModule and self.PcdIsDriver != '':
             CreatePcdDatabaseCode(self, TemplateString(), TemplateString())
             return
@@ -4277,10 +4276,13 @@ class ModuleAutoGen(AutoGen):
 
         if not self.IsLibrary and CreateLibraryCodeFile:
             for LibraryAutoGen in self.LibraryAutoGenList:
                 LibraryAutoGen.CreateCodeFile()
 
+        if self.CanSkip():
+            return
+
         AutoGenList = []
         IgoredAutoGenList = []
 
         for File in self.AutoGenFileList:
             if GenC.Generate(File.Path, self.AutoGenFileList[File], File.IsBinary):
-- 
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] BaseTools: Fix the bug to re-build uni file for Library
Posted by Gao, Liming 7 years, 1 month ago
Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Zhu, Yonghong
>Sent: Monday, November 13, 2017 10:52 AM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>
>Subject: [Patch] BaseTools: Fix the bug to re-build uni file for Library
>
>The root cause is Module's self.CanSkip() is before LibraryAutoGen,
>then when a uni file of library is changed, Module's self.CanSkip() is
>still true which cause the library is not regenerated.
>This patch change Module's self.CanSkip() after LibraryAutoGen.
>
>Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=759
>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/AutoGen.py | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
>b/BaseTools/Source/Python/AutoGen/AutoGen.py
>index 5317921..b3e7089 100644
>--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
>+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
>@@ -4227,17 +4227,18 @@ class ModuleAutoGen(AutoGen):
>         if self.IsBinaryModule:
>             return
>
>         if self.IsMakeFileCreated:
>             return
>-        if self.CanSkip():
>-            return
>
>         if not self.IsLibrary and CreateLibraryMakeFile:
>             for LibraryAutoGen in self.LibraryAutoGenList:
>                 LibraryAutoGen.CreateMakeFile()
>
>+        if self.CanSkip():
>+            return
>+
>         if len(self.CustomMakefile) == 0:
>             Makefile = GenMake.ModuleMakefile(self)
>         else:
>             Makefile = GenMake.CustomMakefile(self)
>         if Makefile.Generate():
>@@ -4261,12 +4262,10 @@ class ModuleAutoGen(AutoGen):
>     #                                       dependent libraries will be created
>     #
>     def CreateCodeFile(self, CreateLibraryCodeFile=True):
>         if self.IsCodeFileCreated:
>             return
>-        if self.CanSkip():
>-            return
>
>         # Need to generate PcdDatabase even PcdDriver is binarymodule
>         if self.IsBinaryModule and self.PcdIsDriver != '':
>             CreatePcdDatabaseCode(self, TemplateString(), TemplateString())
>             return
>@@ -4277,10 +4276,13 @@ class ModuleAutoGen(AutoGen):
>
>         if not self.IsLibrary and CreateLibraryCodeFile:
>             for LibraryAutoGen in self.LibraryAutoGenList:
>                 LibraryAutoGen.CreateCodeFile()
>
>+        if self.CanSkip():
>+            return
>+
>         AutoGenList = []
>         IgoredAutoGenList = []
>
>         for File in self.AutoGenFileList:
>             if GenC.Generate(File.Path, self.AutoGenFileList[File], File.IsBinary):
>--
>2.6.1.windows.1

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