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.31, mailfrom: steven.shi@intel.com) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by groups.io with SMTP; Tue, 28 May 2019 18:47:10 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 18:47:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,525,1549958400"; d="scan'208";a="179412309" Received: from jshi19-mobl.ccr.corp.intel.com ([10.254.213.200]) by fmsmga002.fm.intel.com with ESMTP; 28 May 2019 18:47:06 -0700 From: "Steven Shi" To: devel@edk2.groups.io Cc: liming.gao@intel.com, bob.c.feng@intel.com, christian.rodriguez@intel.com, zhijux.fan@intel.com Subject: [PATCH v2] BaseTools:Extend the binary cache to support library cache Date: Wed, 29 May 2019 09:46:54 +0800 Message-Id: <20190529014654.23276-1-steven.shi@intel.com> X-Mailer: git-send-email 2.17.1.windows.2 V2 change: Simplify the library cache implementation and remove CacheRestored flag based filter. Use the current CanSkipbyHash() filter in AddDependency() instead. V1 change: https://bugzilla.tianocore.org/show_bug.cgi?id=1797 Current binary cache doesn't support to save and restore the library module. If a driver module cache miss happen, all its dependency library modules need rebuild which is very time-consuming. This patch is to entend the binary cache to support library. Cc: Liming Gao Cc: Bob Feng Cc: Christian Rodriguez Signed-off-by: Steven Shi --- BaseTools/Source/Python/AutoGen/AutoGen.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index a5bef4f7c6..7b35f837f5 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -3906,6 +3906,12 @@ class ModuleAutoGen(AutoGen): ModuleFile = path.join(self.OutputDir, self.Name + '.inf') if os.path.exists(ModuleFile): shutil.copy2(ModuleFile, FileDir) + else: + OutputDir = self.OutputDir.replace('\\', '/').strip('/') + DebugDir = self.DebugDir.replace('\\', '/').strip('/') + for Item in self.CodaTargetList: + File = Item.Target.Path.replace('\\', '/').strip('/').replace(DebugDir, '').replace(OutputDir, '').strip('/') + self.OutputFile.add(File) if not self.OutputFile: Ma = self.BuildDatabase[self.MetaFile, self.Arch, self.BuildTarget, self.ToolChain] self.OutputFile = Ma.Binaries -- 2.17.1.windows.2