* [Patch] BaseTools: Fix building FatPkg failed issue
@ 2017-12-26 3:33 BobCF
2017-12-26 3:41 ` Gao, Liming
0 siblings, 1 reply; 2+ messages in thread
From: BobCF @ 2017-12-26 3:33 UTC (permalink / raw)
To: edk2-devel; +Cc: Bob Feng, Liming Gao
Using property instead of vairable for DecPcds.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
CC: Liming Gao <liming.gao@intel.com>
---
BaseTools/Source/Python/Workspace/DscBuildData.py | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index b60c0fdf3..dcc70e8ba 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1010,11 +1010,11 @@ class DscBuildData(PlatformBuildClassObject):
else:
EdkLogger.error('build', PARSER_ERROR,
"Pcd (%s.%s) defined in DSC is not declared in DEC files. Arch: ['%s']" % (str_pcd[0], str_pcd[1], self._Arch),
File=self.MetaFile,Line = StrPcdSet[str_pcd][0][5])
# Add the Structure PCD that only defined in DEC, don't have override in DSC file
- for Pcd in self._DecPcds:
+ for Pcd in self.DecPcds:
if type (self._DecPcds[Pcd]) is StructurePcd:
if Pcd not in S_pcd_set:
str_pcd_obj_str = StructurePcd()
str_pcd_obj_str.copy(self._DecPcds[Pcd])
str_pcd_obj = Pcds.get(Pcd, None)
@@ -1987,11 +1987,25 @@ class DscBuildData(PlatformBuildClassObject):
#
def AddPcd(self, Name, Guid, Value):
if (Name, Guid) not in self.Pcds:
self.Pcds[Name, Guid] = PcdClassObject(Name, Guid, '', '', '', '', '', {}, False, None)
self.Pcds[Name, Guid].DefaultValue = Value
-
+ @property
+ def DecPcds(self):
+ if self._DecPcds == None:
+ FdfInfList = []
+ if GlobalData.gFdfParser:
+ FdfInfList = GlobalData.gFdfParser.Profile.InfList
+ PkgSet = set()
+ for Inf in FdfInfList:
+ ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch=self._Arch)
+ if ModuleFile in self._Modules:
+ continue
+ ModuleData = self._Bdb[ModuleFile, self._Arch, self._Target, self._Toolchain]
+ PkgSet.update(ModuleData.Packages)
+ self._DecPcds = GetDeclaredPcd(self, self._Bdb, self._Arch, self._Target, self._Toolchain,PkgSet)
+ return self._DecPcds
_Macros = property(_GetMacros)
Arch = property(_GetArch, _SetArch)
Platform = property(_GetPlatformName)
PlatformName = property(_GetPlatformName)
Guid = property(_GetFileGuid)
--
2.14.3.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Patch] BaseTools: Fix building FatPkg failed issue
2017-12-26 3:33 [Patch] BaseTools: Fix building FatPkg failed issue BobCF
@ 2017-12-26 3:41 ` Gao, Liming
0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2017-12-26 3:41 UTC (permalink / raw)
To: Feng, Bob C, edk2-devel@lists.01.org
Reviewed-by: Liming Gao <liming.gao@intel.com>
>-----Original Message-----
>From: Feng, Bob C
>Sent: Tuesday, December 26, 2017 11:34 AM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
>Subject: [Patch] BaseTools: Fix building FatPkg failed issue
>
>Using property instead of vairable for DecPcds.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng <bob.c.feng@intel.com>
>CC: Liming Gao <liming.gao@intel.com>
>---
> BaseTools/Source/Python/Workspace/DscBuildData.py | 18
>++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
>b/BaseTools/Source/Python/Workspace/DscBuildData.py
>index b60c0fdf3..dcc70e8ba 100644
>--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
>@@ -1010,11 +1010,11 @@ class DscBuildData(PlatformBuildClassObject):
> else:
> EdkLogger.error('build', PARSER_ERROR,
> "Pcd (%s.%s) defined in DSC is not declared in DEC files. Arch:
>['%s']" % (str_pcd[0], str_pcd[1], self._Arch),
> File=self.MetaFile,Line = StrPcdSet[str_pcd][0][5])
> # Add the Structure PCD that only defined in DEC, don't have override in
>DSC file
>- for Pcd in self._DecPcds:
>+ for Pcd in self.DecPcds:
> if type (self._DecPcds[Pcd]) is StructurePcd:
> if Pcd not in S_pcd_set:
> str_pcd_obj_str = StructurePcd()
> str_pcd_obj_str.copy(self._DecPcds[Pcd])
> str_pcd_obj = Pcds.get(Pcd, None)
>@@ -1987,11 +1987,25 @@ class DscBuildData(PlatformBuildClassObject):
> #
> def AddPcd(self, Name, Guid, Value):
> if (Name, Guid) not in self.Pcds:
> self.Pcds[Name, Guid] = PcdClassObject(Name, Guid, '', '', '', '', '', {},
>False, None)
> self.Pcds[Name, Guid].DefaultValue = Value
>-
>+ @property
>+ def DecPcds(self):
>+ if self._DecPcds == None:
>+ FdfInfList = []
>+ if GlobalData.gFdfParser:
>+ FdfInfList = GlobalData.gFdfParser.Profile.InfList
>+ PkgSet = set()
>+ for Inf in FdfInfList:
>+ ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace,
>Arch=self._Arch)
>+ if ModuleFile in self._Modules:
>+ continue
>+ ModuleData = self._Bdb[ModuleFile, self._Arch, self._Target,
>self._Toolchain]
>+ PkgSet.update(ModuleData.Packages)
>+ self._DecPcds = GetDeclaredPcd(self, self._Bdb, self._Arch,
>self._Target, self._Toolchain,PkgSet)
>+ return self._DecPcds
> _Macros = property(_GetMacros)
> Arch = property(_GetArch, _SetArch)
> Platform = property(_GetPlatformName)
> PlatformName = property(_GetPlatformName)
> Guid = property(_GetFileGuid)
>--
>2.14.3.windows.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-26 3:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-26 3:33 [Patch] BaseTools: Fix building FatPkg failed issue BobCF
2017-12-26 3:41 ` Gao, Liming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox