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.151, mailfrom: liming.gao@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Fri, 12 Jul 2019 02:12:43 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jul 2019 02:12:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,482,1557212400"; d="scan'208";a="189783503" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 12 Jul 2019 02:12:42 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 12 Jul 2019 02:12:42 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 12 Jul 2019 02:12:42 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.110]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.22]) with mapi id 14.03.0439.000; Fri, 12 Jul 2019 17:12:40 +0800 From: "Liming Gao" To: "devel@edk2.groups.io" , "Gao, Liming" , "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+8mAgAG5C3A= Date: Fri, 12 Jul 2019 09:12:40 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4A70E7@SHSMSX104.ccr.corp.intel.com> References: <20190711005758.38980-1-bob.c.feng@intel.com> <15B047D3656769CD.30788@groups.io> In-Reply-To: <15B047D3656769CD.30788@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZThjNWU1OWEtNzViMy00ZDBjLTlhMDgtN2Y3YTZiZDRhOTYwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiYWZZY21CRHRcLzdQOWhNWnp6SVlYZHRXc0Zic2UzY1VRU093T3hjSDA2TW9taXE3QVh0NUtld29YMDc1Sko1aHgifQ== dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action 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 Push @2d100d1d73a9f9a38f224e87c48276ba1e84d8ce > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Li= ming Gao > Sent: Thursday, July 11, 2019 2:54 PM > To: devel@edk2.groups.io; Feng, Bob C > Subject: Re: [edk2-devel] [Patch 1/1] BaseTools: Fixed the issue when To= olDefinitionFile is not generated >=20 > Reviewed-by: Liming Gao >=20 > >-----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, = Value) > > 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["= PATH"] > > 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 t= o 'MSFT'. > > @cached_property > > def ToolChainFamily(self): > > ToolDefinition =3D self.Workspace.ToolDef.ToolsDefTxtDatabase > >-- > >2.20.1.windows.1 > > > > > > >=20 >=20 >=20