From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.32441.1585209441861061463 for ; Thu, 26 Mar 2020 00:57:21 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: zhijux.fan@intel.com) IronPort-SDR: oxVRoL9KqdtTDMwViWjdAWhMw53sUkq3e0sYLwn/cJfPuolYpi0YWGRvMWtTdDN95/d1tEPSen F70K/4b2aOOA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2020 00:57:21 -0700 IronPort-SDR: roUBguBoWXzmZeD/it/FoJ16V8die7Y+WAfsISZKbYf9TOWz7+t04+wVzTCnoOmASRl+BUs+7S DCwRQm9q4t/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,307,1580803200"; d="scan'208";a="420604269" Received: from zhijufax-mobl.ccr.corp.intel.com ([10.238.4.120]) by orsmga005.jf.intel.com with ESMTP; 26 Mar 2020 00:57:19 -0700 From: "Fan, ZhijuX" To: devel@edk2.groups.io Cc: "Zhiju . Fan" , Liming Gao , Bob Feng Subject: [PATCH V5] BaseTools:GuidedSectionTools.txt is not generated correctly Date: Thu, 26 Mar 2020 15:56:43 +0800 Message-Id: <20200326075643.2516-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 --- A judgment condition was removed if self.Workspace.ToolDef.ToolsDefTxtDictionary.get(Def): BaseTools/Source/Python/AutoGen/PlatformAutoGen.py | 3 ++- BaseTools/Source/Python/build/build.py | 13 +++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py index d32178b00c93..af66c48c7d6a 100644 --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py @@ -866,7 +866,8 @@ 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]) + 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..6dbe05f0a93e 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -2363,16 +2363,9 @@ class Build(): if os.path.exists(tool): return os.path.realpath(tool) else: - # We need to search for the tool using the - # PATH environment variable. - for dirInPath in os.environ['PATH'].split(os.pathsep): - foundPath = os.path.join(dirInPath, tool) - if os.path.exists(foundPath): - return os.path.realpath(foundPath) - - # If the tool was not found in the path then we just return - # the input tool. - return tool + # If the tool was not found in the path then we just return + # the input tool. + return tool ## Launch the module or platform build # -- 2.14.1.windows.1