[edk2] [PATCH] BaseTools/Workspace: Fix ValueChain set

Marvin Häuser posted 1 patch 5 years, 11 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[edk2] [PATCH] BaseTools/Workspace: Fix ValueChain set
Posted by Marvin Häuser 5 years, 11 months ago
Commit 88252a90d1ca7846731cd2e4e8e860454f7d97a3 changed ValueChain
from a dict to a set, but also changed the (former) key type from a
touple to two separate values, which was probably unintended and also
breaks build for packages involving Structured PCDs, because add()
only takes one argument.
This commit changes the values back to touples.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 8476543c5352..0262a91ed855 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1347,7 +1347,7 @@ class DscBuildData(PlatformBuildClassObject):
                         nextskuid = self.SkuIdMgr.GetNextSkuId(nextskuid)
                     stru_pcd.SkuOverrideValues[skuid] = copy.deepcopy(stru_pcd.SkuOverrideValues[nextskuid]) if not NoDefault else copy.deepcopy({defaultstorename: stru_pcd.DefaultValues for defaultstorename in DefaultStores} if DefaultStores else {TAB_DEFAULT_STORES_DEFAULT:stru_pcd.DefaultValues})
                     if not NoDefault:
-                        stru_pcd.ValueChain.add(skuid,'')
+                        stru_pcd.ValueChain.add((skuid,''))
             if stru_pcd.Type in [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:
                 for skuid in SkuIds:
                     nextskuid = skuid
@@ -1366,7 +1366,7 @@ class DscBuildData(PlatformBuildClassObject):
                     for defaultstoreid in DefaultStores:
                         if defaultstoreid not in stru_pcd.SkuOverrideValues[skuid]:
                             stru_pcd.SkuOverrideValues[skuid][defaultstoreid] = copy.deepcopy(stru_pcd.SkuOverrideValues[nextskuid][mindefaultstorename])
-                            stru_pcd.ValueChain.add(skuid,defaultstoreid)
+                            stru_pcd.ValueChain.add((skuid,defaultstoreid))
         S_pcd_set = DscBuildData.OverrideByFdfComm(S_pcd_set)
         Str_Pcd_Values = self.GenerateByteArrayValue(S_pcd_set)
         if Str_Pcd_Values:
-- 
2.17.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] BaseTools/Workspace: Fix ValueChain set
Posted by Marvin Häuser 5 years, 11 months ago
Sorry, it seems like my IDE did whitespace changes for the second change.
I will submit a V2 once the functionality has been reviewed.

> -----Original Message-----
> From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Marvin
> Häuser
> Sent: Saturday, May 19, 2018 12:43 AM
> To: edk2-devel@lists.01.org
> Cc: jaben.carsey@intel.com; liming.gao@intel.com
> Subject: [edk2] [PATCH] BaseTools/Workspace: Fix ValueChain set
> 
> Commit 88252a90d1ca7846731cd2e4e8e860454f7d97a3 changed ValueChain
> from a dict to a set, but also changed the (former) key type from a touple to
> two separate values, which was probably unintended and also breaks build
> for packages involving Structured PCDs, because add() only takes one
> argument.
> This commit changes the values back to touples.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
> ---
>  BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
> b/BaseTools/Source/Python/Workspace/DscBuildData.py
> index 8476543c5352..0262a91ed855 100644
> --- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> @@ -1347,7 +1347,7 @@ class DscBuildData(PlatformBuildClassObject):
>                          nextskuid = self.SkuIdMgr.GetNextSkuId(nextskuid)
>                      stru_pcd.SkuOverrideValues[skuid] =
> copy.deepcopy(stru_pcd.SkuOverrideValues[nextskuid]) if not NoDefault
> else copy.deepcopy({defaultstorename: stru_pcd.DefaultValues for
> defaultstorename in DefaultStores} if DefaultStores else
> {TAB_DEFAULT_STORES_DEFAULT:stru_pcd.DefaultValues})
>                      if not NoDefault:
> -                        stru_pcd.ValueChain.add(skuid,'')
> +                        stru_pcd.ValueChain.add((skuid,''))
>              if stru_pcd.Type in
> [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII],
> self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:
>                  for skuid in SkuIds:
>                      nextskuid = skuid
> @@ -1366,7 +1366,7 @@ class DscBuildData(PlatformBuildClassObject):
>                      for defaultstoreid in DefaultStores:
>                          if defaultstoreid not in stru_pcd.SkuOverrideValues[skuid]:
>                              stru_pcd.SkuOverrideValues[skuid][defaultstoreid] =
> copy.deepcopy(stru_pcd.SkuOverrideValues[nextskuid][mindefaultstorena
> me])
> -                            stru_pcd.ValueChain.add(skuid,defaultstoreid)
> +
> + stru_pcd.ValueChain.add((skuid,defaultstoreid))
>          S_pcd_set = DscBuildData.OverrideByFdfComm(S_pcd_set)
>          Str_Pcd_Values = self.GenerateByteArrayValue(S_pcd_set)
>          if Str_Pcd_Values:
> --
> 2.17.0.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
Re: [edk2] [PATCH] BaseTools/Workspace: Fix ValueChain set
Posted by Zhu, Yonghong 5 years, 11 months ago
The patch looks good. Please send V2 to remove the space change. Thanks.

Best Regards,
Zhu Yonghong


-----Original Message-----
From: Marvin Häuser [mailto:Marvin.Haeuser@outlook.com] 
Sent: Saturday, May 19, 2018 5:28 PM
To: edk2-devel@lists.01.org
Cc: Carsey, Jaben <jaben.carsey@intel.com>; Gao, Liming <liming.gao@intel.com>; Zhu, Yonghong <yonghong.zhu@intel.com>
Subject: RE: [PATCH] BaseTools/Workspace: Fix ValueChain set

Sorry, it seems like my IDE did whitespace changes for the second change.
I will submit a V2 once the functionality has been reviewed.

> -----Original Message-----
> From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Marvin 
> Häuser
> Sent: Saturday, May 19, 2018 12:43 AM
> To: edk2-devel@lists.01.org
> Cc: jaben.carsey@intel.com; liming.gao@intel.com
> Subject: [edk2] [PATCH] BaseTools/Workspace: Fix ValueChain set
> 
> Commit 88252a90d1ca7846731cd2e4e8e860454f7d97a3 changed ValueChain 
> from a dict to a set, but also changed the (former) key type from a 
> touple to two separate values, which was probably unintended and also 
> breaks build for packages involving Structured PCDs, because add() 
> only takes one argument.
> This commit changes the values back to touples.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
> ---
>  BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
> b/BaseTools/Source/Python/Workspace/DscBuildData.py
> index 8476543c5352..0262a91ed855 100644
> --- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> @@ -1347,7 +1347,7 @@ class DscBuildData(PlatformBuildClassObject):
>                          nextskuid = self.SkuIdMgr.GetNextSkuId(nextskuid)
>                      stru_pcd.SkuOverrideValues[skuid] =
> copy.deepcopy(stru_pcd.SkuOverrideValues[nextskuid]) if not NoDefault 
> else copy.deepcopy({defaultstorename: stru_pcd.DefaultValues for 
> defaultstorename in DefaultStores} if DefaultStores else
> {TAB_DEFAULT_STORES_DEFAULT:stru_pcd.DefaultValues})
>                      if not NoDefault:
> -                        stru_pcd.ValueChain.add(skuid,'')
> +                        stru_pcd.ValueChain.add((skuid,''))
>              if stru_pcd.Type in
> [self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII],
> self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:
>                  for skuid in SkuIds:
>                      nextskuid = skuid @@ -1366,7 +1366,7 @@ class 
> DscBuildData(PlatformBuildClassObject):
>                      for defaultstoreid in DefaultStores:
>                          if defaultstoreid not in stru_pcd.SkuOverrideValues[skuid]:
>                              
> stru_pcd.SkuOverrideValues[skuid][defaultstoreid] = 
> copy.deepcopy(stru_pcd.SkuOverrideValues[nextskuid][mindefaultstorena
> me])
> -                            stru_pcd.ValueChain.add(skuid,defaultstoreid)
> +
> + stru_pcd.ValueChain.add((skuid,defaultstoreid))
>          S_pcd_set = DscBuildData.OverrideByFdfComm(S_pcd_set)
>          Str_Pcd_Values = self.GenerateByteArrayValue(S_pcd_set)
>          if Str_Pcd_Values:
> --
> 2.17.0.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