[edk2] [Patch] BaseTools: Fix a bug for --pcd used in ConditionalStatement calculate

Yonghong Zhu posted 1 patch 6 years, 1 month ago
Failed in applying to current master (apply log)
BaseTools/Source/Python/GenFds/GenFds.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[edk2] [Patch] BaseTools: Fix a bug for --pcd used in ConditionalStatement calculate
Posted by Yonghong Zhu 6 years, 1 month ago
Move the GlobalData.BuildOptionPcd before FdfParser() function

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/Python/GenFds/GenFds.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py
index 4c56cbb..e3cc77f 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -268,10 +268,12 @@ def main():
 
             if not os.path.exists(OutputDir):
                 EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=OutputDir)
             GenFdsGlobalVariable.OutputDirDict[Key] = OutputDir
 
+        GlobalData.BuildOptionPcd     = Options.OptionPcd if Options.OptionPcd else {}
+
         """ Parse Fdf file, has to place after build Workspace as FDF may contain macros from DSC file """
         FdfParserObj = FdfParser.FdfParser(FdfFilename)
         FdfParserObj.ParseFile()
 
         if FdfParserObj.CycleReferenceCheck():
@@ -324,11 +326,10 @@ def main():
                                         EdkLogger.error("GenFds", FORMAT_INVALID, "The FV %s's region is specified in multiple FD with different value." %FvObj.UiFvName)
                                 else:
                                     FvObj.FvRegionInFD = RegionObj.Size
                                     RegionObj.BlockInfoOfRegion(FdObj.BlockSizeList, FvObj)
 
-        GlobalData.BuildOptionPcd     = Options.OptionPcd if Options.OptionPcd else {}
         """Call GenFds"""
         GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList)
 
         """Generate GUID cross reference file"""
         GenFds.GenerateGuidXRefFile(BuildWorkSpace, ArchList, FdfParserObj)
-- 
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 a bug for --pcd used in ConditionalStatement calculate
Posted by Gao, Liming 6 years, 1 month ago
Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yonghong Zhu
> Sent: Wednesday, March 7, 2018 4:34 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch] BaseTools: Fix a bug for --pcd used in ConditionalStatement calculate
> 
> Move the GlobalData.BuildOptionPcd before FdfParser() function
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> ---
>  BaseTools/Source/Python/GenFds/GenFds.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py
> index 4c56cbb..e3cc77f 100644
> --- a/BaseTools/Source/Python/GenFds/GenFds.py
> +++ b/BaseTools/Source/Python/GenFds/GenFds.py
> @@ -268,10 +268,12 @@ def main():
> 
>              if not os.path.exists(OutputDir):
>                  EdkLogger.error("GenFds", FILE_NOT_FOUND, ExtraData=OutputDir)
>              GenFdsGlobalVariable.OutputDirDict[Key] = OutputDir
> 
> +        GlobalData.BuildOptionPcd     = Options.OptionPcd if Options.OptionPcd else {}
> +
>          """ Parse Fdf file, has to place after build Workspace as FDF may contain macros from DSC file """
>          FdfParserObj = FdfParser.FdfParser(FdfFilename)
>          FdfParserObj.ParseFile()
> 
>          if FdfParserObj.CycleReferenceCheck():
> @@ -324,11 +326,10 @@ def main():
>                                          EdkLogger.error("GenFds", FORMAT_INVALID, "The FV %s's region is specified in
> multiple FD with different value." %FvObj.UiFvName)
>                                  else:
>                                      FvObj.FvRegionInFD = RegionObj.Size
>                                      RegionObj.BlockInfoOfRegion(FdObj.BlockSizeList, FvObj)
> 
> -        GlobalData.BuildOptionPcd     = Options.OptionPcd if Options.OptionPcd else {}
>          """Call GenFds"""
>          GenFds.GenFd('', FdfParserObj, BuildWorkSpace, ArchList)
> 
>          """Generate GUID cross reference file"""
>          GenFds.GenerateGuidXRefFile(BuildWorkSpace, ArchList, FdfParserObj)
> --
> 2.6.1.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel