From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web12.30140.1615166278334288189 for ; Sun, 07 Mar 2021 17:18:00 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Mon, 08 Mar 2021 09:17:51 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , Cc: "'Bob Feng'" References: <20210226060718.378-1-steven.shi@intel.com> In-Reply-To: <20210226060718.378-1-steven.shi@intel.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIXSBCYXNlVG9vbHM6IEZpeCBidWlsZCBmYWlsdXJlIG9mICJtb2R1bGVzIiBvcHRpb24=?= Date: Mon, 8 Mar 2021 09:17:53 +0800 Message-ID: <006301d713b8$dd3b7310$97b25930$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIvqDqu18h8YQ6Xt0KbyXkcG+YjhKnIIPAw Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Steven: With this fix, I find modules, libraries targets both work. Do you verif= y other build targets? Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4=FA= =B1=ED Steven Shi > =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA2=D4=C226=C8=D5 14:07 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Steven Shi ; Bob Feng ; > Liming Gao > =D6=F7=CC=E2: [edk2-devel] [PATCH] BaseTools: Fix build failure of "modu= les" option >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3238 >=20 > The "modules" option in build command is to build all modules > only but not to generate the final FV image. The option doesn't > work now and report makefile missing build failure. This patch > fix this issue. >=20 > Signed-off-by: Steven Shi > Cc: Bob Feng > Cc: Liming Gao > --- > BaseTools/Source/Python/build/build.py | 45 +++++++------------------- > 1 file changed, 11 insertions(+), 34 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/build/build.py > b/BaseTools/Source/Python/build/build.py > index c4cfe38ad9..810881c146 100755 > --- a/BaseTools/Source/Python/build/build.py > +++ b/BaseTools/Source/Python/build/build.py > @@ -368,7 +368,7 @@ class ModuleMakeUnit(BuildUnit): > def __init__(self, Obj, BuildCommand,Target): > Dependency =3D [ModuleMakeUnit(La, BuildCommand,Target) for La > in Obj.LibraryAutoGenList] > BuildUnit.__init__(self, Obj, BuildCommand, Target, Dependency, > Obj.MakeFileDir) > - if Target in [None, "", "all"]: > + if Target in [None, "", "all", "modules"]: > self.Target =3D "tbuild" >=20 > ## The smallest platform unit that can be built by nmake/make command i= n > multi-thread build mode > @@ -868,14 +868,14 @@ class Build(): > # CanSkipbyPreMakeCache and > CreateCodeFile/CreateMakeFile. > RetVal =3D PcdMa.SourceFileList > # Force cache miss for PCD driver > - if GlobalData.gUseHashCache and not > GlobalData.gBinCacheDest and self.Target in [None, "", "all"]: > + if GlobalData.gUseHashCache and not > GlobalData.gBinCacheDest and self.Target in [None, "", "all", "modules"]= : > cqueue.put((PcdMa.MetaFile.Path, > PcdMa.Arch, "PreMakeCache", False)) >=20 > PcdMa.CreateCodeFile(False) > PcdMa.CreateMakeFile(False,GenFfsList =3D > DataPipe.Get("FfsCommand").get((PcdMa.MetaFile.Path, PcdMa.Arch),[])) > PcdMa.CreateAsBuiltInf() > # Force cache miss for PCD driver > - if GlobalData.gBinCacheSource and self.Target in > [None, "", "all"]: > + if GlobalData.gBinCacheSource and self.Target in > [None, "", "all", "modules"]: > cqueue.put((PcdMa.MetaFile.Path, > PcdMa.Arch, "MakeCache", False)) >=20 > self.AutoGenMgr.join() > @@ -1212,7 +1212,7 @@ class Build(): > if FfsCommand is None: > FfsCommand =3D {} > # skip file generation for cleanxxx targets, run and fds target > - if Target not in ['clean', 'cleanlib', 'cleanall', 'run', 'fds'= ]: > + if Target not in ['cleanall', 'run', 'fds']: > # for target which must generate AutoGen code and makefile > mqueue =3D mp.Queue() > for m in AutoGenObject.GetAllModuleInfo: > @@ -1224,6 +1224,10 @@ class Build(): > AutoGenObject.DataPipe.DataContainer =3D > {"LibraryBuildDirectoryList":AutoGenObject.LibraryBuildDirectoryList} > AutoGenObject.DataPipe.DataContainer =3D > {"ModuleBuildDirectoryList":AutoGenObject.ModuleBuildDirectoryList} > AutoGenObject.DataPipe.DataContainer =3D > {"FdsCommandDict": AutoGenObject.Workspace.GenFdsCommandDict} > + # Fetch the MakeFileName. > + self.MakeFileName =3D AutoGenObject.MakeFileName > + if not self.MakeFileName: > + self.MakeFileName =3D AutoGenObject.MakeFile > self.Progress.Start("Generating makefile and code") > data_pipe_file =3D os.path.join(AutoGenObject.BuildDir, > "GlobalVar_%s_%s.bin" % (str(AutoGenObject.Guid),AutoGenObject.Arch)) > AutoGenObject.DataPipe.dump(data_pipe_file) > @@ -1285,33 +1289,6 @@ class Build(): > LaunchCommand(NewBuildCommand, > AutoGenObject.MakeFileDir,LibAutoGen) > return True >=20 > - # build module > - if Target =3D=3D 'modules': > - DirList =3D [] > - for Lib in AutoGenObject.LibraryAutoGenList: > - if not Lib.IsBinaryModule: > - > DirList.append((os.path.join(AutoGenObject.BuildDir, Lib.BuildDir),Lib)) > - for Lib, LibAutoGen in DirList: > - NewBuildCommand =3D BuildCommand + ['-f', > os.path.normpath(os.path.join(Lib, self.MakeFileName)), 'pbuild'] > - LaunchCommand(NewBuildCommand, > AutoGenObject.MakeFileDir,LibAutoGen) > - > - DirList =3D [] > - for ModuleAutoGen in AutoGenObject.ModuleAutoGenList: > - if not ModuleAutoGen.IsBinaryModule: > - > DirList.append((os.path.join(AutoGenObject.BuildDir, > ModuleAutoGen.BuildDir),ModuleAutoGen)) > - for Mod,ModAutoGen in DirList: > - NewBuildCommand =3D BuildCommand + ['-f', > os.path.normpath(os.path.join(Mod, self.MakeFileName)), 'pbuild'] > - LaunchCommand(NewBuildCommand, > AutoGenObject.MakeFileDir,ModAutoGen) > - self.CreateAsBuiltInf() > - if GlobalData.gBinCacheDest: > - self.GenDestCache() > - elif GlobalData.gUseHashCache and not > GlobalData.gBinCacheSource: > - # Only for --hash > - # Update PreMakeCacheChain files > - self.GenLocalPreMakeCache() > - self.BuildModules =3D [] > - return True > - > # cleanlib > if Target =3D=3D 'cleanlib': > for Lib in AutoGenObject.LibraryBuildDirectoryList: > @@ -1881,7 +1858,7 @@ class Build(): > Ma.Workspace =3D Wa > MaList.append(Ma) >=20 > - if GlobalData.gUseHashCache and not > GlobalData.gBinCacheDest and self.Target in [None, "", "all"]: > + if GlobalData.gUseHashCache and not > GlobalData.gBinCacheDest and self.Target in [None, "", "all", "modules"]= : > if Ma.CanSkipbyPreMakeCache(): > continue > else: > @@ -1907,7 +1884,7 @@ class Build(): > if self.Target =3D=3D "genmake": > return True >=20 > - if GlobalData.gBinCacheSource and > self.Target in [None, "", "all"]: > + if GlobalData.gBinCacheSource and > self.Target in [None, "", "all", "modules"]: > if Ma.CanSkipbyMakeCache(): > continue > else: > @@ -2423,7 +2400,7 @@ class Build(): > self.MakeCacheMiss =3D set() > self.MakeCacheHit =3D set() > if not self.ModuleFile: > - if not self.SpawnMode or self.Target not in ["", "all"]: > + if not self.SpawnMode or self.Target not in ["", "all", > "modules"]: > self.SpawnMode =3D False > self._BuildPlatform() > else: > -- > 2.28.0.windows.1 >=20 >=20 >=20 >=20 >=20