public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Re: [edk2-devel] [PATCH] BaseTools: Fix build option overrides Pcd Feature Flag issue
       [not found] <172143CEEE5293C9.21867@groups.io>
@ 2022-10-28  8:33 ` Yuwei Chen
  0 siblings, 0 replies; only message in thread
From: Yuwei Chen @ 2022-10-28  8:33 UTC (permalink / raw)
  To: devel@edk2.groups.io, Kinney, Michael D
  Cc: Feng, Bob C, Gao, Liming, Chen, Christine

 Cc Mike.

Thanks,
Christine

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Yuwei
> Chen
> Sent: Tuesday, October 25, 2022 4:51 PM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>
> Subject: [edk2-devel] [PATCH] BaseTools: Fix build option overrides Pcd
> Feature Flag issue
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4081
> 
> INF [Sources] section Feature Flag Expressions do not use override values
> from build --pcd option currently.
> This patch fix this issue.
> 
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com>
> ---
>  edk2basetools/Workspace/InfBuildData.py | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/edk2basetools/Workspace/InfBuildData.py
> b/edk2basetools/Workspace/InfBuildData.py
> index c97a70e..8631373 100644
> --- a/edk2basetools/Workspace/InfBuildData.py
> +++ b/edk2basetools/Workspace/InfBuildData.py
> @@ -1055,6 +1055,7 @@ def IsBinaryModule(self):
>          return False
>      def CheckFeatureFlagPcd(self,Instance):
>          Pcds = GlobalData.gPlatformFinalPcds.copy()
> +        BuildOptionPcds = GlobalData.BuildOptionPcd
>          if PcdPattern.search(Instance):
>              PcdTuple = tuple(Instance.split('.')[::-1])
>              if PcdTuple in self.Pcds:
> @@ -1062,6 +1063,14 @@ def CheckFeatureFlagPcd(self,Instance):
>                      EdkLogger.error('build', FORMAT_INVALID,
>                                      "\nFeatureFlagPcd must be defined in a [PcdsFeatureFlag]
> or [PcdsFixedAtBuild] section of Dsc or Dec file",
>                                      File=str(self), ExtraData=Instance)
> +                for item in BuildOptionPcds:
> +                    if self.Pcds[PcdTuple].TokenCName in item:
> +                        if type(item) == type(()):
> +                            # ('gEfiCryptoPkgTokenSpaceGuid', 'PcdOpensslEcEnabled', '',
> '1', ('build command options', 1)
> +                            Pcds[Instance] = list(item)[3]
> +                        elif type(item) == type(''):
> +                            # gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled=1
> +                            Pcds[Instance] = item.split('=')[1]
>                  if not Instance in Pcds:
>                      Pcds[Instance] = self.Pcds[PcdTuple].DefaultValue
>              else: #if PcdTuple not in self.Pcds:
> @@ -1085,6 +1094,14 @@ def CheckFeatureFlagPcd(self,Instance):
>              for Name, Guid in self.Pcds:
>                  if self.Pcds[(Name, Guid)].Type == 'FeatureFlag' or self.Pcds[(Name,
> Guid)].Type == 'FixedAtBuild':
>                      PcdFullName = '%s.%s' % (Guid, Name);
> +                    for item in BuildOptionPcds:
> +                        if Name in item:
> +                            if type(item) == type(()):
> +                                # ('gEfiCryptoPkgTokenSpaceGuid', 'PcdOpensslEcEnabled',
> '', '1', ('build command options', 1)
> +                                Pcds[PcdFullName] = list(item)[3]
> +                            elif type(item) == type(''):
> +                                # gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled=1
> +                                Pcds[PcdFullName] = item.split('=')[1]
>                      if not PcdFullName in Pcds:
>                          Pcds[PcdFullName] = self.Pcds[(Name, Guid)].DefaultValue
>              try:
> --
> 2.27.0.windows.1
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-28  8:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <172143CEEE5293C9.21867@groups.io>
2022-10-28  8:33 ` [edk2-devel] [PATCH] BaseTools: Fix build option overrides Pcd Feature Flag issue Yuwei Chen

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