From nobody Sat May 4 10:58:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+72224+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72224+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1614319674; cv=none; d=zohomail.com; s=zohoarc; b=lTVHzsddUsLUJ9yXf/MB6sJZFHmqrScWrSfNuUSbVTqd6+Vr2Ou0uYpD92kAPLz53YYDfVSeaH0kV3THJNqF0YM+UXqpODo2s73YHkHdRRvsdp+m0hIHL8sylyTuMvnFXU1IxIRDqHK5C3sO40L5kLGtbD9rP/kwkTuSqQSVYL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614319674; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=BFn7s4NI5+RNCvsKgVojz1AFkxPEJc7bl38CdcZl5nU=; b=is9p7ZK1xQwMm+qEKPS7Ki9aHIMpdDInUVyiEC/E8EMc/IicJnukQBUAbiRnnDQoFg3sO5Gz4VULSFon3XlEy3qHiHxzH1RIS9tQUgE5miNcJdScALMumVoXeiu/8C8GGxoglMdYg05dx+d3LViLnlvxJZcSoS33y4i/Tsw86bk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+72224+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1614319674213437.54433813826984; Thu, 25 Feb 2021 22:07:54 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id TL5JYY1788612xzVYC8eN3gR; Thu, 25 Feb 2021 22:07:53 -0800 X-Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.5759.1614319673291763167 for ; Thu, 25 Feb 2021 22:07:53 -0800 IronPort-SDR: ICl3gI5Q/uuwihkuELFYkWPj+ZYifuSMbBh7f2Rw41ilrR0vDkutieQQuUCKCQMC4VAiSZZ7Y5 DKBroZDlFQ9w== X-IronPort-AV: E=McAfee;i="6000,8403,9906"; a="185840953" X-IronPort-AV: E=Sophos;i="5.81,207,1610438400"; d="scan'208";a="185840953" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2021 22:07:52 -0800 IronPort-SDR: Nvqkyv4dnaXYwekEjZ/+HGd3XUazvwq5O83tgsbdtIqEt0s+sOOPRkk7v0zEXSWJKV+XKN1UTA A7LmsyU/+VKw== X-IronPort-AV: E=Sophos;i="5.81,207,1610438400"; d="scan'208";a="404767690" X-Received: from jshi19-mobl1.ccr.corp.intel.com ([10.254.214.27]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2021 22:07:51 -0800 From: "Steven Shi" To: devel@edk2.groups.io Cc: Steven Shi , Bob Feng , Liming Gao Subject: [edk2-devel] [PATCH] BaseTools: Fix build failure of "modules" option Date: Fri, 26 Feb 2021 14:07:18 +0800 Message-Id: <20210226060718.378-1-steven.shi@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,steven.shi@intel.com X-Gm-Message-State: S1chcK4JcljhmLIAEx9HWqhxx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1614319673; bh=Lei9X2XophlXge5zSkh30gO6m+N00llW2YVCzOh/Akk=; h=Cc:Date:From:Reply-To:Subject:To; b=HjfeYOD7bb3x2G00wGo0AEC83bDG3iuAYkgaczWzUqtySrTsRiu8Hwf2GFZ6K8KGcmM LIO6c5DO1yHmGLTRO/qRO+uNOsxgs7CqoxVOKq+YeqriLZfTSSYSBQM1p8q47aAch/X3f eU8PIWKflpX6j2Uyv+btT142w2Ej0j5aWgU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3238 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. Signed-off-by: Steven Shi Cc: Bob Feng Cc: Liming Gao Reviewed-by: Bob Feng --- BaseTools/Source/Python/build/build.py | 45 +++++++------------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/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, Ob= j.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 in m= ulti-thread build mode @@ -868,14 +868,14 @@ class Build(): # CanSkipbyPreMakeCache and CreateCodeFile/CreateMakeF= ile. RetVal =3D PcdMa.SourceFileList # Force cache miss for PCD driver - if GlobalData.gUseHashCache and not GlobalData.gBinCac= heDest and self.Target in [None, "", "all"]: + if GlobalData.gUseHashCache and not GlobalData.gBinCac= heDest and self.Target in [None, "", "all", "modules"]: cqueue.put((PcdMa.MetaFile.Path, PcdMa.Arch, "PreM= akeCache", 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, "Make= Cache", 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 {"LibraryBuildDirecto= ryList":AutoGenObject.LibraryBuildDirectoryList} AutoGenObject.DataPipe.DataContainer =3D {"ModuleBuildDirector= yList":AutoGenObject.ModuleBuildDirectoryList} AutoGenObject.DataPipe.DataContainer =3D {"FdsCommandDict": Au= toGenObject.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, "Globa= lVar_%s_%s.bin" % (str(AutoGenObject.Guid),AutoGenObject.Arch)) AutoGenObject.DataPipe.dump(data_pipe_file) @@ -1285,33 +1289,6 @@ class Build(): LaunchCommand(NewBuildCommand, AutoGenObject.MakeFileDir,L= ibAutoGen) 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, L= ib.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,L= ibAutoGen) - - DirList =3D [] - for ModuleAutoGen in AutoGenObject.ModuleAutoGenList: - if not ModuleAutoGen.IsBinaryModule: - DirList.append((os.path.join(AutoGenObject.BuildDir, M= oduleAutoGen.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,M= odAutoGen) - self.CreateAsBuiltInf() - if GlobalData.gBinCacheDest: - self.GenDestCache() - elif GlobalData.gUseHashCache and not GlobalData.gBinCacheSour= ce: - # 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.Tar= get in [None, "", "all"]: + if GlobalData.gBinCacheSource and self.Tar= get 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", "modul= es"]: self.SpawnMode =3D False self._BuildPlatform() else: --=20 2.28.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#72224): https://edk2.groups.io/g/devel/message/72224 Mute This Topic: https://groups.io/mt/80921642/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-