BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1302
If there is a inf override, and multi-thread genffs is enabled, build
will fail.

This patch is going to fix this bug.

Cc: Liming Gao <liming....@intel.com>
Cc: Steven Shi <steven....@intel.com>
Signed-off-by: Bob Feng <bob.c.f...@intel.com>
---
 BaseTools/Source/Python/AutoGen/AutoGenWorker.py  | 2 +-
 BaseTools/Source/Python/AutoGen/ModuleAutoGen.py  | 2 +-
 BaseTools/Source/Python/GenFds/FfsInfStatement.py | 5 ++++-
 BaseTools/Source/Python/build/build.py            | 8 ++++----
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py 
b/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
index 2e68538b1cb4..0d0ee319393c 100755
--- a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
@@ -239,11 +239,11 @@ class AutoGenWorkerInProcess(mp.Process):
                     Ma.GenPreMakefileHash(GlobalData.gCacheIR)
                     if Ma.CanSkipbyPreMakefileCache(GlobalData.gCacheIR):
                        continue
 
                 Ma.CreateCodeFile(False)
-                
Ma.CreateMakeFile(False,GenFfsList=FfsCmd.get((Ma.MetaFile.File, Ma.Arch),[]))
+                
Ma.CreateMakeFile(False,GenFfsList=FfsCmd.get((Ma.MetaFile.Path, Ma.Arch),[]))
 
                 if GlobalData.gBinCacheSource and CommandTarget in [None, "", 
"all"]:
                     Ma.GenMakeHeaderFilesHash(GlobalData.gCacheIR)
                     Ma.GenMakeHash(GlobalData.gCacheIR)
                     if Ma.CanSkipbyMakeCache(GlobalData.gCacheIR):
diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py 
b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
index 3bb7e91154ac..8250b93fd440 100755
--- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
@@ -2121,11 +2121,11 @@ class ModuleAutoGen(AutoGen):
                 if 
(self.MetaFile.File,self.MetaFile.Root,self.Arch,self.MetaFile.Path) in 
GlobalData.Refes:
                     self.ReferenceModules = 
GlobalData.Refes[(self.MetaFile.File,self.MetaFile.Root,self.Arch,self.MetaFile.Path)]
             self.CreateCodeFile()
         if not (self.MetaFile.Path, self.Arch) in gDict or \
            not gDict[(self.MetaFile.Path, self.Arch)].CreateMakeFileDone:
-            
self.CreateMakeFile(GenFfsList=GlobalData.FfsCmd.get((self.MetaFile.File, 
self.Arch),[]))
+            
self.CreateMakeFile(GenFfsList=GlobalData.FfsCmd.get((self.MetaFile.Path, 
self.Arch),[]))
 
         if not (self.MetaFile.Path, self.Arch) in gDict or \
            not gDict[(self.MetaFile.Path, self.Arch)].CreateCodeFileDone or \
            not gDict[(self.MetaFile.Path, self.Arch)].CreateMakeFileDone:
            EdkLogger.quiet("[cache warning]: Cannot create CodeFile or 
Makefile for module %s[%s]" %(self.MetaFile.Path, self.Arch))
diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py 
b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
index ebb93b14c4ff..43dbd0102f5e 100644
--- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py
+++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
@@ -500,11 +500,14 @@ class FfsInfStatement(FfsInfStatementClassObject):
         #
         MakefilePath = None
         if self.IsBinaryModule:
             IsMakefile = False
         if IsMakefile:
-            MakefilePath = self.InfFileName, Arch
+            PathClassObj = PathClass(self.InfFileName, 
GenFdsGlobalVariable.WorkSpaceDir)
+            if self.OverrideGuid:
+                PathClassObj = ProcessDuplicatedInf(PathClassObj, 
self.OverrideGuid, GenFdsGlobalVariable.WorkSpaceDir)
+            MakefilePath = PathClassObj.Path, Arch
         if isinstance (Rule, RuleSimpleFile.RuleSimpleFile):
             SectionOutputList = self.__GenSimpleFileSection__(Rule, 
IsMakefile=IsMakefile)
             FfsOutput = self.__GenSimpleFileFfs__(Rule, SectionOutputList, 
MakefilePath=MakefilePath)
             return FfsOutput
         #
diff --git a/BaseTools/Source/Python/build/build.py 
b/BaseTools/Source/Python/build/build.py
index 2a10f99a1e70..94318420196f 100755
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -840,11 +840,11 @@ class Build():
                         PcdMa.GenPreMakefileHash(share_data)
                         if PcdMa.CanSkipbyPreMakefileCache(share_data):
                            continue
 
                     PcdMa.CreateCodeFile(False)
-                    PcdMa.CreateMakeFile(False,GenFfsList = 
DataPipe.Get("FfsCommand").get((PcdMa.MetaFile.File, PcdMa.Arch),[]))
+                    PcdMa.CreateMakeFile(False,GenFfsList = 
DataPipe.Get("FfsCommand").get((PcdMa.MetaFile.Path, PcdMa.Arch),[]))
 
                     if GlobalData.gBinCacheSource and self.Target in [None, 
"", "all"]:
                         PcdMa.GenMakeHeaderFilesHash(share_data)
                         PcdMa.GenMakeHash(share_data)
                         if PcdMa.CanSkipbyMakeCache(share_data):
@@ -1867,13 +1867,13 @@ class Build():
                                     self.Progress.Stop("done!")
                                 if self.Target == "genc":
                                     return True
                                 if not self.SkipAutoGen or self.Target == 
'genmake':
                                     self.Progress.Start("Generating makefile")
-                                    if CmdListDict and self.Fdf and 
(Module.File, Arch) in CmdListDict:
-                                        Ma.CreateMakeFile(True, 
CmdListDict[Module.File, Arch])
-                                        del CmdListDict[Module.File, Arch]
+                                    if CmdListDict and self.Fdf and 
(Module.Path, Arch) in CmdListDict:
+                                        Ma.CreateMakeFile(True, 
CmdListDict[Module.Path, Arch])
+                                        del CmdListDict[Module.Path, Arch]
                                     else:
                                         Ma.CreateMakeFile(True)
                                     self.Progress.Stop("done!")
                                 if self.Target == "genmake":
                                     return True
-- 
2.20.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#46979): https://edk2.groups.io/g/devel/message/46979
Mute This Topic: https://groups.io/mt/33166301/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to