From 4465cd124fbcf5490faad6a1a834299b30b5d009 Mon Sep 17 00:00:00 2001 From: "Fan, ZhijuX" Date: Fri, 10 Jan 2020 16:29:45 +0800 Subject: 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 Cc: Liming Gao Cc: Bob Feng Reviewed-by: Bob Feng --- BaseTools/Source/Python/Workspace/DscBuildData.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'BaseTools/Source/Python/Workspace/DscBuildData.py') diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 03a15bbf3e..c65a0dd346 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 TargetTxt -from Common.ToolDefClassObject import ToolDef +from Common.TargetTxtClassObject import TargetTxtDict +from Common.ToolDefClassObject import ToolDefDict from .MetaDataTable import * from .MetaFileTable import * from .MetaFileParser import * @@ -3296,6 +3296,8 @@ class DscBuildData(PlatformBuildClassObject): @property def ToolChainFamily(self): self._ToolChainFamily = TAB_COMPILER_MSFT + TargetObj = TargetTxtDict() + TargetTxt = TargetObj.Target BuildConfigurationFile = os.path.normpath(os.path.join(GlobalData.gConfDirectory, "target.txt")) if os.path.isfile(BuildConfigurationFile) == True: ToolDefinitionFile = TargetTxt.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF] @@ -3303,7 +3305,8 @@ class DscBuildData(PlatformBuildClassObject): ToolDefinitionFile = "tools_def.txt" ToolDefinitionFile = os.path.normpath(mws.join(self.WorkspaceDir, 'Conf', ToolDefinitionFile)) if os.path.isfile(ToolDefinitionFile) == True: - ToolDefinition = ToolDef.ToolsDefTxtDatabase + ToolDefObj = ToolDefDict((os.path.join(os.getenv("WORKSPACE"), "Conf"))) + ToolDefinition = ToolDefObj.ToolDef.ToolsDefTxtDatabase if TAB_TOD_DEFINES_FAMILY not in ToolDefinition \ or self._Toolchain not in ToolDefinition[TAB_TOD_DEFINES_FAMILY] \ or not ToolDefinition[TAB_TOD_DEFINES_FAMILY][self._Toolchain]: -- cgit v1.2.3