From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: christian.rodriguez@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Thu, 18 Apr 2019 07:16:13 -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 orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Apr 2019 07:16:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,366,1549958400"; d="scan'208";a="224639540" Received: from rodrigu3-desk.amr.corp.intel.com ([10.7.163.75]) by orsmga001.jf.intel.com with ESMTP; 18 Apr 2019 07:16:12 -0700 From: "Christian Rodriguez" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yonghong Zhu Subject: [Patch V2] BaseTools: Enhance Bin Cache database to support save the cache Date: Thu, 18 Apr 2019 07:16:10 -0700 Message-Id: <20190418141610.2276-1-christian.rodriguez@intel.com> X-Mailer: git-send-email 2.19.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1726 V2: Added the platform name to the path Add more level sub-directories in the database to support save the cache for 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() def CopyModuleToCache(self): - FileDir = path.join(GlobalData.gBinCacheDest, self.Arch, self.SourceDir, self.MetaFile.BaseName) + FileDir = path.join(GlobalData.gBinCacheDest, self.PlatformInfo.Name, self.BuildTarget + "_" + self.ToolChain, self.Arch, self.SourceDir, self.MetaFile.BaseName) CreateDirectory (FileDir) HashFile = path.join(self.BuildDir, self.Name + '.hash') if os.path.exists(HashFile): shutil.copy2(HashFile, FileDir) - if self.IsLibrary: - return - ModuleFile = path.join(self.OutputDir, self.Name + '.inf') - if os.path.exists(ModuleFile): - shutil.copy2(ModuleFile, FileDir) + if not self.IsLibrary: + ModuleFile = path.join(self.OutputDir, self.Name + '.inf') + if os.path.exists(ModuleFile): + shutil.copy2(ModuleFile, FileDir) if not self.OutputFile: - Ma = self.BuildDatabase[PathClass(ModuleFile), self.Arch, self.BuildTarget, self.ToolChain] + Ma = self.BuildDatabase[self.MetaFile, self.Arch, self.BuildTarget, self.ToolChain] self.OutputFile = 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 = path.join(GlobalData.gBinCacheSource, self.Arch, self.SourceDir, self.MetaFile.BaseName) + FileDir = path.join(GlobalData.gBinCacheSource, self.PlatformInfo.Name, self.BuildTarget + "_" + self.ToolChain, self.Arch, self.SourceDir, self.MetaFile.BaseName) HashFile = path.join(FileDir, self.Name + '.hash') if os.path.exists(HashFile): f = open(HashFile, 'r') -- 2.19.1.windows.1