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: bob.c.feng@intel.com) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Sun, 21 Apr 2019 19:38:47 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Apr 2019 19:38:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,380,1549958400"; d="scan'208";a="144576299" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 21 Apr 2019 19:38:46 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 21 Apr 2019 19:38:45 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sun, 21 Apr 2019 19:38:45 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.164]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.92]) with mapi id 14.03.0415.000; Mon, 22 Apr 2019 10:38:43 +0800 From: "Bob Feng" To: "Rodriguez, Christian" , "devel@edk2.groups.io" CC: "Gao, Liming" , "Zhu, Yonghong" Subject: Re: [Patch V2] BaseTools: Enhance Bin Cache database to support save the cache Thread-Topic: [Patch V2] BaseTools: Enhance Bin Cache database to support save the cache Thread-Index: AQHU9fFJENpPbxprHku4cD00nQ67vKZHfQtA Date: Mon, 22 Apr 2019 02:38:42 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D1600E62BA@SHSMSX101.ccr.corp.intel.com> References: <20190418141610.2276-1-christian.rodriguez@intel.com> In-Reply-To: <20190418141610.2276-1-christian.rodriguez@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] 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: Rodriguez, Christian=20 Sent: Thursday, April 18, 2019 10:16 PM To: devel@edk2.groups.io Cc: Feng, Bob C ; Gao, Liming ;= Zhu, Yonghong Subject: [Patch V2] BaseTools: Enhance Bin Cache database to support save t= he cache BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1726 V2: Added the platform name to the path Add more level sub-directories in the database to support save the cache fo= r multiple platforms with multiple tool-chains and targets, just like edk2 = Build output. Signed-off-by: Christian Rodriguez Cc: Bob Feng Cc: Liming Gao Cc: Yonghong Zhu --- BaseTools/Source/Python/AutoGen/AutoGen.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 8648fc40ed..31721a6f9f 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -3897,18 +3897,17 @@ class ModuleAutoGen(AutoGen): self.CopyModuleToCache() =20 def CopyModuleToCache(self): - FileDir =3D path.join(GlobalData.gBinCacheDest, self.Arch, self.So= urceDir, self.MetaFile.BaseName) + FileDir =3D path.join(GlobalData.gBinCacheDest,=20 + self.PlatformInfo.Name, self.BuildTarget + "_" + self.ToolChain,=20 + self.Arch, self.SourceDir, self.MetaFile.BaseName) CreateDirectory (FileDir) HashFile =3D path.join(self.BuildDir, self.Name + '.hash') if os.path.exists(HashFile): shutil.copy2(HashFile, FileDir) - if self.IsLibrary: - return - ModuleFile =3D path.join(self.OutputDir, self.Name + '.inf') - if os.path.exists(ModuleFile): - shutil.copy2(ModuleFile, FileDir) + if not self.IsLibrary: + ModuleFile =3D path.join(self.OutputDir, self.Name + '.inf') + if os.path.exists(ModuleFile): + shutil.copy2(ModuleFile, FileDir) if not self.OutputFile: - Ma =3D self.BuildDatabase[PathClass(ModuleFile), self.Arch, se= lf.BuildTarget, self.ToolChain] + Ma =3D self.BuildDatabase[self.MetaFile, self.Arch,=20 + self.BuildTarget, self.ToolChain] self.OutputFile =3D Ma.Binaries if self.OutputFile: for File in self.OutputFile: @@ -3930,7 +3929,7 @@ class ModuleAutoGen(AutoGen): for f_ext in self.SourceFileList: if '.inc' in str(f_ext): return False - FileDir =3D path.join(GlobalData.gBinCacheSource, self.Arch, self.= SourceDir, self.MetaFile.BaseName) + FileDir =3D path.join(GlobalData.gBinCacheSource,=20 + self.PlatformInfo.Name, self.BuildTarget + "_" + self.ToolChain,=20 + self.Arch, self.SourceDir, self.MetaFile.BaseName) HashFile =3D path.join(FileDir, self.Name + '.hash') if os.path.exists(HashFile): f =3D open(HashFile, 'r') -- 2.19.1.windows.1