public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Bob Feng" <bob.c.feng@intel.com>
To: "Li, Yi1" <yi1.li@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Gao, Liming" <gaoliming@byosoft.com.cn>
Subject: Re: [PATCH 1/1] BaseTools: INF should use latest Pcd value instead of default value
Date: Sun, 24 Jul 2022 05:06:15 +0000	[thread overview]
Message-ID: <PH7PR11MB58638F5107FEC0FB8722F80AC9929@PH7PR11MB5863.namprd11.prod.outlook.com> (raw)
In-Reply-To: <ffb7399ff7d8e9ef13211234dd37dbeb0b3c5741.1657518401.git.yi1.li@intel.com>

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: Li, Yi1 <yi1.li@intel.com> 
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: [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


      parent reply	other threads:[~2022-07-24  5:06 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
2022-07-24  5:06   ` Bob Feng [this message]

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=PH7PR11MB58638F5107FEC0FB8722F80AC9929@PH7PR11MB5863.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