Reviewed-by: Liming Gao <[email protected]>

> -----Original Message-----
> From: Feng, Bob C
> Sent: Friday, August 16, 2019 3:55 PM
> To: [email protected]
> Cc: Gao, Liming <[email protected]>; Shi, Steven <[email protected]>
> Subject: RE: [edk2-devel] [Patch 1/1] BaseTools: Fixed issue of incorrect 
> Module Unique Name
> 
> 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
> 
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of Bob Feng
> Sent: Friday, August 16, 2019 2:38 PM
> To: [email protected]
> Cc: Gao, Liming <[email protected]>; Shi, Steven <[email protected]>; 
> Feng, Bob C <[email protected]>
> Subject: [edk2-devel] [Patch 1/1] BaseTools: Fixed issue of incorrect Module 
> Unique Name
> 
> https://bugzilla.tianocore.org/show_bug.cgi?id=2088
> If there are more than one override instance for a same module, the Module 
> Unique Name is generated incorrectly.
> 
> Cc: Liming Gao <[email protected]>
> Cc: Steven Shi <[email protected]>
> Signed-off-by: Bob Feng <[email protected]>
> ---
>  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 = 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)
> 
>      # 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/BaseTools/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] = set()
>              
> UniqueName[Module.BaseName].add((self.ModuleGuid(Module),Module.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 = list(set(module_paths))
>                  EdkLogger.error("build", FILE_DUPLICATED, 'Modules have same 
> BaseName and FILE_GUID:\n'
>                                      '  %s\n  %s' % (samemodules[0], 
> samemodules[1]))
>          for name in UniqueName:
>              Guid_Path = UniqueName[name]
>              if len(Guid_Path) > 1:
> -                retVal[name] = '%s_%s' % (name,Guid_Path.pop()[0])
> +                for guid,mpath in Guid_Path:
> +                    retVal[(name,mpath)] = '%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
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#45817): https://edk2.groups.io/g/devel/message/45817
Mute This Topic: https://groups.io/mt/32895879/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to