From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.1539.1576549493741644100 for ; Mon, 16 Dec 2019 18:24:53 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Dec 2019 18:24:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,323,1571727600"; d="scan'208";a="217366383" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga006.jf.intel.com with ESMTP; 16 Dec 2019 18:24:53 -0800 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 16 Dec 2019 18:24:52 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 16 Dec 2019 18:24:52 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.90]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.164]) with mapi id 14.03.0439.000; Tue, 17 Dec 2019 10:24:50 +0800 From: "Liming Gao" To: "Feng, Bob C" , "devel@edk2.groups.io" CC: "Shi, Steven" , Ard Biesheuvel Subject: Re: [Patch 1/1] BaseTools: Fix build failure when multiple build targets given Thread-Topic: [Patch 1/1] BaseTools: Fix build failure when multiple build targets given Thread-Index: AQHVsDc4hZlMEF4+KkG//FgNfnwHXKe9oduQ Date: Tue, 17 Dec 2019 02:24:50 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E566C04@SHSMSX104.ccr.corp.intel.com> References: <20191211152506.39684-1-bob.c.feng@intel.com> In-Reply-To: <20191211152506.39684-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Feng, Bob C >Sent: Wednesday, December 11, 2019 11:25 PM >To: devel@edk2.groups.io >Cc: Gao, Liming ; Shi, Steven = ; >Ard Biesheuvel >Subject: [Patch 1/1] BaseTools: Fix build failure when multiple build targ= ets >given > >BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2371 > >This patch is to fix a regression issue that build fails >if multiple build targets given. > >Two changes cause this regression issue. >One is AutoGen object __hash__ function only >hash file path and arch, missing ToolChain and build target. > >The other is changing the multiple-thread-genfds function as default >build behavior. To generate the genffs command to Makefile, there >is a global data set is used, GenFdsGlobalVariable, which cause build >tool use the data of first build-target build in >the second build-target build. > >Cc: Liming Gao >Cc: Steven Shi >Cc: Ard Biesheuvel >Signed-off-by: Bob Feng >--- > BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 2 +- > BaseTools/Source/Python/AutoGen/PlatformAutoGen.py | 2 +- > BaseTools/Source/Python/build/build.py | 2 ++ > 3 files changed, 4 insertions(+), 2 deletions(-) > >diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py >b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py >index 74662d1b52bc..aad591de65f0 100755 >--- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py >+++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py >@@ -268,11 +268,11 @@ class ModuleAutoGen(AutoGen): > # > # @retval int Hash value of the module file path and arch > # > @cached_class_function > def __hash__(self): >- return hash((self.MetaFile, self.Arch)) >+ return hash((self.MetaFile, self.Arch, self.ToolChain,self.BuildT= arget)) > def __repr__(self): > return "%s [%s]" % (self.MetaFile, self.Arch) > > # Get FixedAtBuild Pcds of this Module > @cached_property >diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py >b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py >index 4c3cdf82d57f..7bd24dad42f8 100644 >--- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py >+++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py >@@ -146,11 +146,11 @@ class PlatformAutoGen(AutoGen): > # > # @retval int Hash value of the platform file path and arch > # > @cached_class_function > def __hash__(self): >- return hash((self.MetaFile, self.Arch)) >+ return hash((self.MetaFile, self.Arch,self.ToolChain,self.BuildTa= rget)) > @cached_class_function > def __repr__(self): > return "%s [%s]" % (self.MetaFile, self.Arch) > > ## Create autogen code for platform and modules >diff --git a/BaseTools/Source/Python/build/build.py >b/BaseTools/Source/Python/build/build.py >index 8a8e32e496f8..77b46341b5ad 100755 >--- a/BaseTools/Source/Python/build/build.py >+++ b/BaseTools/Source/Python/build/build.py >@@ -56,10 +56,11 @@ import multiprocessing as mp > from multiprocessing import Manager > from AutoGen.DataPipe import MemoryDataPipe > from AutoGen.ModuleAutoGenHelper import WorkSpaceInfo, PlatformInfo > from GenFds.FdfParser import FdfParser > from AutoGen.IncludesAutoGen import IncludesAutoGen >+from GenFds.GenFds import resetFdsGlobalVariable > > ## standard targets of build command > gSupportedTarget =3D ['all', 'genc', 'genmake', 'modules', 'libraries', '= fds', 'clean', >'cleanall', 'cleanlib', 'run'] > > ## build configuration file >@@ -2205,10 +2206,11 @@ class Build(): > SaveFileOnChange(self.PlatformBuildPath, '# DO NOT EDIT \n# FILE = auto- >generated\n', False) > for BuildTarget in self.BuildTargetList: > GlobalData.gGlobalDefines['TARGET'] =3D BuildTarget > index =3D 0 > for ToolChain in self.ToolChainList: >+ resetFdsGlobalVariable() > GlobalData.gGlobalDefines['TOOLCHAIN'] =3D ToolChain > GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] =3D ToolChain > GlobalData.gGlobalDefines['FAMILY'] =3D self.ToolChainFam= ily[index] > index +=3D 1 > ExitFlag =3D threading.Event() >-- >2.20.1.windows.1