* [Patch 1/3] BaseTools: Fixed a build report issue.
@ 2019-02-04 6:48 Feng, Bob C
2019-02-04 6:48 ` [Patch 2/3] BaseTools: Fixed an issue about StructurePcd Feng, Bob C
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Feng, Bob C @ 2019-02-04 6:48 UTC (permalink / raw)
To: edk2-devel; +Cc: Bob Feng, Liming Gao
Generate report fail when -Y EXECUTION_ORDER in build command.
This patch is going to fix this issue.
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/Eot/EotMain.py | 3 ++-
BaseTools/Source/Python/build/BuildReport.py | 8 ++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/BaseTools/Source/Python/Eot/EotMain.py b/BaseTools/Source/Python/Eot/EotMain.py
index fd4bee6f90..57f96c89c9 100644
--- a/BaseTools/Source/Python/Eot/EotMain.py
+++ b/BaseTools/Source/Python/Eot/EotMain.py
@@ -19,11 +19,12 @@ import Common.LongFilePathOs as os, time, glob
import Common.EdkLogger as EdkLogger
import Eot.EotGlobalData as EotGlobalData
from optparse import OptionParser
from Common.StringUtils import NormPath
from Common import BuildToolError
-from Common.Misc import GuidStructureStringToGuidString, sdict
+from Common.Misc import GuidStructureStringToGuidString
+from collections import OrderedDict as sdict
from Eot.Parser import *
from Eot.InfParserLite import EdkInfParser
from Common.StringUtils import GetSplitValueList
from Eot import c
from Eot import Database
diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
index e457660fce..52764a6c55 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -1650,18 +1650,18 @@ class PredictionReport(object):
#
SourceList = os.path.join(self._EotDir, "SourceFile.txt")
GuidList = os.path.join(self._EotDir, "GuidList.txt")
DispatchList = os.path.join(self._EotDir, "Dispatch.txt")
- TempFile = open(SourceList, "w+")
+ TempFile = []
for Item in self._SourceList:
FileWrite(TempFile, Item)
- TempFile.close()
- TempFile = open(GuidList, "w+")
+ SaveFileOnChange(SourceList, "".join(TempFile), False)
+ TempFile = []
for Key in self._GuidMap:
FileWrite(TempFile, "%s %s" % (Key, self._GuidMap[Key]))
- TempFile.close()
+ SaveFileOnChange(GuidList, "".join(TempFile), False)
try:
from Eot.EotMain import Eot
#
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Patch 2/3] BaseTools: Fixed an issue about StructurePcd
2019-02-04 6:48 [Patch 1/3] BaseTools: Fixed a build report issue Feng, Bob C
@ 2019-02-04 6:48 ` Feng, Bob C
2019-02-14 14:31 ` Gao, Liming
2019-02-04 6:48 ` [Patch 3/3] BaseTools: Fix a bug about PcdArray Feng, Bob C
[not found] ` <08650203BA1BD64D8AD9B6D5D74A85D1600859D1@SHSMSX101.ccr.corp.intel.com>
2 siblings, 1 reply; 6+ messages in thread
From: Feng, Bob C @ 2019-02-04 6:48 UTC (permalink / raw)
To: edk2-devel; +Cc: Bob Feng, Liming Gao
If use a structure pcd in fdf, build tool crash
This is a regression issue introduced by py3 patch set.
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/BuildClassObject.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTools/Source/Python/Workspace/BuildClassObject.py
index cff77a71ae..41759b8785 100644
--- a/BaseTools/Source/Python/Workspace/BuildClassObject.py
+++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py
@@ -268,10 +268,11 @@ class StructurePcd(PcdClassObject):
self.PkgPath = ""
self.DefaultValueFromDec = ""
self.ValueChain = set()
self.PcdFieldValueFromComm = OrderedDict()
self.PcdFieldValueFromFdf = OrderedDict()
+ self.DefaultFromDSC=None
def __repr__(self):
return self.TypeName
def AddDefaultValue (self, FieldName, Value, FileName="", LineNo=0,DimensionAttr ="-1"):
if DimensionAttr not in self.DefaultValues:
@@ -324,11 +325,10 @@ class StructurePcd(PcdClassObject):
if isinstance(PcdObject, StructurePcd):
self.StructuredPcdIncludeFile = PcdObject.StructuredPcdIncludeFile if PcdObject.StructuredPcdIncludeFile else self.StructuredPcdIncludeFile
self.PackageDecs = PcdObject.PackageDecs if PcdObject.PackageDecs else self.PackageDecs
self.DefaultValues = PcdObject.DefaultValues if PcdObject.DefaultValues else self.DefaultValues
self.PcdMode = PcdObject.PcdMode if PcdObject.PcdMode else self.PcdMode
- self.DefaultFromDSC=None
self.DefaultValueFromDec = PcdObject.DefaultValueFromDec if PcdObject.DefaultValueFromDec else self.DefaultValueFromDec
self.SkuOverrideValues = PcdObject.SkuOverrideValues if PcdObject.SkuOverrideValues else self.SkuOverrideValues
self.StructName = PcdObject.DatumType if PcdObject.DatumType else self.StructName
self.PcdDefineLineNo = PcdObject.PcdDefineLineNo if PcdObject.PcdDefineLineNo else self.PcdDefineLineNo
self.PkgPath = PcdObject.PkgPath if PcdObject.PkgPath else self.PkgPath
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Patch 2/3] BaseTools: Fixed an issue about StructurePcd
2019-02-04 6:48 ` [Patch 2/3] BaseTools: Fixed an issue about StructurePcd Feng, Bob C
@ 2019-02-14 14:31 ` Gao, Liming
0 siblings, 0 replies; 6+ messages in thread
From: Gao, Liming @ 2019-02-14 14:31 UTC (permalink / raw)
To: Feng, Bob C, 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 Feng, Bob C
> Sent: Monday, February 4, 2019 2:48 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>
> Subject: [edk2] [Patch 2/3] BaseTools: Fixed an issue about StructurePcd
>
> If use a structure pcd in fdf, build tool crash
> This is a regression issue introduced by py3 patch set.
>
> 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/BuildClassObject.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTools/Source/Python/Workspace/BuildClassObject.py
> index cff77a71ae..41759b8785 100644
> --- a/BaseTools/Source/Python/Workspace/BuildClassObject.py
> +++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py
> @@ -268,10 +268,11 @@ class StructurePcd(PcdClassObject):
> self.PkgPath = ""
> self.DefaultValueFromDec = ""
> self.ValueChain = set()
> self.PcdFieldValueFromComm = OrderedDict()
> self.PcdFieldValueFromFdf = OrderedDict()
> + self.DefaultFromDSC=None
> def __repr__(self):
> return self.TypeName
>
> def AddDefaultValue (self, FieldName, Value, FileName="", LineNo=0,DimensionAttr ="-1"):
> if DimensionAttr not in self.DefaultValues:
> @@ -324,11 +325,10 @@ class StructurePcd(PcdClassObject):
> if isinstance(PcdObject, StructurePcd):
> self.StructuredPcdIncludeFile = PcdObject.StructuredPcdIncludeFile if PcdObject.StructuredPcdIncludeFile else
> self.StructuredPcdIncludeFile
> self.PackageDecs = PcdObject.PackageDecs if PcdObject.PackageDecs else self.PackageDecs
> self.DefaultValues = PcdObject.DefaultValues if PcdObject.DefaultValues else self.DefaultValues
> self.PcdMode = PcdObject.PcdMode if PcdObject.PcdMode else self.PcdMode
> - self.DefaultFromDSC=None
> self.DefaultValueFromDec = PcdObject.DefaultValueFromDec if PcdObject.DefaultValueFromDec else
> self.DefaultValueFromDec
> self.SkuOverrideValues = PcdObject.SkuOverrideValues if PcdObject.SkuOverrideValues else self.SkuOverrideValues
> self.StructName = PcdObject.DatumType if PcdObject.DatumType else self.StructName
> self.PcdDefineLineNo = PcdObject.PcdDefineLineNo if PcdObject.PcdDefineLineNo else self.PcdDefineLineNo
> self.PkgPath = PcdObject.PkgPath if PcdObject.PkgPath else self.PkgPath
> --
> 2.18.0.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Patch 3/3] BaseTools: Fix a bug about PcdArray
2019-02-04 6:48 [Patch 1/3] BaseTools: Fixed a build report issue Feng, Bob C
2019-02-04 6:48 ` [Patch 2/3] BaseTools: Fixed an issue about StructurePcd Feng, Bob C
@ 2019-02-04 6:48 ` Feng, Bob C
2019-02-14 14:32 ` Gao, Liming
[not found] ` <08650203BA1BD64D8AD9B6D5D74A85D1600859D1@SHSMSX101.ccr.corp.intel.com>
2 siblings, 1 reply; 6+ messages in thread
From: Feng, Bob C @ 2019-02-04 6:48 UTC (permalink / raw)
To: edk2-devel; +Cc: Bob Feng, Liming Gao
This patch is going to fix the bug that
there is an incorrect variable access method.
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index f472fa177f..a286232f7c 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -2394,11 +2394,11 @@ class DscBuildData(PlatformBuildClassObject):
skuinfo = Pcd.SkuInfoList[skuname]
if skuinfo.VariableName:
for defaultstore in skuinfo.DefaultStoreDict:
pcddscrawdefaultvalue = self.GetPcdDscRawDefaultValue(Pcd, skuname, defaultstore)
if pcddscrawdefaultvalue:
- Value = skuinfo[defaultstore]
+ Value = skuinfo.DefaultStoreDict[defaultstore]
if "{CODE(" in Value:
realvalue = Value.strip()[6:-2] # "{CODE(").rstrip(")}"
CApp += "static %s %s_%s_%s_%s_Value%s = %s;\n" % (Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName,Pcd.TokenCName,skuname,defaultstore,Demesion,realvalue)
else:
pcddscrawdefaultvalue = self.GetPcdDscRawDefaultValue(Pcd, skuname, TAB_DEFAULT_STORES_DEFAULT)
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Patch 3/3] BaseTools: Fix a bug about PcdArray
2019-02-04 6:48 ` [Patch 3/3] BaseTools: Fix a bug about PcdArray Feng, Bob C
@ 2019-02-14 14:32 ` Gao, Liming
0 siblings, 0 replies; 6+ messages in thread
From: Gao, Liming @ 2019-02-14 14:32 UTC (permalink / raw)
To: Feng, Bob C, edk2-devel@lists.01.org
Bob:
Could you give more message on this issue?
> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Feng, Bob C
> Sent: Monday, February 4, 2019 2:48 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>
> Subject: [edk2] [Patch 3/3] BaseTools: Fix a bug about PcdArray
>
> This patch is going to fix the bug that
> there is an incorrect variable access method.
>
> 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 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
> index f472fa177f..a286232f7c 100644
> --- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> @@ -2394,11 +2394,11 @@ class DscBuildData(PlatformBuildClassObject):
> skuinfo = Pcd.SkuInfoList[skuname]
> if skuinfo.VariableName:
> for defaultstore in skuinfo.DefaultStoreDict:
> pcddscrawdefaultvalue = self.GetPcdDscRawDefaultValue(Pcd, skuname, defaultstore)
> if pcddscrawdefaultvalue:
> - Value = skuinfo[defaultstore]
> + Value = skuinfo.DefaultStoreDict[defaultstore]
> if "{CODE(" in Value:
> realvalue = Value.strip()[6:-2] # "{CODE(").rstrip(")}"
> CApp += "static %s %s_%s_%s_%s_Value%s = %s;\n" %
> (Pcd.BaseDatumType,Pcd.TokenSpaceGuidCName,Pcd.TokenCName,skuname,defaultstore,Demesion,realvalue)
> else:
> pcddscrawdefaultvalue = self.GetPcdDscRawDefaultValue(Pcd, skuname, TAB_DEFAULT_STORES_DEFAULT)
> --
> 2.18.0.windows.1
>
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <08650203BA1BD64D8AD9B6D5D74A85D1600859D1@SHSMSX101.ccr.corp.intel.com>]
* Re: [Patch 1/3] BaseTools: Fixed a build report issue.
[not found] ` <08650203BA1BD64D8AD9B6D5D74A85D1600859D1@SHSMSX101.ccr.corp.intel.com>
@ 2019-02-14 14:01 ` Gao, Liming
0 siblings, 0 replies; 6+ messages in thread
From: Gao, Liming @ 2019-02-14 14:01 UTC (permalink / raw)
To: Feng, Bob C; +Cc: edk2-devel@lists.01.org
Reviewed-by: Liming Gao <liming.gao@intel.com>
> -----Original Message-----
> From: Feng, Bob C
> Sent: Monday, February 4, 2019 2:48 PM
> To: edk2-devel@lists.01.org
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [Patch 1/3] BaseTools: Fixed a build report issue.
>
> Generate report fail when -Y EXECUTION_ORDER in build command.
> This patch is going to fix this issue.
>
> 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/Eot/EotMain.py | 3 ++-
> BaseTools/Source/Python/build/BuildReport.py | 8 ++++----
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/BaseTools/Source/Python/Eot/EotMain.py b/BaseTools/Source/Python/Eot/EotMain.py
> index fd4bee6f90..57f96c89c9 100644
> --- a/BaseTools/Source/Python/Eot/EotMain.py
> +++ b/BaseTools/Source/Python/Eot/EotMain.py
> @@ -19,11 +19,12 @@ import Common.LongFilePathOs as os, time, glob import Common.EdkLogger as EdkLogger import
> Eot.EotGlobalData as EotGlobalData from optparse import OptionParser from Common.StringUtils import NormPath from Common
> import BuildToolError -from Common.Misc import GuidStructureStringToGuidString, sdict
> +from Common.Misc import GuidStructureStringToGuidString from
> +collections import OrderedDict as sdict
> from Eot.Parser import *
> from Eot.InfParserLite import EdkInfParser from Common.StringUtils import GetSplitValueList from Eot import c from Eot import
> Database diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
> index e457660fce..52764a6c55 100644
> --- a/BaseTools/Source/Python/build/BuildReport.py
> +++ b/BaseTools/Source/Python/build/BuildReport.py
> @@ -1650,18 +1650,18 @@ class PredictionReport(object):
> #
> SourceList = os.path.join(self._EotDir, "SourceFile.txt")
> GuidList = os.path.join(self._EotDir, "GuidList.txt")
> DispatchList = os.path.join(self._EotDir, "Dispatch.txt")
>
> - TempFile = open(SourceList, "w+")
> + TempFile = []
> for Item in self._SourceList:
> FileWrite(TempFile, Item)
> - TempFile.close()
> - TempFile = open(GuidList, "w+")
> + SaveFileOnChange(SourceList, "".join(TempFile), False)
> + TempFile = []
> for Key in self._GuidMap:
> FileWrite(TempFile, "%s %s" % (Key, self._GuidMap[Key]))
> - TempFile.close()
> + SaveFileOnChange(GuidList, "".join(TempFile), False)
>
> try:
> from Eot.EotMain import Eot
>
> #
> --
> 2.18.0.windows.1
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-02-14 14:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-04 6:48 [Patch 1/3] BaseTools: Fixed a build report issue Feng, Bob C
2019-02-04 6:48 ` [Patch 2/3] BaseTools: Fixed an issue about StructurePcd Feng, Bob C
2019-02-14 14:31 ` Gao, Liming
2019-02-04 6:48 ` [Patch 3/3] BaseTools: Fix a bug about PcdArray Feng, Bob C
2019-02-14 14:32 ` Gao, Liming
[not found] ` <08650203BA1BD64D8AD9B6D5D74A85D1600859D1@SHSMSX101.ccr.corp.intel.com>
2019-02-14 14:01 ` [Patch 1/3] BaseTools: Fixed a build report issue Gao, Liming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox