From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: liming.gao@intel.com) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Wed, 10 Jul 2019 23:54:03 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2019 23:54:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,476,1557212400"; d="scan'208";a="249693917" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 10 Jul 2019 23:54:03 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 10 Jul 2019 23:54:02 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.110]) by shsmsx102.ccr.corp.intel.com ([169.254.2.3]) with mapi id 14.03.0439.000; Thu, 11 Jul 2019 14:53:59 +0800 From: "Liming Gao" To: "devel@edk2.groups.io" , "Feng, Bob C" Subject: Re: [edk2-devel] [Patch 1/1] BaseTools: Fixed the issue when ToolDefinitionFile is not generated Thread-Topic: [edk2-devel] [Patch 1/1] BaseTools: Fixed the issue when ToolDefinitionFile is not generated Thread-Index: AQHVN4O1+vxDhHE/GU+8KuokpzWRLKbE+8mA Date: Thu, 11 Jul 2019 06:53:59 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4A5C7D@SHSMSX104.ccr.corp.intel.com> References: <20190711005758.38980-1-bob.c.feng@intel.com> In-Reply-To: <20190711005758.38980-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of >Bob Feng >Sent: Thursday, July 11, 2019 8:58 AM >To: devel@edk2.groups.io >Cc: Gao, Liming ; Feng, Bob C >Subject: [edk2-devel] [Patch 1/1] BaseTools: Fixed the issue when >ToolDefinitionFile is not generated > >ToolDefinitionFile is generated by PlatformAutoGen.ToolDefinition() >Code assume ToolDefinition is always called before using >ToolDefinitionFile, but in some cases, it's not true. > >This patch is to fix this issue. > >Cc: Liming Gao >Signed-off-by: Bob Feng >--- > BaseTools/Source/Python/AutoGen/AutoGen.py | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > >diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py >b/BaseTools/Source/Python/AutoGen/AutoGen.py >index c0d0ca15867b..5cfaf2141af0 100644 >--- a/BaseTools/Source/Python/AutoGen/AutoGen.py >+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py >@@ -1910,22 +1910,25 @@ class PlatformAutoGen(AutoGen): > if Attr =3D=3D "FLAGS": > MakeFlags =3D Value > else: > ToolsDef +=3D "%s_%s =3D %s\n" % (Tool, Attr, Va= lue) > ToolsDef +=3D "\n" >- >- SaveFileOnChange(self.ToolDefinitionFile, ToolsDef, False) >+ tool_def_file =3D os.path.join(self.MakeFileDir, "TOOLS_DEF." + = self.Arch) >+ SaveFileOnChange(tool_def_file, ToolsDef, False) > for DllPath in DllPathList: > os.environ["PATH"] =3D DllPath + os.pathsep + os.environ["PA= TH"] > os.environ["MAKE_FLAGS"] =3D MakeFlags > > return RetVal > > ## Return the paths of tools > @cached_property > def ToolDefinitionFile(self): >- return os.path.join(self.MakeFileDir, "TOOLS_DEF." + self.Arch) >+ tool_def_file =3D os.path.join(self.MakeFileDir, "TOOLS_DEF." + = self.Arch) >+ if not os.path.exists(tool_def_file): >+ self.ToolDefinition >+ return tool_def_file > > ## Retrieve the toolchain family of given toolchain tag. Default to = 'MSFT'. > @cached_property > def ToolChainFamily(self): > ToolDefinition =3D self.Workspace.ToolDef.ToolsDefTxtDatabase >-- >2.20.1.windows.1 > > >