From nobody Sun Feb 8 20:17:57 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+87356+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87356+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1646746942; cv=none; d=zohomail.com; s=zohoarc; b=ULT1mEpc3GI8O9kGZ760LIS5NFt2oejAE/+hlp0a2db5aOvyhMQ5HVOfdazFzIDse+Th/jkY2zYug5OplSwoNfuJGXyvGPulNSLerFqiUu22mhGh9aN68eonMkSn9Gt607yueZ/PfxhyNIRCAuYaijeewYe9UQFKpANfbcgGymk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646746942; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=8jp1kWn7+i5++U/9sjKv/SQz/KXC3Fuu0NSPn5jgfkA=; b=cqcqTM/2TnLgS6StlvVyBeJEBV44HpPWpyWeHHfLS7Mmuhn022sAOXKqzZ/pKiZQ6pQHcK5ADBwpb6WqJwPJWTyeuU86gpKisLm5QonAETZ4iPO36J3txwXQmq8rxSUcltdSZTW+J/aUCNpTk57Z4LUT3+DuEzsPw7TN/QrrG3Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+87356+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 164674694237750.326545660461875; Tue, 8 Mar 2022 05:42:22 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1SVGYY1788612xEXSkBpkzf9; Tue, 08 Mar 2022 05:42:21 -0800 X-Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.8047.1646746941125860812 for ; Tue, 08 Mar 2022 05:42:21 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10279"; a="234637202" X-IronPort-AV: E=Sophos;i="5.90,165,1643702400"; d="scan'208";a="234637202" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2022 05:42:20 -0800 X-IronPort-AV: E=Sophos;i="5.90,165,1643702400"; d="scan'208";a="537569302" 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; 08 Mar 2022 05:42:18 -0800 From: "yi1 li" To: devel@edk2.groups.io Cc: yi1 li , Bob Feng , Liming Gao , Heng Luo Subject: [edk2-devel] [PATCH V2 2/2] BaseTools:Add the FeatureFlagExpression usage to the Source Section Date: Tue, 8 Mar 2022 21:42:07 +0800 Message-Id: <964dee97e12793125d8c6cb486cf4d6498c05570.1646746598.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: 4AqwYkHerByWW8jZvvfxOKS7x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1646746941; bh=+6wGCt7itbZQSg40IWVsByT25j1TENGbs+XCJTj891s=; h=Cc:Date:From:Reply-To:Subject:To; b=S0EziuTv2McMLE4+1hweteWPKxkDZzeaYNFXB2fy48St352Y2Iv81axGHRC6bCEsGEe QzxcgM6XWGSk/vUl7YntbDHPCEsD7BrNisn+cH7eBgaJcoTZDK8dhs3skqPr3f0sFHqFX IgMuQw+pGx5HeGT0+1CfmANkrOOuuAGPEl8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1646746942873100001 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. Cc: Bob Feng Cc: Liming Gao Cc: Heng Luo 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 (#87356): https://edk2.groups.io/g/devel/message/87356 Mute This Topic: https://groups.io/mt/89636890/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-