Re: [edk2] [Patch 1/3 V2] BaseTools: Remove unused logic for EDKI
Reviewed-by: Liming Gao >-Original Message- >From: Feng, Bob C >Sent: Wednesday, January 09, 2019 3:15 PM >To: edk2-devel@lists.01.org >Cc: Feng, Bob C ; Gao, Liming >; Carsey, Jaben >Subject: [Patch 1/3 V2] BaseTools: Remove unused logic for EDKI > >From: "Feng, Bob C" > >BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350 >Remove EDK module type support from BaseTools python code. > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Bob Feng >Cc: Liming Gao >Cc: Jaben Carsey >--- > BaseTools/Source/Python/AutoGen/AutoGen.py| 93 ++--- > BaseTools/Source/Python/AutoGen/GenC.py | 90 - > BaseTools/Source/Python/AutoGen/GenMake.py| 18 +- > BaseTools/Source/Python/Common/DataType.py| 2 - > BaseTools/Source/Python/Common/GlobalData.py | 6 - > .../Source/Python/Workspace/DecBuildData.py | 1 - > .../Source/Python/Workspace/DscBuildData.py | 3 - > .../Source/Python/Workspace/InfBuildData.py | 191 +- > .../Source/Python/Workspace/MetaFileParser.py | 22 -- > .../Python/Workspace/WorkspaceCommon.py | 29 +-- > BaseTools/Source/Python/build/BuildReport.py | 54 ++--- > BaseTools/Source/Python/build/build.py| 65 -- > edksetup.bat | 3 - > 13 files changed, 116 insertions(+), 461 deletions(-) > >diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py >b/BaseTools/Source/Python/AutoGen/AutoGen.py >index d646cd50ce..d3d0d96e71 100644 >--- a/BaseTools/Source/Python/AutoGen/AutoGen.py >+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py >@@ -2174,46 +2174,11 @@ class PlatformAutoGen(AutoGen): > Pcd.MaxDatumSize = str(len(Value.split(','))) > else: > Pcd.MaxDatumSize = str(len(Value) - 1) > return Pcds.values() > >-## Resolve library names to library modules >-# >-# (for Edk.x modules) >-# >-# @param Module The module from which the library names will be >resolved >-# >-# @retval library_listThe list of library modules >-# >-def ResolveLibraryReference(self, Module): >-EdkLogger.verbose("") >-EdkLogger.verbose("Library instances of module [%s] [%s]:" % >(str(Module), self.Arch)) >-LibraryConsumerList = [Module] >- >-# "CompilerStub" is a must for Edk modules >-if Module.Libraries: >-Module.Libraries.append("CompilerStub") >-LibraryList = [] >-while len(LibraryConsumerList) > 0: >-M = LibraryConsumerList.pop() >-for LibraryName in M.Libraries: >-Library = self.Platform.LibraryClasses[LibraryName, ':dummy:'] >-if Library is None: >-for Key in self.Platform.LibraryClasses.data: >-if LibraryName.upper() == Key.upper(): >-Library = self.Platform.LibraryClasses[Key, >':dummy:'] >-break >-if Library is None: >-EdkLogger.warn("build", "Library [%s] is not found" % >LibraryName, File=str(M), >-ExtraData="\t%s [%s]" % (str(Module), self.Arch)) >-continue > >-if Library not in LibraryList: >-LibraryList.append(Library) >-LibraryConsumerList.append(Library) >-EdkLogger.verbose("\t" + LibraryName + " : " + >str(Library) + ' ' + >str(type(Library))) >-return LibraryList > > ## Calculate the priority value of the build option > # > # @paramKeyBuild option definition contain: >TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE > # >@@ -2377,16 +2342,12 @@ class PlatformAutoGen(AutoGen): > # > # @retval options The options appended with build options in > platform > # > def ApplyBuildOption(self, Module): > # Get the different options for the different style module >-if Module.AutoGenVersion < 0x00010005: >-PlatformOptions = self.EdkBuildOption >-ModuleTypeOptions = >self.Platform.GetBuildOptionsByModuleType(EDK_NAME, >Module.ModuleType) >-else: >-PlatformOptions = self.EdkIIBuildOption >-ModuleTypeOptions = >self.Platform.GetBuildOptionsByModuleType(EDKII_NAME, >Module.ModuleType) >+PlatformOptions = self.EdkIIBuildOption >+ModuleTypeOptions = >self.Platform.GetBuildOptionsByModuleType(EDKII_NAME, >Module.ModuleType) > ModuleTypeOptions = self._ExpandBuildOption(ModuleTypeOptions) > ModuleOptions = self._ExpandBuildOption(Module.BuildOptions) > if Module in self.Platform.Modules: > PlatformModule = self.Platform.Modules[str(Module)] > PlatformModuleOptions = >self._ExpandBuildOption(PlatformModule.BuildOptions) >@@ -2422,15 +2383,10 @@ class PlatformAutoGen(AutoGen): > if Attr != 'PAT
Re: [edk2] [Patch 1/3 V2] BaseTools: Remove unused logic for EDKI
Reviewed-by: Jaben Carsey > -Original Message- > From: Feng, Bob C > Sent: Tuesday, January 08, 2019 11:15 PM > To: edk2-devel@lists.01.org > Cc: Feng, Bob C ; Gao, Liming > ; Carsey, Jaben > Subject: [Patch 1/3 V2] BaseTools: Remove unused logic for EDKI > Importance: High > > From: "Feng, Bob C" > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350 > Remove EDK module type support from BaseTools python code. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Bob Feng > Cc: Liming Gao > Cc: Jaben Carsey > --- > BaseTools/Source/Python/AutoGen/AutoGen.py| 93 ++--- > BaseTools/Source/Python/AutoGen/GenC.py | 90 - > BaseTools/Source/Python/AutoGen/GenMake.py| 18 +- > BaseTools/Source/Python/Common/DataType.py| 2 - > BaseTools/Source/Python/Common/GlobalData.py | 6 - > .../Source/Python/Workspace/DecBuildData.py | 1 - > .../Source/Python/Workspace/DscBuildData.py | 3 - > .../Source/Python/Workspace/InfBuildData.py | 191 +- > .../Source/Python/Workspace/MetaFileParser.py | 22 -- > .../Python/Workspace/WorkspaceCommon.py | 29 +-- > BaseTools/Source/Python/build/BuildReport.py | 54 ++--- > BaseTools/Source/Python/build/build.py| 65 -- > edksetup.bat | 3 - > 13 files changed, 116 insertions(+), 461 deletions(-) > > diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py > b/BaseTools/Source/Python/AutoGen/AutoGen.py > index d646cd50ce..d3d0d96e71 100644 > --- a/BaseTools/Source/Python/AutoGen/AutoGen.py > +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py > @@ -2174,46 +2174,11 @@ class PlatformAutoGen(AutoGen): > Pcd.MaxDatumSize = str(len(Value.split(','))) > else: > Pcd.MaxDatumSize = str(len(Value) - 1) > return Pcds.values() > > -## Resolve library names to library modules > -# > -# (for Edk.x modules) > -# > -# @param Module The module from which the library names will be > resolved > -# > -# @retval library_listThe list of library modules > -# > -def ResolveLibraryReference(self, Module): > -EdkLogger.verbose("") > -EdkLogger.verbose("Library instances of module [%s] [%s]:" % > (str(Module), self.Arch)) > -LibraryConsumerList = [Module] > - > -# "CompilerStub" is a must for Edk modules > -if Module.Libraries: > -Module.Libraries.append("CompilerStub") > -LibraryList = [] > -while len(LibraryConsumerList) > 0: > -M = LibraryConsumerList.pop() > -for LibraryName in M.Libraries: > -Library = self.Platform.LibraryClasses[LibraryName, > ':dummy:'] > -if Library is None: > -for Key in self.Platform.LibraryClasses.data: > -if LibraryName.upper() == Key.upper(): > -Library = self.Platform.LibraryClasses[Key, > ':dummy:'] > -break > -if Library is None: > -EdkLogger.warn("build", "Library [%s] is not found" % > LibraryName, File=str(M), > -ExtraData="\t%s [%s]" % (str(Module), self.Arch)) > -continue > > -if Library not in LibraryList: > -LibraryList.append(Library) > -LibraryConsumerList.append(Library) > -EdkLogger.verbose("\t" + LibraryName + " : " + > str(Library) + ' ' + > str(type(Library))) > -return LibraryList > > ## Calculate the priority value of the build option > # > # @paramKeyBuild option definition contain: > TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE > # > @@ -2377,16 +2342,12 @@ class PlatformAutoGen(AutoGen): > # > # @retval options The options appended with build options in > platform > # > def ApplyBuildOption(self, Module): > # Get the different options for the different style module > -if Module.AutoGenVersion < 0x00010005: > -PlatformOptions = self.EdkBuildOption > -ModuleTypeOptions = > self.Platform.GetBuildOptionsByModuleType(EDK_NAME, > Module.ModuleType) > -else: > -PlatformOptions = self.EdkIIBuildOption > -ModuleTypeOptions = > self.Platform.GetBuildOptionsByModuleType(EDKII_NAME, > Module.ModuleType) > +PlatformOptions = self.EdkIIBuildOption > +ModuleTypeOptions = > self.Platform.GetBuildOptionsByModuleType(EDKII_NAME, > Module.ModuleType) > ModuleTypeOptions = self._ExpandBuildOption(ModuleTypeOptions) > ModuleOptions = self._ExpandBuildOption(Module.BuildOptions) > if Module in self.Platform.Modules: > PlatformModule = self.Platform.Modules[str(Module)] > PlatformModuleOptions = > self._Expa