Shi, Steven 94459080c1 BaseTools: Improve the file saving and copying reliability
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2079

The Basetool CopyFileOnChange() and SaveFileOnChange()
functions might raise the IOError occasionally when build
in Windows with multi-process and build cache enabled.
The CopyFileOnChange() and SaveFileOnChange() might be invoked
in multiple sub-processes simultaneously, and this patch adds
global locks to sync these functions invoking which can
harden their reliability.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2019-08-20 14:06:07 +08:00

30 lines
1.0 KiB
Python
Executable File

## @file
# Build cache intermediate result and state
#
# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
# 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.CacheCrash = False
self.PreMakeCacheHit = False
self.MakeCacheHit = False