From 0e7e7a264cd80ab71ea0f9e9da2d0617d4b539c4 Mon Sep 17 00:00:00 2001 From: "Shi, Steven" Date: Thu, 15 Aug 2019 22:26:17 +0800 Subject: BaseTools: Improve the cache hit in the edk2 build cache BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1927 Current cache hash algorithm does not parse and generate the makefile to get the accurate dependency files for a module. It instead use the platform and package meta files to get the module depenedency in a quick but over approximate way. These meta files are monolithic and involve many redundant dependency for the module, which cause the module build cache miss easily. This patch introduces one more cache checkpoint and a new hash algorithm besides the current quick one. The new hash algorithm leverages the module makefile to achieve more accurate and precise dependency info for a module. When the build cache miss with the first quick hash, the Basetool will caculate new one after makefile is generated and then check again. Cc: Liming Gao Cc: Bob Feng Signed-off-by: Steven Shi Reviewed-by: Bob Feng --- BaseTools/Source/Python/AutoGen/CacheIR.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 BaseTools/Source/Python/AutoGen/CacheIR.py (limited to 'BaseTools/Source/Python/AutoGen/CacheIR.py') diff --git a/BaseTools/Source/Python/AutoGen/CacheIR.py b/BaseTools/Source/Python/AutoGen/CacheIR.py new file mode 100755 index 0000000000..2d9ffe3f0b --- /dev/null +++ b/BaseTools/Source/Python/AutoGen/CacheIR.py @@ -0,0 +1,28 @@ +## @file +# Build cache intermediate result and state +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +class ModuleBuildCacheIR(): + def __init__(self, Path, Arch): + self.ModulePath = Path + self.ModuleArch = Arch + self.ModuleFilesHashDigest = None + self.ModuleFilesHashHexDigest = None + self.ModuleFilesChain = [] + self.PreMakefileHashHexDigest = None + self.CreateCodeFileDone = False + self.CreateMakeFileDone = False + self.MakefilePath = None + self.AutoGenFileList = None + self.DependencyHeaderFileSet = None + self.MakeHeaderFilesHashChain = None + self.MakeHeaderFilesHashDigest = None + self.MakeHeaderFilesHashChain = [] + self.MakeHashDigest = None + self.MakeHashHexDigest = None + self.MakeHashChain = [] + self.PreMakeCacheHit = False + self.MakeCacheHit = False -- cgit v1.2.3