From nobody Tue Feb 10 03:39:04 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+81024+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+81024+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1632387556; cv=none; d=zohomail.com; s=zohoarc; b=n78coB8BFeNjj+689ZG8vrYmZ0oy2EotBI8p3nUnAy5pZ6jT+5diEeqibJjwE38BDXWHlpomr/2WXf70Udgwnlst4HkHyd3g1BXG7XXN9DqJV2h6C7RkZ70eSFJZ96ldnwJ9UZ0YIR7WlX6CgBt5XcNUD23wWBtIWKzIiqqzvC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632387556; h=Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=9yqa6tPv3oNEPsHsOsBDux3G9JPtj1TslKSoXWZyWho=; b=aIe0oDC8F3TF4SyBnRk/jJHzWX5zgu8Lcu8YpIPF73quUEdTRRHTRL+iHo8KXspt4xCEkN6i5JRbJ6u3ulsw1gh/FLOTUs6Tnl82/bM6dUREAgQH/ZR783adZdzTjyyLqywtV9/xcTiPBewowC7ARFXGYtYgGQV5B/7jDvvTvdg= 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+81024+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 163238755644649.571253061073776; Thu, 23 Sep 2021 01:59:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id za6DYY1788612x26F4hQvjxh; Thu, 23 Sep 2021 01:59:16 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.1940.1632387555548849866 for ; Thu, 23 Sep 2021 01:59:15 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3C817113E; Thu, 23 Sep 2021 01:59:15 -0700 (PDT) X-Received: from e120189.arm.com (unknown [10.57.87.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0252C3F59C; Thu, 23 Sep 2021 01:59:13 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io, Bob Feng , Liming Gao , Sami Mujawar Subject: [edk2-devel] [PATCH v1 4/4] BaseTools: Remove hard-coded strings for target and tools_def Date: Thu, 23 Sep 2021 09:59:03 +0100 Message-Id: <20210923085903.15966-5-Pierre.Gondois@arm.com> In-Reply-To: <20210923085903.15966-1-Pierre.Gondois@arm.com> References: <20210923085903.15966-1-Pierre.Gondois@arm.com> 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,pierre.gondois@arm.com X-Gm-Message-State: t9VDZabHp5lIYEDjpn9xwLptx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1632387556; bh=//JrEeLTP0xcPazH4CUj+tvFbE846VjvXv46cbBFbSM=; h=Date:From:Reply-To:Subject:To; b=jDVWBHg7inQnuMYeWSUZkfJ5abeufyX59VZIqAih6sxctedWnto2ADCOpdLnpXxPtn2 UzBJ5DJ7U6zs3syn2iIVbrYI5jU5Sno4YgVTj0UPC073q1yQXbqKCsUbtwoQZWfuX6AwH pOe6KZQqhP/M2Yi0MPjI+vlxj+8anReBkdQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1632387558233100017 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois The "target.txt" and "tools_def.txt" filenames are hard-coded at some places when global definitions are available at: BaseTools/Source/Python/Common/TargetTxtClassObject.py: DefaultTargetTxtFile and BaseTools/Source/Python/Common/ToolDefClassObject.py: DefaultToolsDefFile Use these global definitions instead. Also remove the unused gBuildConfiguration and gToolsDefinition variables from build.py Signed-off-by: Pierre Gondois --- BaseTools/Source/Python/GenFds/GenFds.py | 4 ++-- BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 4 ++-- BaseTools/Source/Python/TargetTool/TargetTool.py | 3 ++- BaseTools/Source/Python/Workspace/DscBuildData.py | 9 ++++----- BaseTools/Source/Python/build/build.py | 4 ---- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Py= thon/GenFds/GenFds.py index ae3e776a5540..c34104500059 100644 --- a/BaseTools/Source/Python/GenFds/GenFds.py +++ b/BaseTools/Source/Python/GenFds/GenFds.py @@ -20,7 +20,7 @@ from linecache import getlines from io import BytesIO =20 import Common.LongFilePathOs as os -from Common.TargetTxtClassObject import TargetTxtDict +from Common.TargetTxtClassObject import TargetTxtDict,gDefaultTargetTxtFile from Common.DataType import * import Common.GlobalData as GlobalData from Common import EdkLogger @@ -207,7 +207,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNone): GenFdsGlobalVariable.ConfDir =3D ConfDirectoryPath if not GlobalData.gConfDirectory: GlobalData.gConfDirectory =3D GenFdsGlobalVariable.ConfDir - BuildConfigurationFile =3D os.path.normpath(os.path.join(ConfDirec= toryPath, "target.txt")) + BuildConfigurationFile =3D os.path.normpath(os.path.join(ConfDirec= toryPath, gDefaultTargetTxtFile)) if os.path.isfile(BuildConfigurationFile) =3D=3D True: # if no build target given in command line, get it from target= .txt TargetObj =3D TargetTxtDict() diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseT= ools/Source/Python/GenFds/GenFdsGlobalVariable.py index 25f9d54874d3..d7668ba681aa 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -24,7 +24,7 @@ from Common import EdkLogger from Common.Misc import SaveFileOnChange =20 from Common.TargetTxtClassObject import TargetTxtDict -from Common.ToolDefClassObject import ToolDefDict +from Common.ToolDefClassObject import ToolDefDict,gDefaultToolsDefFile from AutoGen.BuildEngine import ToolBuildRule import Common.DataType as DataType from Common.Misc import PathClass,CreateDirectory @@ -103,7 +103,7 @@ class GenFdsGlobalVariable: TargetObj =3D TargetTxtDict() ToolDefinitionFile =3D TargetObj.Target.TargetTxtDictionary[DataTy= pe.TAB_TAT_DEFINES_TOOL_CHAIN_CONF] if ToolDefinitionFile =3D=3D '': - ToolDefinitionFile =3D "Conf/tools_def.txt" + ToolDefinitionFile =3D os.path.join('Conf', gDefaultToolsDefF= ile) if os.path.isfile(ToolDefinitionFile): ToolDefObj =3D ToolDefDict((os.path.join(os.getenv("WORKSPACE"= ), "Conf"))) ToolDefinition =3D ToolDefObj.ToolDef.ToolsDefTxtDatabase diff --git a/BaseTools/Source/Python/TargetTool/TargetTool.py b/BaseTools/S= ource/Python/TargetTool/TargetTool.py index 71222e3cc899..7f2479f0f0ac 100644 --- a/BaseTools/Source/Python/TargetTool/TargetTool.py +++ b/BaseTools/Source/Python/TargetTool/TargetTool.py @@ -17,6 +17,7 @@ import Common.BuildToolError as BuildToolError from Common.DataType import * from Common.BuildVersion import gBUILD_VERSION from Common.LongFilePathSupport import OpenLongFilePath as open +from Common.TargetTxtClassObject import gDefaultTargetTxtFile =20 # To Do 1.set clean, 2. add item, if the line is disabled. =20 @@ -25,7 +26,7 @@ class TargetTool(): self.WorkSpace =3D os.path.normpath(os.getenv('WORKSPACE')) self.Opt =3D opt self.Arg =3D args[0] - self.FileName =3D os.path.normpath(os.path.join(self.WorkSpace, '= Conf', 'target.txt')) + self.FileName =3D os.path.normpath(os.path.join(self.WorkSpace, '= Conf', gDefaultTargetTxtFile)) if os.path.isfile(self.FileName) =3D=3D False: print("%s does not exist." % self.FileName) sys.exit(1) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= Source/Python/Workspace/DscBuildData.py index 4d5b1ad4d90a..d1ee0ccaea7e 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -19,8 +19,8 @@ from Common.Misc import * from types import * from Common.Expression import * from CommonDataClass.CommonClass import SkuInfoClass -from Common.TargetTxtClassObject import TargetTxtDict -from Common.ToolDefClassObject import ToolDefDict +from Common.TargetTxtClassObject import TargetTxtDict,gDefaultTargetTxtFile +from Common.ToolDefClassObject import ToolDefDict,gDefaultToolsDefFile from .MetaDataTable import * from .MetaFileTable import * from .MetaFileParser import * @@ -3526,12 +3526,11 @@ class DscBuildData(PlatformBuildClassObject): self._ToolChainFamily =3D TAB_COMPILER_MSFT TargetObj =3D TargetTxtDict() TargetTxt =3D TargetObj.Target - BuildConfigurationFile =3D os.path.normpath(os.path.join(GlobalDat= a.gConfDirectory, "target.txt")) + BuildConfigurationFile =3D os.path.normpath(os.path.join(GlobalDat= a.gConfDirectory, gDefaultTargetTxtFile)) if os.path.isfile(BuildConfigurationFile) =3D=3D True: ToolDefinitionFile =3D TargetTxt.TargetTxtDictionary[DataType.= TAB_TAT_DEFINES_TOOL_CHAIN_CONF] if ToolDefinitionFile =3D=3D '': - ToolDefinitionFile =3D "tools_def.txt" - ToolDefinitionFile =3D os.path.normpath(mws.join(self.Work= spaceDir, 'Conf', ToolDefinitionFile)) + ToolDefinitionFile =3D os.path.normpath(mws.join(self.Work= spaceDir, 'Conf', gDefaultToolsDefFile)) if os.path.isfile(ToolDefinitionFile) =3D=3D True: ToolDefObj =3D ToolDefDict((os.path.join(os.getenv("WORKSP= ACE"), "Conf"))) ToolDefinition =3D ToolDefObj.ToolDef.ToolsDefTxtDatabase diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/build/build.py index e4969d863f6e..07187c03618a 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -67,10 +67,6 @@ from AutoGen.AutoGen import CalculatePriorityValue ## standard targets of build command gSupportedTarget =3D ['all', 'genc', 'genmake', 'modules', 'libraries', 'f= ds', 'clean', 'cleanall', 'cleanlib', 'run'] =20 -## build configuration file -gBuildConfiguration =3D "target.txt" -gToolsDefinition =3D "tools_def.txt" - TemporaryTablePattern =3D re.compile(r'^_\d+_\d+_[a-fA-F0-9]+$') TmpTableDict =3D {} =20 --=20 2.17.1 -=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 (#81024): https://edk2.groups.io/g/devel/message/81024 Mute This Topic: https://groups.io/mt/85809775/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-