From: "Yuwei Chen" <yuwei.chen@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "Feng, Bob C" <bob.c.feng@intel.com>,
"Gao, Liming" <gaoliming@byosoft.com.cn>,
"Chen, Christine" <yuwei.chen@intel.com>
Subject: Re: [edk2-devel] [PATCH] BaseTools: Fix build option overrides Pcd Feature Flag issue
Date: Fri, 28 Oct 2022 08:33:52 +0000 [thread overview]
Message-ID: <MW5PR11MB5906014EAF3B4E0765DA176C96329@MW5PR11MB5906.namprd11.prod.outlook.com> (raw)
In-Reply-To: <172143CEEE5293C9.21867@groups.io>
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
>
>
>
>
>
parent reply other threads:[~2022-10-28 8:34 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <172143CEEE5293C9.21867@groups.io>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MW5PR11MB5906014EAF3B4E0765DA176C96329@MW5PR11MB5906.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox