From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.51104.1583733251568271518 for ; Sun, 08 Mar 2020 22:54:11 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: bob.c.feng@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 orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2020 22:54:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,532,1574150400"; d="scan'208";a="235566894" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga008.jf.intel.com with ESMTP; 08 Mar 2020 22:54:10 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 8 Mar 2020 22:54:10 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX606.ccr.corp.intel.com (10.109.6.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 9 Mar 2020 13:54:08 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Mon, 9 Mar 2020 13:54:07 +0800 From: "Bob Feng" To: "Fan, ZhijuX" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH V2] BaseTools:GuidedSectionTools.txt is not generated correctly Thread-Topic: [PATCH V2] BaseTools:GuidedSectionTools.txt is not generated correctly Thread-Index: AQHV83iQWYt9ww4Qw0CBXPmXaf8FEqg/xqPw Date: Mon, 9 Mar 2020 05:54:07 +0000 Message-ID: References: <20200306053126.21376-1-zhijux.fan@intel.com> In-Reply-To: <20200306053126.21376-1-zhijux.fan@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Zhiju, + BaseName, Ext =3D os.path.splitext(foundPath) + if os.path.isdir(foundPath) or Ext: Did you check the tool behavior under Linux? The file under Linux can have = no extension file name. Thanks, Bob -----Original Message----- From: Fan, ZhijuX=20 Sent: Friday, March 6, 2020 1:31 PM To: devel@edk2.groups.io Cc: Fan, ZhijuX ; Gao, Liming ;= Feng, Bob C Subject: [PATCH V2] BaseTools:GuidedSectionTools.txt is not generated corre= ctly REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2538 For LzmaCompress or BrotliCompress, the platform may use the different opti= ons 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 =3D LzmaCompressPlatform This override tool will be used. But, its name is not specified in the gene= rated 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 +=3D " " + self._BuildOptionWithToolDef(= RetVal)[Tool][Attr] else: Value =3D self._BuildOptionWithToolDef(RetVal)= [Tool][Attr] - + Def =3D '_'.join([self.BuildTarget, self.ToolC= hain, self.Arch, Tool, Attr]) + if self.Workspace.ToolDef.ToolsDefTxtDictionar= y.get(Def): + =20 + self.Workspace.ToolDef.ToolsDefTxtDictionary[Def] =3D Value if Attr =3D=3D "PATH": # Don't put MAKE definition in the file if Tool !=3D "MAKE": diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/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 =3D os.path.join(dirInPath, tool) - if os.path.exists(foundPath): + BaseName, Ext =3D os.path.splitext(foundPath) + if os.path.isdir(foundPath) or Ext: return os.path.realpath(foundPath) =20 # If the tool was not found in the path then we just return -- 2.14.1.windows.1