diff options
author | Shi, Steven <steven.shi@intel.com> | 2019-08-15 22:26:20 +0800 |
---|---|---|
committer | Feng, Bob C <bob.c.feng@intel.com> | 2019-08-20 14:06:07 +0800 |
commit | d01a998612422a70366b3b6b4639d5f54de053a0 (patch) | |
tree | 2a6e4ac57c302c95700aa810ffb8ef69669624f4 | |
parent | c340c5bd1b3e59ced03bd188981d4fe98aa62cac (diff) | |
download | edk2-d01a998612422a70366b3b6b4639d5f54de053a0.tar.gz edk2-d01a998612422a70366b3b6b4639d5f54de053a0.tar.bz2 edk2-d01a998612422a70366b3b6b4639d5f54de053a0.zip |
BaseTools: Add GenFds multi-thread support in build cache
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1923
Fix the issue that the GenFds multi-thread will build fail
if enable the build cache together.
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>
-rwxr-xr-x | BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py index dd833208b0..ffa4727e59 100755 --- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py @@ -1262,11 +1262,13 @@ class ModuleAutoGen(AutoGen): fStringIO.close ()
fInputfile.close ()
return OutputName
+
@cached_property
def OutputFile(self):
retVal = set()
OutputDir = self.OutputDir.replace('\\', '/').strip('/')
DebugDir = self.DebugDir.replace('\\', '/').strip('/')
+ FfsOutputDir = self.FfsOutputDir.replace('\\', '/').rstrip('/')
for Item in self.CodaTargetList:
File = Item.Target.Path.replace('\\', '/').strip('/').replace(DebugDir, '').replace(OutputDir, '').strip('/')
retVal.add(File)
@@ -1282,6 +1284,12 @@ class ModuleAutoGen(AutoGen): if File.lower().endswith('.pdb'):
retVal.add(File)
+ for Root, Dirs, Files in os.walk(FfsOutputDir):
+ for File in Files:
+ if File.lower().endswith('.ffs') or File.lower().endswith('.offset') or File.lower().endswith('.raw') \
+ or File.lower().endswith('.raw.txt'):
+ retVal.add(File)
+
return retVal
## Create AsBuilt INF file the module
@@ -1652,13 +1660,16 @@ class ModuleAutoGen(AutoGen): for File in self.OutputFile:
File = str(File)
if not os.path.isabs(File):
- File = os.path.join(self.OutputDir, File)
+ NewFile = os.path.join(self.OutputDir, File)
+ if not os.path.exists(NewFile):
+ NewFile = os.path.join(self.FfsOutputDir, File)
+ File = NewFile
if os.path.exists(File):
- sub_dir = os.path.relpath(File, self.OutputDir)
- destination_file = os.path.join(FileDir, sub_dir)
- destination_dir = os.path.dirname(destination_file)
- CreateDirectory(destination_dir)
- CopyFileOnChange(File, destination_dir)
+ if File.lower().endswith('.ffs') or File.lower().endswith('.offset') or File.lower().endswith('.raw') \
+ or File.lower().endswith('.raw.txt'):
+ self.CacheCopyFile(FfsDir, self.FfsOutputDir, File)
+ else:
+ self.CacheCopyFile(FileDir, self.OutputDir, File)
def SaveHashChainFileToCache(self, gDict):
if not GlobalData.gBinCacheDest:
|