From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.25206.1657518509173452544 for ; Sun, 10 Jul 2022 22:48:29 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=FL9wmhQQ; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: yi1.li@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657518509; x=1689054509; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Nv3+hkJIJiaJ06AG3WdkGLQ2s+5x0UQfoe6p6JIrGoE=; b=FL9wmhQQuY42NwwXFr02tBS6DRKq8iCddhwxuO9hn+y1QUUkHq9LbncZ B5EVT7HBYFGXYaC0h4iA+oaKExy5O1RbuvtkQx179/l/qyMi+wJHrP64q FXTLQzc19Ccz63xBgFk4RH0EVkMMffGjZGLWfXL6I97gt1U2/hJ/iytRA wQv/kc5Bx9PtnJaat64fBUiL9mK7ghMP7xtlkdxREgj7gdcvrupVKftwl 7XdGL/KcM4iJbp1FXvc3e7i1JluZJGMTf1H0fzVu4UOm0WH8HocTbk28t giPU+uAIidN6UqTL3w3gJ+dB2SQa0iejQbaUmjH7KlqvCzwq5CX95fkKa w==; X-IronPort-AV: E=McAfee;i="6400,9594,10404"; a="346267298" X-IronPort-AV: E=Sophos;i="5.92,262,1650956400"; d="scan'208";a="346267298" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2022 22:48:28 -0700 X-IronPort-AV: E=Sophos;i="5.92,262,1650956400"; d="scan'208";a="921657855" Received: from liyi4-desktop.ccr.corp.intel.com ([10.239.153.82]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2022 22:48:26 -0700 From: "yi1 li" To: devel@edk2.groups.io Cc: Yi Li , Bob Feng , Liming Gao Subject: [PATCH 1/1] BaseTools: INF should use latest Pcd value instead of default value Date: Mon, 11 Jul 2022 13:48:14 +0800 Message-Id: X-Mailer: git-send-email 2.31.1.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Liming Gao Signed-off-by: Yi Li --- 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