From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: bob.c.feng@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by groups.io with SMTP; Fri, 16 Aug 2019 00:54:46 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Aug 2019 00:54:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,391,1559545200"; d="scan'208";a="261048293" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga001.jf.intel.com with ESMTP; 16 Aug 2019 00:54:46 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 16 Aug 2019 00:54:45 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 16 Aug 2019 00:54:45 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.112]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.204]) with mapi id 14.03.0439.000; Fri, 16 Aug 2019 15:54:43 +0800 From: "Bob Feng" To: "devel@edk2.groups.io" CC: "Gao, Liming" , "Shi, Steven" Subject: Re: [edk2-devel] [Patch 1/1] BaseTools: Fixed issue of incorrect Module Unique Name Thread-Topic: [edk2-devel] [Patch 1/1] BaseTools: Fixed issue of incorrect Module Unique Name Thread-Index: AQHVU/05NNU0uv82oUSBCUbP4GahMqb9ZoRA Date: Fri, 16 Aug 2019 07:54:43 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D161524482@SHSMSX104.ccr.corp.intel.com> References: <15BB53DAB78C65A5.28665@groups.io> In-Reply-To: <15BB53DAB78C65A5.28665@groups.io> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This patch is to fix a critical BaseTools regression bug and it need to be = merged to edk2 master for the coming stable tag. Thanks, Bob=20 -----Original Message----- From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Bob = Feng Sent: Friday, August 16, 2019 2:38 PM To: devel@edk2.groups.io Cc: Gao, Liming ; Shi, Steven = ; Feng, Bob C Subject: [edk2-devel] [Patch 1/1] BaseTools: Fixed issue of incorrect Modu= le Unique Name https://bugzilla.tianocore.org/show_bug.cgi?id=3D2088 If there are more than one override instance for a same module, the Module= Unique Name is generated incorrectly. Cc: Liming Gao Cc: Steven Shi Signed-off-by: Bob Feng --- BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 2 +- BaseTools/Source/Python/AutoGen/PlatformAutoGen.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py b/BaseTools/= Source/Python/AutoGen/ModuleAutoGen.py index 9ecf5c2dbe0c..076ce0e39c37 100644 --- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py @@ -293,11 +293,11 @@ class ModuleAutoGen(AutoGen): @property def UniqueBaseName(self): ModuleNames =3D self.DataPipe.Get("M_Name") if not ModuleNames: return self.Name - return ModuleNames.get(self.Name,self.Name) + return ModuleNames.get((self.Name,self.MetaFile),self.Name) =20 # Macros could be used in build_rule.txt (also Makefile) @cached_property def Macros(self): return OrderedDict(( diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTool= s/Source/Python/AutoGen/PlatformAutoGen.py index 4abfc6c29d1b..dd629ba2fac2 100644 --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py @@ -1364,18 +1364,19 @@ class PlatformAutoGen(AutoGen): ModuleNameDict[unique_base_name].append(Module.MetaFile) if Module.BaseName not in UniqueName: UniqueName[Module.BaseName] =3D set() UniqueName[Module.BaseName].add((self.ModuleGuid(Module),Modu= le.MetaFile)) for module_paths in ModuleNameDict.values(): - if len(module_paths) > 1 and len(set(module_paths))>1: + if len(set(module_paths))>1: samemodules =3D list(set(module_paths)) EdkLogger.error("build", FILE_DUPLICATED, 'Modules have s= ame BaseName and FILE_GUID:\n' ' %s\n %s' % (samemodules[0], samem= odules[1])) for name in UniqueName: Guid_Path =3D UniqueName[name] if len(Guid_Path) > 1: - retVal[name] =3D '%s_%s' % (name,Guid_Path.pop()[0]) + for guid,mpath in Guid_Path: + retVal[(name,mpath)] =3D '%s_%s' % (name,guid) return retVal ## Expand * in build option key # # @param Options Options to be expanded # @param ToolDef Use specified ToolDef instead of full version= . -- 2.20.1.windows.1