From nobody Sun Feb 8 18:24:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+87653+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87653+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 164749775371765.44396315924075; Wed, 16 Mar 2022 23:15:53 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id BqhlYY1788612xcTRPjdw0bZ; Wed, 16 Mar 2022 23:15:54 -0700 X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.7035.1647497749805390624 for ; Wed, 16 Mar 2022 23:15:54 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10288"; a="256520690" X-IronPort-AV: E=Sophos;i="5.90,188,1643702400"; d="scan'208";a="256520690" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2022 23:15:53 -0700 X-IronPort-AV: E=Sophos;i="5.90,188,1643702400"; d="scan'208";a="541242820" X-Received: from shwdejointd178.ccr.corp.intel.com ([10.239.153.103]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2022 23:15:52 -0700 From: "yi1 li" To: devel@edk2.groups.io Cc: yi1 li Subject: [edk2-devel] [PATCH 2/2] BaseTools: TEST ONLY2 FeatureFlagExpression Date: Thu, 17 Mar 2022 14:15:42 +0800 Message-Id: <964dee97e12793125d8c6cb486cf4d6498c05570.1646746333.git.yi1.li@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,yi1.li@intel.com X-Gm-Message-State: T7k64Slwm7ZbzRLUlyCi3quJx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1647497754; bh=CafmqbK31mEBuLrCuiAEh5diGdBcktTb3VEvZH6HX7U=; h=Cc:Date:From:Reply-To:Subject:To; b=OmCj3hKXZmyl2eYE+9KRnHht8vmLlWHHmL/A7Ilmb6v6kLoGUeS6/ZrvfW7JuPTLaOT sswCuorm6yeaXFznzhntMj/23sDsgg4ZMs0Ct6NM+bL99K0wMHeaLFjvyfYLSwmRiH9wr WEv8xDaVu6r6fJH8yR1ugH88BsVqnr22Iaw= X-ZohoMail-DKIM: fail (Signature date is -1 seconds in the future.) X-ZM-MESSAGEID: 1647497780736100002 Content-Type: text/plain; charset="utf-8" REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1446 FeatureFlagExpression Support in Source section of INF file. The Pcd value in the expression is from INF or DEC. When a FeatureFlagExpression is present,if the expression evaluates to TRUE,then the entry is valid. If the expression evaluates to FALSE, then the EDK II build tools must ignore the entry. This patch is going to add this feature. Signed-off-by: yi1 li --- BaseTools/Source/Python/Workspace/InfBuildData.py | 14 ++++++++++---- .../Source/Python/Workspace/MetaFileParser.py | 4 ++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/= Source/Python/Workspace/InfBuildData.py index 91d986d8cb1b..cb58e612cbd0 100644 --- a/BaseTools/Source/Python/Workspace/InfBuildData.py +++ b/BaseTools/Source/Python/Workspace/InfBuildData.py @@ -529,11 +529,17 @@ class InfBuildData(ModuleBuildClassObject): for Record in RecordList: LineNo =3D Record[-1] ToolChainFamily =3D Record[1] - TagName =3D Record[2] - ToolCode =3D Record[3] - + # OptionsList :=3D [TagName, ToolCode, FeatureFlag] + OptionsList =3D ['','',''] + TokenList =3D GetSplitValueList(Record[2], TAB_VALUE_SPLIT) + for Index in range(len(TokenList)): + OptionsList[Index] =3D TokenList[Index] + if OptionsList[2]: + FeaturePcdExpression =3D self.CheckFeatureFlagPcd(OptionsL= ist[2]) + if not FeaturePcdExpression: + continue File =3D PathClass(NormPath(Record[0], Macros), self._ModuleDi= r, '', - '', False, self._Arch, ToolChainFamily, '', T= agName, ToolCode) + '', False, self._Arch, ToolChainFamily, '', O= ptionsList[0], OptionsList[1]) # check the file validation ErrorCode, ErrorInfo =3D File.Validate() if ErrorCode !=3D 0: diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTool= s/Source/Python/Workspace/MetaFileParser.py index a3b6edbd15ee..3508591b281e 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -736,6 +736,10 @@ class InfParser(MetaFileParser): @ParseMacro def _SourceFileParser(self): TokenList =3D GetSplitValueList(self._CurrentLine, TAB_VALUE_SPLIT) + # Let TokenList[2] be TagName|ToolCode|FeatureFlag + if len(TokenList) > 3: + for extraToken in range(3, len(TokenList)): + TokenList[2] =3D TokenList[2] + '|' + TokenList[extraToken] self._ValueList[0:len(TokenList)] =3D TokenList Macros =3D self._Macros # For Acpi tables, remove macro like ' TABLE_NAME=3DSata1' --=20 2.33.0.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#87653): https://edk2.groups.io/g/devel/message/87653 Mute This Topic: https://groups.io/mt/89839904/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-