BaseTools:Fix GenFds issue for BuildOption replace GenFdsOption
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2455 BuildOption is used by TargetTxtClassObj.py GenFdsOption is used by GenFds.py When the GenFds tool is used alone (e.g. python3 -m GenFds.GenFds -h) With the OptionParser function, the first detected function prints the help message import TargetTxtClassObj to GenFds, The BuildOption will be executed and replace GenFdsOption We removed all objects associated with this problem that were created directly during the import process (e.g. BuildOption, BuildTarget = MyOptionParser(), TargetTxt = TargetTxtDict()) The Patch is going to fix this issue Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
072b9c2839
commit
4465cd124f
@ -23,9 +23,9 @@ from Common.BuildToolError import COMMAND_FAILURE,GENFDS_ERROR
|
||||
from Common import EdkLogger
|
||||
from Common.Misc import SaveFileOnChange
|
||||
|
||||
from Common.TargetTxtClassObject import TargetTxt
|
||||
from Common.ToolDefClassObject import ToolDef
|
||||
from AutoGen.BuildEngine import BuildRuleObj
|
||||
from Common.TargetTxtClassObject import TargetTxtDict
|
||||
from Common.ToolDefClassObject import ToolDefDict
|
||||
from AutoGen.BuildEngine import ToolBuildRule
|
||||
import Common.DataType as DataType
|
||||
from Common.Misc import PathClass
|
||||
from Common.LongFilePathSupport import OpenLongFilePath as open
|
||||
@ -96,12 +96,15 @@ class GenFdsGlobalVariable:
|
||||
def _LoadBuildRule():
|
||||
if GenFdsGlobalVariable.__BuildRuleDatabase:
|
||||
return GenFdsGlobalVariable.__BuildRuleDatabase
|
||||
GenFdsGlobalVariable.__BuildRuleDatabase = BuildRuleObj
|
||||
ToolDefinitionFile = TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
|
||||
BuildRule = ToolBuildRule()
|
||||
GenFdsGlobalVariable.__BuildRuleDatabase = BuildRule.ToolBuildRule
|
||||
TargetObj = TargetTxtDict()
|
||||
ToolDefinitionFile = TargetObj.Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF]
|
||||
if ToolDefinitionFile == '':
|
||||
ToolDefinitionFile = "Conf/tools_def.txt"
|
||||
if os.path.isfile(ToolDefinitionFile):
|
||||
ToolDefinition = ToolDef.ToolsDefTxtDatabase
|
||||
ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
|
||||
ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase
|
||||
if DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY in ToolDefinition \
|
||||
and GenFdsGlobalVariable.ToolChainTag in ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY] \
|
||||
and ToolDefinition[DataType.TAB_TOD_DEFINES_BUILDRULEFAMILY][GenFdsGlobalVariable.ToolChainTag]:
|
||||
@ -830,6 +833,8 @@ class GenFdsGlobalVariable:
|
||||
# @param NameGuid The Guid name
|
||||
#
|
||||
def FindExtendTool(KeyStringList, CurrentArchList, NameGuid):
|
||||
ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf")))
|
||||
ToolDef = ToolDefObj.ToolDef
|
||||
ToolDb = ToolDef.ToolsDefTxtDatabase
|
||||
# if user not specify filter, try to deduce it from global data.
|
||||
if KeyStringList is None or KeyStringList == []:
|
||||
|
Reference in New Issue
Block a user