From: "yi1 li" <yi1.li@intel.com>
To: "Chen, Christine" <yuwei.chen@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Feng, Bob C" <bob.c.feng@intel.com>,
"Gao, Liming" <gaoliming@byosoft.com.cn>
Subject: Re: [edk2-devel] [PATCH 1/1] BaseTools: INF should use latest Pcd value instead of default value
Date: Fri, 22 Jul 2022 02:46:43 +0000 [thread overview]
Message-ID: <SJ1PR11MB6227E400564C2828485422DAC5909@SJ1PR11MB6227.namprd11.prod.outlook.com> (raw)
In-Reply-To: <MW5PR11MB59064BEAF40DA322A7EF0FC496909@MW5PR11MB5906.namprd11.prod.outlook.com>
Hi Christine,
Thanks for review, and this bug is come from commit : https://github.com/tianocore/edk2/commit/bf9230a9f3dde065c3c8b4175ccd32e44e8f0362
This commit introduce a new feature to conditional build source file in INF,
Such like: curve25519.c |*|*|*|gEfiCryptoPkgTokenSpaceGuid.PcdOpensslEcEnabled
The issue is :
If FeatureFlagExpression is a PCD expression, not just PCD, e.g. (!gEfiTestGuid.Pcd) ,(NOT gEfiTestGuid.Pcd) ...,
Basetools can not calculate the correct value.
The root-cause is INF now use default PCD value in DEC (self.Pcds[(Name, Guid)].DefaultValue) when calculating expression,
If a PCD has be set in DSC (the new value will be stored in gPlatformFinalPcds), we need to use the new value.
Hope it's clear.
-----Original Message-----
From: Chen, Christine <yuwei.chen@intel.com>
Sent: Friday, July 22, 2022 10:29 AM
To: devel@edk2.groups.io; Li, Yi1 <yi1.li@intel.com>
Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>
Subject: RE: [edk2-devel] [PATCH 1/1] BaseTools: INF should use latest Pcd value instead of default value
Hi Yi,
Could you describe the bug with an example? In which scenario the dsc defined pcd will not override the dec definition?
Thanks,
Christine
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of yi1 li
> Sent: Monday, July 11, 2022 1:48 PM
> To: devel@edk2.groups.io
> Cc: Li, Yi1 <yi1.li@intel.com>; Feng, Bob C <bob.c.feng@intel.com>;
> Gao, Liming <gaoliming@byosoft.com.cn>
> Subject: [edk2-devel] [PATCH 1/1] BaseTools: INF should use latest Pcd
> value instead of default value
>
> This patch is a bug fix about FeatureFlagExpression in INF file:
> INF [Source] section now unconditionally use Pcd default value in DEC
> when handling FeatureFlagExpression, it is wrong.
> If a Pcd value has been set in the DSC file, we should use latest
> value in DSC instead of default value.
>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
>
> Signed-off-by: Yi Li <yi1.li@intel.com>
> ---
> BaseTools/Source/Python/Workspace/InfBuildData.py | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py
> b/BaseTools/Source/Python/Workspace/InfBuildData.py
> index 5b9b3d7b4f..e4ff1c6686 100644
> --- a/BaseTools/Source/Python/Workspace/InfBuildData.py
> +++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
> @@ -1084,7 +1084,9 @@ class InfBuildData(ModuleBuildClassObject):
> else:
> for Name, Guid in self.Pcds:
> if self.Pcds[(Name, Guid)].Type == 'FeatureFlag' or
> self.Pcds[(Name, Guid)].Type == 'FixedAtBuild':
> - Pcds['%s.%s' % (Guid, Name)] = self.Pcds[(Name,
> Guid)].DefaultValue
> + PcdFullName = '%s.%s' % (Guid, Name);
> + if not PcdFullName in Pcds:
> + Pcds[PcdFullName] = self.Pcds[(Name,
> + Guid)].DefaultValue
> try:
> Value = ValueExpression(Instance, Pcds)()
> if Value == True:
> --
> 2.31.1.windows.1
>
>
>
>
>
next prev parent reply other threads:[~2022-07-22 2:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1657518401.git.yi1.li@intel.com>
2022-07-11 5:48 ` [PATCH 1/1] BaseTools: INF should use latest Pcd value instead of default value yi1 li
2022-07-22 2:28 ` [edk2-devel] " Yuwei Chen
2022-07-22 2:46 ` yi1 li [this message]
2022-07-24 5:06 ` Bob Feng
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=SJ1PR11MB6227E400564C2828485422DAC5909@SJ1PR11MB6227.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