From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: bob.c.feng@intel.com) Received: from mga14.intel.com (mga14.intel.com []) by groups.io with SMTP; Fri, 06 Sep 2019 06:23:09 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Sep 2019 06:23:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,473,1559545200"; d="scan'208";a="174279588" Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga007.jf.intel.com with ESMTP; 06 Sep 2019 06:23:08 -0700 From: "Bob Feng" To: devel@edk2.groups.io Cc: Liming Gao , Steven Shi , Bob Feng Subject: [Patch 3/3] BaseTools: Fixed the bug of multi-thread genffs for override inf Date: Fri, 6 Sep 2019 21:22:59 +0800 Message-Id: <20190906132259.29500-4-bob.c.feng@intel.com> X-Mailer: git-send-email 2.20.1.windows.1 In-Reply-To: <20190906132259.29500-1-bob.c.feng@intel.com> References: <20190906132259.29500-1-bob.c.feng@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Steven Shi Signed-off-by: Bob Feng --- 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