From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.33858.1585217703705554486 for ; Thu, 26 Mar 2020 03:15:03 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: bob.c.feng@intel.com) IronPort-SDR: eK+HzDlWpT0RESnEjwVY4AeBD+XQ/aec6Gj/qv5wCucZwMQIch04U26kZhxiOhgj62c/67JgZ5 PP6ItD3TyRsA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2020 03:15:03 -0700 IronPort-SDR: WxUZ6TbxIqwunaQbQsSmtqcH5B7nHuTBLD9orXR/a8le+h5GSbSWdm+yc/Lj4qMrwiDPMGf9tH RF3ntEwsYgIQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,308,1580803200"; d="scan'208";a="250737615" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga006.jf.intel.com with ESMTP; 26 Mar 2020 03:15:02 -0700 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 26 Mar 2020 03:15:02 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX602.ccr.corp.intel.com (10.109.6.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 26 Mar 2020 18:15:00 +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; Thu, 26 Mar 2020 18:15:00 +0800 From: "Bob Feng" To: "Fan, ZhijuX" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH V6] BaseTools:GuidedSectionTools.txt is not generated correctly Thread-Topic: [PATCH V6] BaseTools:GuidedSectionTools.txt is not generated correctly Thread-Index: AQHWA1QJFNadWOLEKEmVKY2tsVHqFqhaqAVQ Date: Thu, 26 Mar 2020 10:15:00 +0000 Message-ID: References: <20200326094804.21368-1-zhijux.fan@intel.com> In-Reply-To: <20200326094804.21368-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 Reviewed-by: Bob Feng -----Original Message----- From: Fan, ZhijuX=20 Sent: Thursday, March 26, 2020 5:48 PM To: devel@edk2.groups.io Cc: Fan, ZhijuX ; Gao, Liming ;= Feng, Bob C Subject: [PATCH V6] 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 --- Some unnecessary comments were removed BaseTools/Source/Python/AutoGen/PlatformAutoGen.py | 3 ++- BaseTools/Source/Python/build/build.py | 16 +++------------- 2 files changed, 5 insertions(+), 14 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 +=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]) + =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..bec848a7b2e3 100755 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -2347,7 +2347,7 @@ class Build(): toolName =3D split[3] path =3D '_'.join(split[0:4]) + '_PATH' path =3D self.ToolDef.ToolsDefTxtDictionar= y[path] - path =3D self.GetFullPathOfTool(path) + path =3D self.GetRealPathOfTool(path) guidAttribs.append((guid, toolName, path)) =20 # Write out GuidedSecTools.txt @@ -2357,21 +2357,11 @@= class Build(): print(' '.join(guidedSectionTool), file=3DtoolsFil= e) toolsFile.close() =20 - ## Returns the full path of the tool. + ## Returns the real path of the tool. # - def GetFullPathOfTool (self, tool): + def GetRealPathOfTool (self, tool): 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 =3D 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 =20 ## Launch the module or platform build -- 2.14.1.windows.1