public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Fix Sku inherit issue.
@ 2017-12-27  6:03 BobCF
  2017-12-27  6:03 ` [Patch] BaseTools: Remove 'COMMON' in PCD SkuInfoList BobCF
  2018-01-08  3:33 ` [Patch] BaseTools: Fix Sku inherit issue Gao, Liming
  0 siblings, 2 replies; 4+ messages in thread
From: BobCF @ 2017-12-27  6:03 UTC (permalink / raw)
  To: edk2-devel

The final Pcd value should only be override by its parents.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Source/Python/Common/Misc.py            | 2 ++
 BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index 0374be0631..dc214dbfa8 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -2198,10 +2198,12 @@ class SkuClass():
             for item in self.SkuData.values():
                 self.__SkuInherit[item[1]]=item[2] if item[2] else "DEFAULT"
         return self.__SkuInherit.get(skuname,"DEFAULT")
 
     def GetSkuChain(self,sku):
+        if sku == "DEFAULT":
+            return ["DEFAULT"]
         skulist = [sku]
         nextsku = sku
         while 1:
             nextsku = self.GetNextSkuId(nextsku)
             skulist.append(nextsku)
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 929c317957..5e052eca7c 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1319,11 +1319,11 @@ class DscBuildData(PlatformBuildClassObject):
                             FieldName = FieldName.split(']', 1)[1]
                         FieldName = NewFieldName + FieldName
                         while '[' in FieldName:
                             FieldName = FieldName.rsplit('[', 1)[0]
                             CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d);\n' % (Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1)
-            for skuname in self.SkuIdMgr.SkuOverrideOrder():
+            for skuname in self.SkuIdMgr.GetSkuChain(SkuName):
                 inherit_OverrideValues = Pcd.SkuOverrideValues[skuname]
                 for FieldList in [inherit_OverrideValues.get(DefaultStoreName)]:
                     if not FieldList:
                         continue
                     for FieldName in FieldList:
@@ -1383,11 +1383,11 @@ class DscBuildData(PlatformBuildClassObject):
                     else:
                         if ValueSize > 4:
                             CApp = CApp + '  Pcd->%s = %dULL; // From %s Line %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList[FieldName][2], FieldList[FieldName][0])
                         else:
                             CApp = CApp + '  Pcd->%s = %d; // From %s Line %d Value %s\n' % (FieldName, Value, FieldList[FieldName][1], FieldList[FieldName][2], FieldList[FieldName][0])
-            for skuname in self.SkuIdMgr.SkuOverrideOrder():
+            for skuname in self.SkuIdMgr.GetSkuChain(SkuName):
                 inherit_OverrideValues = Pcd.SkuOverrideValues[skuname]
                 for FieldList in [Pcd.DefaultFromDSC,inherit_OverrideValues.get(DefaultStoreName)]:
                     if not FieldList:
                         continue
                     if Pcd.DefaultFromDSC and FieldList == Pcd.DefaultFromDSC:
-- 
2.14.3.windows.1



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

* [Patch] BaseTools: Remove 'COMMON' in PCD SkuInfoList
  2017-12-27  6:03 [Patch] BaseTools: Fix Sku inherit issue BobCF
@ 2017-12-27  6:03 ` BobCF
  2017-12-27  9:35   ` Gao, Liming
  2018-01-08  3:33 ` [Patch] BaseTools: Fix Sku inherit issue Gao, Liming
  1 sibling, 1 reply; 4+ messages in thread
From: BobCF @ 2017-12-27  6:03 UTC (permalink / raw)
  To: edk2-devel; +Cc: Bob Feng, Liming Gao

'COMMON' is an alias of 'DEFAULT' for internal code, 
it should be removed before generating Pcd DataBase.

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 | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index e4f3586654..929c317957 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1706,12 +1706,11 @@ class DscBuildData(PlatformBuildClassObject):
         else:
             return False
     def CompletePcdValues(self,PcdSet):
         Pcds = {}
         DefaultStoreObj = DefaultStore(self._GetDefaultStores())
-        SkuIds = set([(skuid,skuobj.SkuId) for pcdobj in PcdSet.values() for skuid,skuobj in pcdobj.SkuInfoList.items()])
-        SkuIds = self.SkuIdMgr.AvailableSkuIdSet
+        SkuIds = {skuname:skuid for skuname,skuid in self.SkuIdMgr.AvailableSkuIdSet.items() if skuname !='COMMON'}
         DefaultStores = set([storename for pcdobj in PcdSet.values() for skuobj in pcdobj.SkuInfoList.values() for storename in skuobj.DefaultStoreDict.keys()])
         for PcdCName, TokenSpaceGuid in PcdSet:
             PcdObj = PcdSet[(PcdCName, TokenSpaceGuid)]
             if PcdObj.Type not in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_DEFAULT],
                         self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII],
-- 
2.14.3.windows.1



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

* Re: [Patch] BaseTools: Remove 'COMMON' in PCD SkuInfoList
  2017-12-27  6:03 ` [Patch] BaseTools: Remove 'COMMON' in PCD SkuInfoList BobCF
@ 2017-12-27  9:35   ` Gao, Liming
  0 siblings, 0 replies; 4+ messages in thread
From: Gao, Liming @ 2017-12-27  9:35 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
>BobCF
>Sent: Wednesday, December 27, 2017 2:04 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>
>Subject: [edk2] [Patch] BaseTools: Remove 'COMMON' in PCD SkuInfoList
>
>'COMMON' is an alias of 'DEFAULT' for internal code,
>it should be removed before generating Pcd DataBase.
>
>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 | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
>b/BaseTools/Source/Python/Workspace/DscBuildData.py
>index e4f3586654..929c317957 100644
>--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
>@@ -1706,12 +1706,11 @@ class DscBuildData(PlatformBuildClassObject):
>         else:
>             return False
>     def CompletePcdValues(self,PcdSet):
>         Pcds = {}
>         DefaultStoreObj = DefaultStore(self._GetDefaultStores())
>-        SkuIds = set([(skuid,skuobj.SkuId) for pcdobj in PcdSet.values() for
>skuid,skuobj in pcdobj.SkuInfoList.items()])
>-        SkuIds = self.SkuIdMgr.AvailableSkuIdSet
>+        SkuIds = {skuname:skuid for skuname,skuid in
>self.SkuIdMgr.AvailableSkuIdSet.items() if skuname !='COMMON'}
>         DefaultStores = set([storename for pcdobj in PcdSet.values() for skuobj
>in pcdobj.SkuInfoList.values() for storename in
>skuobj.DefaultStoreDict.keys()])
>         for PcdCName, TokenSpaceGuid in PcdSet:
>             PcdObj = PcdSet[(PcdCName, TokenSpaceGuid)]
>             if PcdObj.Type not in
>[self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_DEFAULT],
>                         self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII],
>--
>2.14.3.windows.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel


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

* Re: [Patch] BaseTools: Fix Sku inherit issue.
  2017-12-27  6:03 [Patch] BaseTools: Fix Sku inherit issue BobCF
  2017-12-27  6:03 ` [Patch] BaseTools: Remove 'COMMON' in PCD SkuInfoList BobCF
@ 2018-01-08  3:33 ` Gao, Liming
  1 sibling, 0 replies; 4+ messages in thread
From: Gao, Liming @ 2018-01-08  3:33 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
>BobCF
>Sent: Wednesday, December 27, 2017 2:04 PM
>To: edk2-devel@lists.01.org
>Subject: [edk2] [Patch] BaseTools: Fix Sku inherit issue.
>
>The final Pcd value should only be override by its parents.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Feng Bob C <bob.c.feng@intel.com>
>Reviewed-by: Liming Gao <liming.gao@intel.com>
>---
> BaseTools/Source/Python/Common/Misc.py            | 2 ++
> BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Common/Misc.py
>b/BaseTools/Source/Python/Common/Misc.py
>index 0374be0631..dc214dbfa8 100644
>--- a/BaseTools/Source/Python/Common/Misc.py
>+++ b/BaseTools/Source/Python/Common/Misc.py
>@@ -2198,10 +2198,12 @@ class SkuClass():
>             for item in self.SkuData.values():
>                 self.__SkuInherit[item[1]]=item[2] if item[2] else "DEFAULT"
>         return self.__SkuInherit.get(skuname,"DEFAULT")
>
>     def GetSkuChain(self,sku):
>+        if sku == "DEFAULT":
>+            return ["DEFAULT"]
>         skulist = [sku]
>         nextsku = sku
>         while 1:
>             nextsku = self.GetNextSkuId(nextsku)
>             skulist.append(nextsku)
>diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
>b/BaseTools/Source/Python/Workspace/DscBuildData.py
>index 929c317957..5e052eca7c 100644
>--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
>@@ -1319,11 +1319,11 @@ class DscBuildData(PlatformBuildClassObject):
>                             FieldName = FieldName.split(']', 1)[1]
>                         FieldName = NewFieldName + FieldName
>                         while '[' in FieldName:
>                             FieldName = FieldName.rsplit('[', 1)[0]
>                             CApp = CApp + '  __FLEXIBLE_SIZE(Size, %s, %s, %d);\n' %
>(Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1)
>-            for skuname in self.SkuIdMgr.SkuOverrideOrder():
>+            for skuname in self.SkuIdMgr.GetSkuChain(SkuName):
>                 inherit_OverrideValues = Pcd.SkuOverrideValues[skuname]
>                 for FieldList in [inherit_OverrideValues.get(DefaultStoreName)]:
>                     if not FieldList:
>                         continue
>                     for FieldName in FieldList:
>@@ -1383,11 +1383,11 @@ class DscBuildData(PlatformBuildClassObject):
>                     else:
>                         if ValueSize > 4:
>                             CApp = CApp + '  Pcd->%s = %dULL; // From %s Line %d
>Value %s\n' % (FieldName, Value, FieldList[FieldName][1],
>FieldList[FieldName][2], FieldList[FieldName][0])
>                         else:
>                             CApp = CApp + '  Pcd->%s = %d; // From %s Line %d
>Value %s\n' % (FieldName, Value, FieldList[FieldName][1],
>FieldList[FieldName][2], FieldList[FieldName][0])
>-            for skuname in self.SkuIdMgr.SkuOverrideOrder():
>+            for skuname in self.SkuIdMgr.GetSkuChain(SkuName):
>                 inherit_OverrideValues = Pcd.SkuOverrideValues[skuname]
>                 for FieldList in
>[Pcd.DefaultFromDSC,inherit_OverrideValues.get(DefaultStoreName)]:
>                     if not FieldList:
>                         continue
>                     if Pcd.DefaultFromDSC and FieldList == Pcd.DefaultFromDSC:
>--
>2.14.3.windows.1
>
>_______________________________________________
>edk2-devel mailing list
>edk2-devel@lists.01.org
>https://lists.01.org/mailman/listinfo/edk2-devel


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

end of thread, other threads:[~2018-01-08  3:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-27  6:03 [Patch] BaseTools: Fix Sku inherit issue BobCF
2017-12-27  6:03 ` [Patch] BaseTools: Remove 'COMMON' in PCD SkuInfoList BobCF
2017-12-27  9:35   ` Gao, Liming
2018-01-08  3:33 ` [Patch] BaseTools: Fix Sku inherit 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