From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.7274.1583472710064365907 for ; Thu, 05 Mar 2020 21:31:50 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: zhijux.fan@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2020 21:31:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,520,1574150400"; d="scan'208";a="234687605" Received: from zhijufax-mobl.ccr.corp.intel.com ([10.238.4.120]) by orsmga008.jf.intel.com with ESMTP; 05 Mar 2020 21:31:47 -0800 From: "Fan, ZhijuX" To: devel@edk2.groups.io Cc: "Zhiju . Fan" , Liming Gao , Bob Feng Subject: [PATCH V2] BaseTools:GuidedSectionTools.txt is not generated correctly Date: Fri, 6 Mar 2020 13:31:26 +0800 Message-Id: <20200306053126.21376-1-zhijux.fan@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2538 For LzmaCompress or BrotliCompress, the platform may use the different options and add their batch file, such as LzmaCompressPlatform. Then, specify it in platform.dsc [BuildOptions] to override the default one in tools_def.txt. *_*_*_LZMA_PATH = LzmaCompressPlatform This override tool will be used. But, its name is not specified in the generated GuidedSectionTools.txt. Signed-off-by: Zhiju.Fan Cc: Liming Gao Cc: Bob Feng --- Changed an issue with an incorrect full path in GuidedSectionTools BaseTools/Source/Python/AutoGen/PlatformAutoGen.py | 4 +++- BaseTools/Source/Python/build/build.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py index d32178b00c93..478a5116fd7a 100644 --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py @@ -866,7 +866,9 @@ class PlatformAutoGen(AutoGen): Value += " " + self._BuildOptionWithToolDef(RetVal)[Tool][Attr] else: Value = self._BuildOptionWithToolDef(RetVal)[Tool][Attr] - + Def = '_'.join([self.BuildTarget, self.ToolChain, self.Arch, Tool, Attr]) + if self.Workspace.ToolDef.ToolsDefTxtDictionary.get(Def): + self.Workspace.ToolDef.ToolsDefTxtDictionary[Def] = Value if Attr == "PATH": # Don't put MAKE definition in the file if Tool != "MAKE": diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index d841fefdc502..01c4c6fe2b84 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -2367,7 +2367,8 @@ class Build(): # PATH environment variable. for dirInPath in os.environ['PATH'].split(os.pathsep): foundPath = os.path.join(dirInPath, tool) - if os.path.exists(foundPath): + BaseName, Ext = os.path.splitext(foundPath) + if os.path.isdir(foundPath) or Ext: return os.path.realpath(foundPath) # If the tool was not found in the path then we just return -- 2.14.1.windows.1