public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch V2] BaseTools: Fix incremental build bug on DynamicPcd Token Generation
@ 2017-05-23  6:42 Yonghong Zhu
  2017-05-24  2:49 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2017-05-23  6:42 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao

During incremental build, we meet the bug that the different drivers use
the different token for the same DynamicPcd.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 17 +++++++++++++++++
 BaseTools/Source/Python/build/build.py     |  4 ++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 736c1ae..fa6ec56 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -669,10 +669,23 @@ class WorkspaceAutoGen(AutoGen):
         content += 'BuildOptionPcd: '
         content += str(GlobalData.BuildOptionPcd)
         SaveFileOnChange(os.path.join(self.BuildDir, 'BuildOptions'), content, False)
 
         #
+        # Create PcdToken Number file for Dynamic/DynamicEx Pcd.
+        #
+        PcdTokenNumber = 'PcdTokenNumber: '
+        if Pa.PcdTokenNumber:
+            if Pa.DynamicPcdList:
+                for Pcd in Pa.DynamicPcdList:
+                    PcdTokenNumber += os.linesep
+                    PcdTokenNumber += str((Pcd.TokenCName, Pcd.TokenSpaceGuidCName))
+                    PcdTokenNumber += ' : '
+                    PcdTokenNumber += str(Pa.PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName])
+        SaveFileOnChange(os.path.join(self.BuildDir, 'PcdTokenNumber'), PcdTokenNumber, False)
+
+        #
         # Get set of workspace metafiles
         #
         AllWorkSpaceMetaFiles = self._GetMetaFiles(Target, Toolchain, Arch)
 
         #
@@ -722,10 +735,14 @@ class WorkspaceAutoGen(AutoGen):
 
         # add BuildOption metafile
         #
         AllWorkSpaceMetaFiles.add(os.path.join(self.BuildDir, 'BuildOptions'))
 
+        # add PcdToken Number file for Dynamic/DynamicEx Pcd
+        #
+        AllWorkSpaceMetaFiles.add(os.path.join(self.BuildDir, 'PcdTokenNumber'))
+
         for Arch in self.ArchList:
             Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]
             PGen = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)
 
             #
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
index bd14e27..fd94ae6 100644
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -1,10 +1,10 @@
 ## @file
 # build a platform or a module
 #
 #  Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
-#  Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
 #  which accompanies this distribution.  The full text of the license may be found at
 #  http://opensource.org/licenses/bsd-license.php
@@ -52,11 +52,11 @@ import Common.EdkLogger
 import Common.GlobalData as GlobalData
 
 # Version and Copyright
 VersionNumber = "0.60" + ' ' + gBUILD_VERSION
 __version__ = "%prog Version " + VersionNumber
-__copyright__ = "Copyright (c) 2007 - 2016, Intel Corporation  All rights reserved."
+__copyright__ = "Copyright (c) 2007 - 2017, Intel Corporation  All rights reserved."
 
 ## standard targets of build command
 gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']
 
 ## build configuration file
-- 
2.6.1.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch V2] BaseTools: Fix incremental build bug on DynamicPcd Token Generation
  2017-05-23  6:42 [Patch V2] BaseTools: Fix incremental build bug on DynamicPcd Token Generation Yonghong Zhu
@ 2017-05-24  2:49 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2017-05-24  2:49 UTC (permalink / raw)
  To: Zhu, Yonghong, edk2-devel@lists.01.org

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: Tuesday, May 23, 2017 2:43 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>
> Subject: [edk2] [Patch V2] BaseTools: Fix incremental build bug on DynamicPcd Token Generation
> 
> During incremental build, we meet the bug that the different drivers use
> the different token for the same DynamicPcd.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
> ---
>  BaseTools/Source/Python/AutoGen/AutoGen.py | 17 +++++++++++++++++
>  BaseTools/Source/Python/build/build.py     |  4 ++--
>  2 files changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
> index 736c1ae..fa6ec56 100644
> --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> @@ -669,10 +669,23 @@ class WorkspaceAutoGen(AutoGen):
>          content += 'BuildOptionPcd: '
>          content += str(GlobalData.BuildOptionPcd)
>          SaveFileOnChange(os.path.join(self.BuildDir, 'BuildOptions'), content, False)
> 
>          #
> +        # Create PcdToken Number file for Dynamic/DynamicEx Pcd.
> +        #
> +        PcdTokenNumber = 'PcdTokenNumber: '
> +        if Pa.PcdTokenNumber:
> +            if Pa.DynamicPcdList:
> +                for Pcd in Pa.DynamicPcdList:
> +                    PcdTokenNumber += os.linesep
> +                    PcdTokenNumber += str((Pcd.TokenCName, Pcd.TokenSpaceGuidCName))
> +                    PcdTokenNumber += ' : '
> +                    PcdTokenNumber += str(Pa.PcdTokenNumber[Pcd.TokenCName, Pcd.TokenSpaceGuidCName])
> +        SaveFileOnChange(os.path.join(self.BuildDir, 'PcdTokenNumber'), PcdTokenNumber, False)
> +
> +        #
>          # Get set of workspace metafiles
>          #
>          AllWorkSpaceMetaFiles = self._GetMetaFiles(Target, Toolchain, Arch)
> 
>          #
> @@ -722,10 +735,14 @@ class WorkspaceAutoGen(AutoGen):
> 
>          # add BuildOption metafile
>          #
>          AllWorkSpaceMetaFiles.add(os.path.join(self.BuildDir, 'BuildOptions'))
> 
> +        # add PcdToken Number file for Dynamic/DynamicEx Pcd
> +        #
> +        AllWorkSpaceMetaFiles.add(os.path.join(self.BuildDir, 'PcdTokenNumber'))
> +
>          for Arch in self.ArchList:
>              Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]
>              PGen = PlatformAutoGen(self, self.MetaFile, Target, Toolchain, Arch)
> 
>              #
> diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
> index bd14e27..fd94ae6 100644
> --- a/BaseTools/Source/Python/build/build.py
> +++ b/BaseTools/Source/Python/build/build.py
> @@ -1,10 +1,10 @@
>  ## @file
>  # build a platform or a module
>  #
>  #  Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
> -#  Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
> +#  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
>  #
>  #  This program and the accompanying materials
>  #  are licensed and made available under the terms and conditions of the BSD License
>  #  which accompanies this distribution.  The full text of the license may be found at
>  #  http://opensource.org/licenses/bsd-license.php
> @@ -52,11 +52,11 @@ import Common.EdkLogger
>  import Common.GlobalData as GlobalData
> 
>  # Version and Copyright
>  VersionNumber = "0.60" + ' ' + gBUILD_VERSION
>  __version__ = "%prog Version " + VersionNumber
> -__copyright__ = "Copyright (c) 2007 - 2016, Intel Corporation  All rights reserved."
> +__copyright__ = "Copyright (c) 2007 - 2017, Intel Corporation  All rights reserved."
> 
>  ## standard targets of build command
>  gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']
> 
>  ## build configuration file
> --
> 2.6.1.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-24  2:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-23  6:42 [Patch V2] BaseTools: Fix incremental build bug on DynamicPcd Token Generation Yonghong Zhu
2017-05-24  2:49 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox