public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Remove the logic SourceOverridePath
@ 2019-03-15 15:17 Feng, Bob C
  2019-03-19  7:24 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Feng, Bob C @ 2019-03-15 15:17 UTC (permalink / raw)
  To: edk2-devel; +Cc: Bob Feng, Liming Gao

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350
SOURCE_OVERRIDE_PATH is for EDK component INF files.
The corresponding logic should be removed.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Source/Python/AutoGen/AutoGen.py    | 13 +------------
 BaseTools/Source/Python/Common/DataType.py    |  2 --
 BaseTools/Source/Python/Common/GlobalData.py  |  1 -
 .../Python/CommonDataClass/DataClass.py       |  2 --
 .../Ecc/MetaFileWorkspace/MetaFileParser.py   |  8 --------
 BaseTools/Source/Python/Eot/EotMain.py        |  2 +-
 BaseTools/Source/Python/Eot/InfParserLite.py  |  6 +-----
 .../Source/Python/UPT/Library/DataType.py     |  3 ---
 .../Python/Workspace/BuildClassObject.py      |  1 -
 .../Source/Python/Workspace/DscBuildData.py   | 19 -------------------
 .../Source/Python/Workspace/InfBuildData.py   | 11 +----------
 .../Source/Python/Workspace/MetaFileParser.py |  8 --------
 12 files changed, 4 insertions(+), 72 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 568d535754..8c7c20a386 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1139,11 +1139,10 @@ class PlatformAutoGen(AutoGen):
         self.WorkspaceDir = Workspace.WorkspaceDir
         self.ToolChain = Toolchain
         self.BuildTarget = Target
         self.Arch = Arch
         self.SourceDir = PlatformFile.SubDir
-        self.SourceOverrideDir = None
         self.FdTargetList = self.Workspace.FdTargetList
         self.FvTargetList = self.Workspace.FvTargetList
         # get the original module/package/platform objects
         self.BuildDatabase = Workspace.BuildDatabase
         self.DscBuildDataObj = Workspace.Platform
@@ -2557,15 +2556,10 @@ class ModuleAutoGen(AutoGen):
         self.PlatformInfo = PlatformAutoGen(Workspace, PlatformFile, Target, Toolchain, Arch)
 
         self.SourceDir = self.MetaFile.SubDir
         self.SourceDir = mws.relpath(self.SourceDir, self.WorkspaceDir)
 
-        self.SourceOverrideDir = None
-        # use overridden path defined in DSC file
-        if self.MetaFile.Key in GlobalData.gOverrideDir:
-            self.SourceOverrideDir = GlobalData.gOverrideDir[self.MetaFile.Key]
-
         self.ToolChain = Toolchain
         self.BuildTarget = Target
         self.Arch = Arch
         self.ToolChainFamily = self.PlatformInfo.ToolChainFamily
         self.BuildRuleFamily = self.PlatformInfo.BuildRuleFamily
@@ -2766,16 +2760,11 @@ class ModuleAutoGen(AutoGen):
     @cached_property
     def CustomMakefile(self):
         RetVal = {}
         for Type in self.Module.CustomMakefile:
             MakeType = gMakeTypeMap[Type] if Type in gMakeTypeMap else 'nmake'
-            if self.SourceOverrideDir is not None:
-                File = os.path.join(self.SourceOverrideDir, self.Module.CustomMakefile[Type])
-                if not os.path.exists(File):
-                    File = os.path.join(self.SourceDir, self.Module.CustomMakefile[Type])
-            else:
-                File = os.path.join(self.SourceDir, self.Module.CustomMakefile[Type])
+            File = os.path.join(self.SourceDir, self.Module.CustomMakefile[Type])
             RetVal[MakeType] = File
         return RetVal
 
     ## Return the directory of the makefile
     #
diff --git a/BaseTools/Source/Python/Common/DataType.py b/BaseTools/Source/Python/Common/DataType.py
index 798c0e353d..685f428862 100644
--- a/BaseTools/Source/Python/Common/DataType.py
+++ b/BaseTools/Source/Python/Common/DataType.py
@@ -304,12 +304,10 @@ TAB_COMPONENTS_IA32 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_IA32
 TAB_COMPONENTS_X64 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_X64
 TAB_COMPONENTS_ARM = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_ARM
 TAB_COMPONENTS_EBC = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_EBC
 TAB_COMPONENTS_AARCH64 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_AARCH64
 
-TAB_COMPONENTS_SOURCE_OVERRIDE_PATH = 'SOURCE_OVERRIDE_PATH'
-
 TAB_BUILD_OPTIONS = 'BuildOptions'
 
 TAB_DEFINE = 'DEFINE'
 TAB_NMAKE = 'Nmake'
 TAB_USER_EXTENSIONS = 'UserExtensions'
diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py
index f117998b0b..79b21324de 100644
--- a/BaseTools/Source/Python/Common/GlobalData.py
+++ b/BaseTools/Source/Python/Common/GlobalData.py
@@ -27,11 +27,10 @@ gPlatformPcds = {}
 # PCDs with type that are not fixed at build and feature flag
 gPlatformOtherPcds = {}
 gActivePlatform = None
 gCommandLineDefines = {}
 gEdkGlobal = {}
-gOverrideDir = {}
 gCommandMaxLength = 4096
 # for debug trace purpose when problem occurs
 gProcessingFile = ''
 gBuildingModule = ''
 gSkuids = []
diff --git a/BaseTools/Source/Python/CommonDataClass/DataClass.py b/BaseTools/Source/Python/CommonDataClass/DataClass.py
index 2d93f79b09..5d0c664f6d 100644
--- a/BaseTools/Source/Python/CommonDataClass/DataClass.py
+++ b/BaseTools/Source/Python/CommonDataClass/DataClass.py
@@ -103,11 +103,10 @@ MODEL_META_DATA_COMPONENT = 5009
 MODEL_META_DATA_USER_EXTENSION = 5010
 MODEL_META_DATA_PACKAGE = 5011
 MODEL_META_DATA_NMAKE = 5012
 MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF = 5013
 MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF = 5014
-MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH = 5015
 MODEL_META_DATA_COMMENT = 5016
 MODEL_META_DATA_GLOBAL_DEFINE = 5017
 MODEL_META_DATA_SECTION_HEADER = 5100
 MODEL_META_DATA_SUBSECTION_HEADER = 5200
 MODEL_META_DATA_TAIL_COMMENT = 5300
@@ -175,11 +174,10 @@ MODEL_LIST = [('MODEL_UNKNOWN', MODEL_UNKNOWN),
               ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IF", MODEL_META_DATA_CONDITIONAL_STATEMENT_IF),
               ("MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE", MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE),
               ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF", MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF),
               ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF", MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF),
               ("MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR", MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR),
-              ("MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH", MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH),
               ("MODEL_META_DATA_BUILD_OPTION", MODEL_META_DATA_BUILD_OPTION),
               ("MODEL_META_DATA_COMPONENT", MODEL_META_DATA_COMPONENT),
               ('MODEL_META_DATA_USER_EXTENSION', MODEL_META_DATA_USER_EXTENSION),
               ('MODEL_META_DATA_PACKAGE', MODEL_META_DATA_PACKAGE),
               ('MODEL_META_DATA_NMAKE', MODEL_META_DATA_NMAKE),
diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
index 862974894a..8ff95ca3bb 100644
--- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
@@ -737,11 +737,10 @@ class DscParser(MetaFileParser):
         TAB_PCDS_DYNAMIC_VPD_NULL.upper()           :   MODEL_PCD_DYNAMIC_VPD,
         TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL.upper()    :   MODEL_PCD_DYNAMIC_EX_DEFAULT,
         TAB_PCDS_DYNAMIC_EX_HII_NULL.upper()        :   MODEL_PCD_DYNAMIC_EX_HII,
         TAB_PCDS_DYNAMIC_EX_VPD_NULL.upper()        :   MODEL_PCD_DYNAMIC_EX_VPD,
         TAB_COMPONENTS.upper()                      :   MODEL_META_DATA_COMPONENT,
-        TAB_COMPONENTS_SOURCE_OVERRIDE_PATH.upper() :   MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH,
         TAB_DSC_DEFINES.upper()                     :   MODEL_META_DATA_HEADER,
         TAB_DSC_DEFINES_DEFINE                      :   MODEL_META_DATA_DEFINE,
         TAB_DSC_DEFINES_EDKGLOBAL                   :   MODEL_META_DATA_GLOBAL_DEFINE,
         TAB_INCLUDE.upper()                         :   MODEL_META_DATA_INCLUDE,
         TAB_IF.upper()                              :   MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
@@ -1070,12 +1069,10 @@ class DscParser(MetaFileParser):
                             ExtraData=self._CurrentLine + " (<LibraryClassName>|<LibraryInstancePath>)",
                             File=self.MetaFile, Line=self._LineIndex+1)
 
         self._ValueList[0:len(TokenList)] = TokenList
 
-    def _CompponentSourceOverridePathParser(self):
-        self._ValueList[0] = self._CurrentLine
 
     ## [BuildOptions] section parser
     @ParseMacro
     def _BuildOptionParser(self):
         TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
@@ -1136,11 +1133,10 @@ class DscParser(MetaFileParser):
             MODEL_PCD_DYNAMIC_VPD                           :   self.__ProcessPcd,
             MODEL_PCD_DYNAMIC_EX_DEFAULT                    :   self.__ProcessPcd,
             MODEL_PCD_DYNAMIC_EX_HII                        :   self.__ProcessPcd,
             MODEL_PCD_DYNAMIC_EX_VPD                        :   self.__ProcessPcd,
             MODEL_META_DATA_COMPONENT                       :   self.__ProcessComponent,
-            MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH  :   self.__ProcessSourceOverridePath,
             MODEL_META_DATA_BUILD_OPTION                    :   self.__ProcessBuildOption,
             MODEL_UNKNOWN                                   :   self._Skip,
             MODEL_META_DATA_USER_EXTENSION                  :   self._Skip,
             MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR     :   self._Skip,
         }
@@ -1435,13 +1431,10 @@ class DscParser(MetaFileParser):
         self._ValueList[2] = '|'.join(ValueList)
 
     def __ProcessComponent(self):
         self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
 
-    def __ProcessSourceOverridePath(self):
-        self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
-
     def __ProcessBuildOption(self):
         self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=False)
                            for Value in self._ValueList]
 
     _SectionParser = {
@@ -1457,11 +1450,10 @@ class DscParser(MetaFileParser):
         MODEL_PCD_DYNAMIC_VPD                           :   _PcdParser,
         MODEL_PCD_DYNAMIC_EX_DEFAULT                    :   _PcdParser,
         MODEL_PCD_DYNAMIC_EX_HII                        :   _PcdParser,
         MODEL_PCD_DYNAMIC_EX_VPD                        :   _PcdParser,
         MODEL_META_DATA_COMPONENT                       :   _ComponentParser,
-        MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH  :   _CompponentSourceOverridePathParser,
         MODEL_META_DATA_BUILD_OPTION                    :   _BuildOptionParser,
         MODEL_UNKNOWN                                   :   MetaFileParser._Skip,
         MODEL_META_DATA_USER_EXTENSION                  :   MetaFileParser._Skip,
         MODEL_META_DATA_SECTION_HEADER                  :   MetaFileParser._SectionHeaderParser,
         MODEL_META_DATA_SUBSECTION_HEADER               :   _SubsectionHeaderParser,
diff --git a/BaseTools/Source/Python/Eot/EotMain.py b/BaseTools/Source/Python/Eot/EotMain.py
index 4802aea8b1..1cf84d2465 100644
--- a/BaseTools/Source/Python/Eot/EotMain.py
+++ b/BaseTools/Source/Python/Eot/EotMain.py
@@ -1595,11 +1595,11 @@ class Eot(object):
         EdkLogger.quiet("Building database for meta data files ...")
         for InfFile in Inf_Files:
             if not InfFile:
                 continue
             EdkLogger.quiet("Parsing %s ..."  % str(InfFile))
-            EdkInfParser(InfFile, EotGlobalData.gDb, Inf_Files[InfFile], '')
+            EdkInfParser(InfFile, EotGlobalData.gDb, Inf_Files[InfFile])
 
         EotGlobalData.gDb.Conn.commit()
         EdkLogger.quiet("Building database for meta data files done!")
 
     ## ParseOption() method
diff --git a/BaseTools/Source/Python/Eot/InfParserLite.py b/BaseTools/Source/Python/Eot/InfParserLite.py
index cec083330b..bc575a642c 100644
--- a/BaseTools/Source/Python/Eot/InfParserLite.py
+++ b/BaseTools/Source/Python/Eot/InfParserLite.py
@@ -38,24 +38,20 @@ class EdkInfParser(object):
     #
     #  @param  self: The object pointer
     #  @param  Filename: INF file name
     #  @param  Database: Eot database
     #  @param  SourceFileList: A list for all source file belonging this INF file
-    #  @param  SourceOverridePath: Override path for source file
-    #  @param  Edk_Source: Environment variable EDK_SOURCE
-    #  @param  Efi_Source: Environment variable EFI_SOURCE
     #
-    def __init__(self, Filename = None, Database = None, SourceFileList = None, SourceOverridePath = None, Edk_Source = None, Efi_Source = None):
+    def __init__(self, Filename = None, Database = None, SourceFileList = None):
         self.Identification = Identification()
         self.Sources = []
         self.Macros = {}
 
         self.Cur = Database.Cur
         self.TblFile = Database.TblFile
         self.TblInf = Database.TblInf
         self.FileID = -1
-        self.SourceOverridePath = SourceOverridePath
 
         # Load Inf file if filename is not None
         if Filename is not None:
             self.LoadInfFile(Filename)
 
diff --git a/BaseTools/Source/Python/UPT/Library/DataType.py b/BaseTools/Source/Python/UPT/Library/DataType.py
index 07673694b2..175b5f5f36 100644
--- a/BaseTools/Source/Python/UPT/Library/DataType.py
+++ b/BaseTools/Source/Python/UPT/Library/DataType.py
@@ -670,12 +670,10 @@ TAB_COMPONENTS_IA32 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_IA32
 TAB_COMPONENTS_X64 = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_X64
 TAB_COMPONENTS_IPF = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_IPF
 TAB_COMPONENTS_ARM = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_ARM
 TAB_COMPONENTS_EBC = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_EBC
 
-TAB_COMPONENTS_SOURCE_OVERRIDE_PATH = 'SOURCE_OVERRIDE_PATH'
-
 TAB_BUILD_OPTIONS = 'BuildOptions'
 
 TAB_DEFINE = 'DEFINE'
 TAB_NMAKE = 'Nmake'
 TAB_USER_EXTENSIONS = 'UserExtensions'
@@ -941,11 +939,10 @@ MODEL_META_DATA_COMPONENT = 5009
 MODEL_META_DATA_USER_EXTENSION = 5010
 MODEL_META_DATA_PACKAGE = 5011
 MODEL_META_DATA_NMAKE = 5012
 MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF = 50013
 MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF = 5014
-MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH = 5015
 
 TOOL_FAMILY_LIST = ["MSFT",
                     "INTEL",
                     "GCC",
                     "RVCT"
diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py b/BaseTools/Source/Python/Workspace/BuildClassObject.py
index b82af49236..3213855e70 100644
--- a/BaseTools/Source/Python/Workspace/BuildClassObject.py
+++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py
@@ -411,11 +411,10 @@ class ModuleBuildClassObject(object):
         self.Guid                    = ''
         self.Version                 = ''
         self.PcdIsDriver             = ''
         self.BinaryModule            = ''
         self.Shadow                  = ''
-        self.SourceOverridePath      = ''
         self.CustomMakefile          = {}
         self.Specification           = {}
         self.LibraryClass            = []
         self.ModuleEntryPointList    = []
         self.ModuleUnloadImageList   = []
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 5e7d7dcd63..58286159db 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -246,11 +246,10 @@ class DscBuildData(PlatformBuildClassObject):
         self._Arch = Arch
         self._Target = Target
         self._Toolchain = Toolchain
         self._ToolChainFamily = None
         self._Clear()
-        self._HandleOverridePath()
         self.WorkspaceDir = os.getenv("WORKSPACE") if os.getenv("WORKSPACE") else ""
         self.DefaultStores = None
         self.SkuIdMgr = SkuClass(self.SkuName, self.SkuIds)
 
     @property
@@ -305,28 +304,10 @@ class DscBuildData(PlatformBuildClassObject):
         self._ISOLanguages      = None
         self._VpdToolGuid       = None
         self._MacroDict         = None
         self.DefaultStores      = None
 
-    ## handle Override Path of Module
-    def _HandleOverridePath(self):
-        RecordList = self._RawData[MODEL_META_DATA_COMPONENT, self._Arch]
-        for Record in RecordList:
-            ModuleId = Record[6]
-            LineNo = Record[7]
-            ModuleFile = PathClass(NormPath(Record[0]), GlobalData.gWorkspace, Arch=self._Arch)
-            RecordList = self._RawData[MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH, self._Arch, None, ModuleId]
-            if RecordList != []:
-                SourceOverridePath = mws.join(GlobalData.gWorkspace, NormPath(RecordList[0][0]))
-
-                # Check if the source override path exists
-                if not os.path.isdir(SourceOverridePath):
-                    EdkLogger.error('build', FILE_NOT_FOUND, Message='Source override path does not exist:', File=self.MetaFile, ExtraData=SourceOverridePath, Line=LineNo)
-
-                # Add to GlobalData Variables
-                GlobalData.gOverrideDir[ModuleFile.Key] = SourceOverridePath
-
     ## Get current effective macros
     @property
     def _Macros(self):
         if self._MacroDict is None:
             self._MacroDict = {}
diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py b/BaseTools/Source/Python/Workspace/InfBuildData.py
index 6148ab0d30..9fed1198fd 100644
--- a/BaseTools/Source/Python/Workspace/InfBuildData.py
+++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
@@ -98,13 +98,11 @@ class InfBuildData(ModuleBuildClassObject):
         TAB_INF_DEFINES_DPX_SOURCE                  :"_DxsFile",
         TAB_INF_DEFINES_VERSION_NUMBER              : "_Version",
         TAB_INF_DEFINES_VERSION_STRING              : "_Version",
         TAB_INF_DEFINES_VERSION                     : "_Version",
         TAB_INF_DEFINES_PCD_IS_DRIVER               : "_PcdIsDriver",
-        TAB_INF_DEFINES_SHADOW                      : "_Shadow",
-
-        TAB_COMPONENTS_SOURCE_OVERRIDE_PATH         : "_SourceOverridePath",
+        TAB_INF_DEFINES_SHADOW                      : "_Shadow"
     }
 
     # regular expression for converting XXX_FLAGS in [nmake] section to new type
     _NMAKE_FLAG_PATTERN_ = re.compile("(?:EBC_)?([A-Z]+)_(?:STD_|PROJ_|ARCH_)?FLAGS(?:_DLL|_ASL|_EXE)?", re.UNICODE)
     # dict used to convert old tool name used in [nmake] section to new ones
@@ -133,14 +131,10 @@ class InfBuildData(ModuleBuildClassObject):
         self._Bdb = BuildDatabase
         self._Arch = Arch
         self._Target = Target
         self._Toolchain = Toolchain
         self._Platform = TAB_COMMON
-        if FilePath.Key in GlobalData.gOverrideDir:
-            self._SourceOverridePath = GlobalData.gOverrideDir[FilePath.Key]
-        else:
-            self._SourceOverridePath = None
         self._TailComments = None
         self._BaseName = None
         self._DxsFile = None
         self._ModuleType = None
         self._ComponentType = None
@@ -665,13 +659,10 @@ class InfBuildData(ModuleBuildClassObject):
 
     ## Retrieve include paths necessary for this module (for Edk.x style of modules)
     @cached_property
     def Includes(self):
         RetVal = []
-        if self._SourceOverridePath:
-            RetVal.append(self._SourceOverridePath)
-
         Macros = self._Macros
         Macros['PROCESSOR'] = GlobalData.gEdkGlobal.get('PROCESSOR', self._Arch)
         RecordList = self._RawData[MODEL_EFI_INCLUDE, self._Arch, self._Platform]
         for Record in RecordList:
             File = NormPath(Record[0], Macros)
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index e5fb3f5473..519d30013c 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -862,11 +862,10 @@ class DscParser(MetaFileParser):
         TAB_PCDS_DYNAMIC_VPD_NULL.upper()           :   MODEL_PCD_DYNAMIC_VPD,
         TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL.upper()    :   MODEL_PCD_DYNAMIC_EX_DEFAULT,
         TAB_PCDS_DYNAMIC_EX_HII_NULL.upper()        :   MODEL_PCD_DYNAMIC_EX_HII,
         TAB_PCDS_DYNAMIC_EX_VPD_NULL.upper()        :   MODEL_PCD_DYNAMIC_EX_VPD,
         TAB_COMPONENTS.upper()                      :   MODEL_META_DATA_COMPONENT,
-        TAB_COMPONENTS_SOURCE_OVERRIDE_PATH.upper() :   MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH,
         TAB_DSC_DEFINES.upper()                     :   MODEL_META_DATA_HEADER,
         TAB_DSC_DEFINES_DEFINE                      :   MODEL_META_DATA_DEFINE,
         TAB_DSC_DEFINES_EDKGLOBAL                   :   MODEL_META_DATA_GLOBAL_DEFINE,
         TAB_INCLUDE.upper()                         :   MODEL_META_DATA_INCLUDE,
         TAB_IF.upper()                              :   MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
@@ -1290,12 +1289,10 @@ class DscParser(MetaFileParser):
                             ExtraData=self._CurrentLine + " (<LibraryClassName>|<LibraryInstancePath>)",
                             File=self.MetaFile, Line=self._LineIndex + 1)
 
         self._ValueList[0:len(TokenList)] = TokenList
 
-    def _CompponentSourceOverridePathParser(self):
-        self._ValueList[0] = self._CurrentLine
 
     ## [BuildOptions] section parser
     @ParseMacro
     def _BuildOptionParser(self):
         self._CurrentLine = CleanString(self._CurrentLine, BuildOption=True)
@@ -1366,11 +1363,10 @@ class DscParser(MetaFileParser):
             MODEL_PCD_DYNAMIC_VPD                           :   self.__ProcessPcd,
             MODEL_PCD_DYNAMIC_EX_DEFAULT                    :   self.__ProcessPcd,
             MODEL_PCD_DYNAMIC_EX_HII                        :   self.__ProcessPcd,
             MODEL_PCD_DYNAMIC_EX_VPD                        :   self.__ProcessPcd,
             MODEL_META_DATA_COMPONENT                       :   self.__ProcessComponent,
-            MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH  :   self.__ProcessSourceOverridePath,
             MODEL_META_DATA_BUILD_OPTION                    :   self.__ProcessBuildOption,
             MODEL_UNKNOWN                                   :   self._Skip,
             MODEL_META_DATA_USER_EXTENSION                  :   self._SkipUserExtension,
             MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR     :   self._ProcessError,
         }
@@ -1701,13 +1697,10 @@ class DscParser(MetaFileParser):
             print(ValList)
 
     def __ProcessComponent(self):
         self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
 
-    def __ProcessSourceOverridePath(self):
-        self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
-
     def __ProcessBuildOption(self):
         self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=False)
                            for Value in self._ValueList]
 
     def DisableOverrideComponent(self,module_id):
@@ -1729,11 +1722,10 @@ class DscParser(MetaFileParser):
         MODEL_PCD_DYNAMIC_VPD                           :   _PcdParser,
         MODEL_PCD_DYNAMIC_EX_DEFAULT                    :   _PcdParser,
         MODEL_PCD_DYNAMIC_EX_HII                        :   _PcdParser,
         MODEL_PCD_DYNAMIC_EX_VPD                        :   _PcdParser,
         MODEL_META_DATA_COMPONENT                       :   _ComponentParser,
-        MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH  :   _CompponentSourceOverridePathParser,
         MODEL_META_DATA_BUILD_OPTION                    :   _BuildOptionParser,
         MODEL_UNKNOWN                                   :   MetaFileParser._Skip,
         MODEL_META_DATA_USER_EXTENSION                  :   MetaFileParser._SkipUserExtension,
         MODEL_META_DATA_SECTION_HEADER                  :   MetaFileParser._SectionHeaderParser,
         MODEL_META_DATA_SUBSECTION_HEADER               :   _SubsectionHeaderParser,
-- 
2.18.0.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch] BaseTools: Remove the logic SourceOverridePath
  2019-03-15 15:17 [Patch] BaseTools: Remove the logic SourceOverridePath Feng, Bob C
@ 2019-03-19  7:24 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2019-03-19  7:24 UTC (permalink / raw)
  To: Feng, Bob C, edk2-devel@lists.01.org

Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Feng, Bob C
>Sent: Friday, March 15, 2019 11:18 PM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>
>Subject: [Patch] BaseTools: Remove the logic SourceOverridePath
>
>BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1350
>SOURCE_OVERRIDE_PATH is for EDK component INF files.
>The corresponding logic should be removed.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng <bob.c.feng@intel.com>
>Cc: Liming Gao <liming.gao@intel.com>
>---
> BaseTools/Source/Python/AutoGen/AutoGen.py    | 13 +------------
> BaseTools/Source/Python/Common/DataType.py    |  2 --
> BaseTools/Source/Python/Common/GlobalData.py  |  1 -
> .../Python/CommonDataClass/DataClass.py       |  2 --
> .../Ecc/MetaFileWorkspace/MetaFileParser.py   |  8 --------
> BaseTools/Source/Python/Eot/EotMain.py        |  2 +-
> BaseTools/Source/Python/Eot/InfParserLite.py  |  6 +-----
> .../Source/Python/UPT/Library/DataType.py     |  3 ---
> .../Python/Workspace/BuildClassObject.py      |  1 -
> .../Source/Python/Workspace/DscBuildData.py   | 19 -------------------
> .../Source/Python/Workspace/InfBuildData.py   | 11 +----------
> .../Source/Python/Workspace/MetaFileParser.py |  8 --------
> 12 files changed, 4 insertions(+), 72 deletions(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
>b/BaseTools/Source/Python/AutoGen/AutoGen.py
>index 568d535754..8c7c20a386 100644
>--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
>+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
>@@ -1139,11 +1139,10 @@ class PlatformAutoGen(AutoGen):
>         self.WorkspaceDir = Workspace.WorkspaceDir
>         self.ToolChain = Toolchain
>         self.BuildTarget = Target
>         self.Arch = Arch
>         self.SourceDir = PlatformFile.SubDir
>-        self.SourceOverrideDir = None
>         self.FdTargetList = self.Workspace.FdTargetList
>         self.FvTargetList = self.Workspace.FvTargetList
>         # get the original module/package/platform objects
>         self.BuildDatabase = Workspace.BuildDatabase
>         self.DscBuildDataObj = Workspace.Platform
>@@ -2557,15 +2556,10 @@ class ModuleAutoGen(AutoGen):
>         self.PlatformInfo = PlatformAutoGen(Workspace, PlatformFile, Target,
>Toolchain, Arch)
>
>         self.SourceDir = self.MetaFile.SubDir
>         self.SourceDir = mws.relpath(self.SourceDir, self.WorkspaceDir)
>
>-        self.SourceOverrideDir = None
>-        # use overridden path defined in DSC file
>-        if self.MetaFile.Key in GlobalData.gOverrideDir:
>-            self.SourceOverrideDir = GlobalData.gOverrideDir[self.MetaFile.Key]
>-
>         self.ToolChain = Toolchain
>         self.BuildTarget = Target
>         self.Arch = Arch
>         self.ToolChainFamily = self.PlatformInfo.ToolChainFamily
>         self.BuildRuleFamily = self.PlatformInfo.BuildRuleFamily
>@@ -2766,16 +2760,11 @@ class ModuleAutoGen(AutoGen):
>     @cached_property
>     def CustomMakefile(self):
>         RetVal = {}
>         for Type in self.Module.CustomMakefile:
>             MakeType = gMakeTypeMap[Type] if Type in gMakeTypeMap else
>'nmake'
>-            if self.SourceOverrideDir is not None:
>-                File = os.path.join(self.SourceOverrideDir,
>self.Module.CustomMakefile[Type])
>-                if not os.path.exists(File):
>-                    File = os.path.join(self.SourceDir,
>self.Module.CustomMakefile[Type])
>-            else:
>-                File = os.path.join(self.SourceDir,
>self.Module.CustomMakefile[Type])
>+            File = os.path.join(self.SourceDir, self.Module.CustomMakefile[Type])
>             RetVal[MakeType] = File
>         return RetVal
>
>     ## Return the directory of the makefile
>     #
>diff --git a/BaseTools/Source/Python/Common/DataType.py
>b/BaseTools/Source/Python/Common/DataType.py
>index 798c0e353d..685f428862 100644
>--- a/BaseTools/Source/Python/Common/DataType.py
>+++ b/BaseTools/Source/Python/Common/DataType.py
>@@ -304,12 +304,10 @@ TAB_COMPONENTS_IA32 = TAB_COMPONENTS +
>TAB_SPLIT + TAB_ARCH_IA32
> TAB_COMPONENTS_X64 = TAB_COMPONENTS + TAB_SPLIT +
>TAB_ARCH_X64
> TAB_COMPONENTS_ARM = TAB_COMPONENTS + TAB_SPLIT +
>TAB_ARCH_ARM
> TAB_COMPONENTS_EBC = TAB_COMPONENTS + TAB_SPLIT +
>TAB_ARCH_EBC
> TAB_COMPONENTS_AARCH64 = TAB_COMPONENTS + TAB_SPLIT +
>TAB_ARCH_AARCH64
>
>-TAB_COMPONENTS_SOURCE_OVERRIDE_PATH =
>'SOURCE_OVERRIDE_PATH'
>-
> TAB_BUILD_OPTIONS = 'BuildOptions'
>
> TAB_DEFINE = 'DEFINE'
> TAB_NMAKE = 'Nmake'
> TAB_USER_EXTENSIONS = 'UserExtensions'
>diff --git a/BaseTools/Source/Python/Common/GlobalData.py
>b/BaseTools/Source/Python/Common/GlobalData.py
>index f117998b0b..79b21324de 100644
>--- a/BaseTools/Source/Python/Common/GlobalData.py
>+++ b/BaseTools/Source/Python/Common/GlobalData.py
>@@ -27,11 +27,10 @@ gPlatformPcds = {}
> # PCDs with type that are not fixed at build and feature flag
> gPlatformOtherPcds = {}
> gActivePlatform = None
> gCommandLineDefines = {}
> gEdkGlobal = {}
>-gOverrideDir = {}
> gCommandMaxLength = 4096
> # for debug trace purpose when problem occurs
> gProcessingFile = ''
> gBuildingModule = ''
> gSkuids = []
>diff --git a/BaseTools/Source/Python/CommonDataClass/DataClass.py
>b/BaseTools/Source/Python/CommonDataClass/DataClass.py
>index 2d93f79b09..5d0c664f6d 100644
>--- a/BaseTools/Source/Python/CommonDataClass/DataClass.py
>+++ b/BaseTools/Source/Python/CommonDataClass/DataClass.py
>@@ -103,11 +103,10 @@ MODEL_META_DATA_COMPONENT = 5009
> MODEL_META_DATA_USER_EXTENSION = 5010
> MODEL_META_DATA_PACKAGE = 5011
> MODEL_META_DATA_NMAKE = 5012
> MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF = 5013
> MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF = 5014
>-MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH = 5015
> MODEL_META_DATA_COMMENT = 5016
> MODEL_META_DATA_GLOBAL_DEFINE = 5017
> MODEL_META_DATA_SECTION_HEADER = 5100
> MODEL_META_DATA_SUBSECTION_HEADER = 5200
> MODEL_META_DATA_TAIL_COMMENT = 5300
>@@ -175,11 +174,10 @@ MODEL_LIST = [('MODEL_UNKNOWN',
>MODEL_UNKNOWN),
>               ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IF",
>MODEL_META_DATA_CONDITIONAL_STATEMENT_IF),
>               ("MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE",
>MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSE),
>               ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF",
>MODEL_META_DATA_CONDITIONAL_STATEMENT_IFDEF),
>               ("MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF",
>MODEL_META_DATA_CONDITIONAL_STATEMENT_IFNDEF),
>               ("MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR",
>MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR),
>-              ("MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH",
>MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH),
>               ("MODEL_META_DATA_BUILD_OPTION",
>MODEL_META_DATA_BUILD_OPTION),
>               ("MODEL_META_DATA_COMPONENT",
>MODEL_META_DATA_COMPONENT),
>               ('MODEL_META_DATA_USER_EXTENSION',
>MODEL_META_DATA_USER_EXTENSION),
>               ('MODEL_META_DATA_PACKAGE', MODEL_META_DATA_PACKAGE),
>               ('MODEL_META_DATA_NMAKE', MODEL_META_DATA_NMAKE),
>diff --git
>a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
>b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
>index 862974894a..8ff95ca3bb 100644
>--- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
>+++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
>@@ -737,11 +737,10 @@ class DscParser(MetaFileParser):
>         TAB_PCDS_DYNAMIC_VPD_NULL.upper()           :
>MODEL_PCD_DYNAMIC_VPD,
>         TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL.upper()    :
>MODEL_PCD_DYNAMIC_EX_DEFAULT,
>         TAB_PCDS_DYNAMIC_EX_HII_NULL.upper()        :
>MODEL_PCD_DYNAMIC_EX_HII,
>         TAB_PCDS_DYNAMIC_EX_VPD_NULL.upper()        :
>MODEL_PCD_DYNAMIC_EX_VPD,
>         TAB_COMPONENTS.upper()                      :
>MODEL_META_DATA_COMPONENT,
>-        TAB_COMPONENTS_SOURCE_OVERRIDE_PATH.upper() :
>MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH,
>         TAB_DSC_DEFINES.upper()                     :   MODEL_META_DATA_HEADER,
>         TAB_DSC_DEFINES_DEFINE                      :   MODEL_META_DATA_DEFINE,
>         TAB_DSC_DEFINES_EDKGLOBAL                   :
>MODEL_META_DATA_GLOBAL_DEFINE,
>         TAB_INCLUDE.upper()                         :   MODEL_META_DATA_INCLUDE,
>         TAB_IF.upper()                              :
>MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
>@@ -1070,12 +1069,10 @@ class DscParser(MetaFileParser):
>                             ExtraData=self._CurrentLine + "
>(<LibraryClassName>|<LibraryInstancePath>)",
>                             File=self.MetaFile, Line=self._LineIndex+1)
>
>         self._ValueList[0:len(TokenList)] = TokenList
>
>-    def _CompponentSourceOverridePathParser(self):
>-        self._ValueList[0] = self._CurrentLine
>
>     ## [BuildOptions] section parser
>     @ParseMacro
>     def _BuildOptionParser(self):
>         TokenList = GetSplitValueList(self._CurrentLine, TAB_EQUAL_SPLIT, 1)
>@@ -1136,11 +1133,10 @@ class DscParser(MetaFileParser):
>             MODEL_PCD_DYNAMIC_VPD                           :   self.__ProcessPcd,
>             MODEL_PCD_DYNAMIC_EX_DEFAULT                    :   self.__ProcessPcd,
>             MODEL_PCD_DYNAMIC_EX_HII                        :   self.__ProcessPcd,
>             MODEL_PCD_DYNAMIC_EX_VPD                        :   self.__ProcessPcd,
>             MODEL_META_DATA_COMPONENT                       :
>self.__ProcessComponent,
>-            MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH  :
>self.__ProcessSourceOverridePath,
>             MODEL_META_DATA_BUILD_OPTION                    :
>self.__ProcessBuildOption,
>             MODEL_UNKNOWN                                   :   self._Skip,
>             MODEL_META_DATA_USER_EXTENSION                  :   self._Skip,
>             MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR     :
>self._Skip,
>         }
>@@ -1435,13 +1431,10 @@ class DscParser(MetaFileParser):
>         self._ValueList[2] = '|'.join(ValueList)
>
>     def __ProcessComponent(self):
>         self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
>
>-    def __ProcessSourceOverridePath(self):
>-        self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
>-
>     def __ProcessBuildOption(self):
>         self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=False)
>                            for Value in self._ValueList]
>
>     _SectionParser = {
>@@ -1457,11 +1450,10 @@ class DscParser(MetaFileParser):
>         MODEL_PCD_DYNAMIC_VPD                           :   _PcdParser,
>         MODEL_PCD_DYNAMIC_EX_DEFAULT                    :   _PcdParser,
>         MODEL_PCD_DYNAMIC_EX_HII                        :   _PcdParser,
>         MODEL_PCD_DYNAMIC_EX_VPD                        :   _PcdParser,
>         MODEL_META_DATA_COMPONENT                       :   _ComponentParser,
>-        MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH  :
>_CompponentSourceOverridePathParser,
>         MODEL_META_DATA_BUILD_OPTION                    :   _BuildOptionParser,
>         MODEL_UNKNOWN                                   :   MetaFileParser._Skip,
>         MODEL_META_DATA_USER_EXTENSION                  :   MetaFileParser._Skip,
>         MODEL_META_DATA_SECTION_HEADER                  :
>MetaFileParser._SectionHeaderParser,
>         MODEL_META_DATA_SUBSECTION_HEADER               :
>_SubsectionHeaderParser,
>diff --git a/BaseTools/Source/Python/Eot/EotMain.py
>b/BaseTools/Source/Python/Eot/EotMain.py
>index 4802aea8b1..1cf84d2465 100644
>--- a/BaseTools/Source/Python/Eot/EotMain.py
>+++ b/BaseTools/Source/Python/Eot/EotMain.py
>@@ -1595,11 +1595,11 @@ class Eot(object):
>         EdkLogger.quiet("Building database for meta data files ...")
>         for InfFile in Inf_Files:
>             if not InfFile:
>                 continue
>             EdkLogger.quiet("Parsing %s ..."  % str(InfFile))
>-            EdkInfParser(InfFile, EotGlobalData.gDb, Inf_Files[InfFile], '')
>+            EdkInfParser(InfFile, EotGlobalData.gDb, Inf_Files[InfFile])
>
>         EotGlobalData.gDb.Conn.commit()
>         EdkLogger.quiet("Building database for meta data files done!")
>
>     ## ParseOption() method
>diff --git a/BaseTools/Source/Python/Eot/InfParserLite.py
>b/BaseTools/Source/Python/Eot/InfParserLite.py
>index cec083330b..bc575a642c 100644
>--- a/BaseTools/Source/Python/Eot/InfParserLite.py
>+++ b/BaseTools/Source/Python/Eot/InfParserLite.py
>@@ -38,24 +38,20 @@ class EdkInfParser(object):
>     #
>     #  @param  self: The object pointer
>     #  @param  Filename: INF file name
>     #  @param  Database: Eot database
>     #  @param  SourceFileList: A list for all source file belonging this INF file
>-    #  @param  SourceOverridePath: Override path for source file
>-    #  @param  Edk_Source: Environment variable EDK_SOURCE
>-    #  @param  Efi_Source: Environment variable EFI_SOURCE
>     #
>-    def __init__(self, Filename = None, Database = None, SourceFileList =
>None, SourceOverridePath = None, Edk_Source = None, Efi_Source = None):
>+    def __init__(self, Filename = None, Database = None, SourceFileList =
>None):
>         self.Identification = Identification()
>         self.Sources = []
>         self.Macros = {}
>
>         self.Cur = Database.Cur
>         self.TblFile = Database.TblFile
>         self.TblInf = Database.TblInf
>         self.FileID = -1
>-        self.SourceOverridePath = SourceOverridePath
>
>         # Load Inf file if filename is not None
>         if Filename is not None:
>             self.LoadInfFile(Filename)
>
>diff --git a/BaseTools/Source/Python/UPT/Library/DataType.py
>b/BaseTools/Source/Python/UPT/Library/DataType.py
>index 07673694b2..175b5f5f36 100644
>--- a/BaseTools/Source/Python/UPT/Library/DataType.py
>+++ b/BaseTools/Source/Python/UPT/Library/DataType.py
>@@ -670,12 +670,10 @@ TAB_COMPONENTS_IA32 = TAB_COMPONENTS +
>TAB_SPLIT + TAB_ARCH_IA32
> TAB_COMPONENTS_X64 = TAB_COMPONENTS + TAB_SPLIT +
>TAB_ARCH_X64
> TAB_COMPONENTS_IPF = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_IPF
> TAB_COMPONENTS_ARM = TAB_COMPONENTS + TAB_SPLIT +
>TAB_ARCH_ARM
> TAB_COMPONENTS_EBC = TAB_COMPONENTS + TAB_SPLIT +
>TAB_ARCH_EBC
>
>-TAB_COMPONENTS_SOURCE_OVERRIDE_PATH =
>'SOURCE_OVERRIDE_PATH'
>-
> TAB_BUILD_OPTIONS = 'BuildOptions'
>
> TAB_DEFINE = 'DEFINE'
> TAB_NMAKE = 'Nmake'
> TAB_USER_EXTENSIONS = 'UserExtensions'
>@@ -941,11 +939,10 @@ MODEL_META_DATA_COMPONENT = 5009
> MODEL_META_DATA_USER_EXTENSION = 5010
> MODEL_META_DATA_PACKAGE = 5011
> MODEL_META_DATA_NMAKE = 5012
> MODEL_META_DATA_CONDITIONAL_STATEMENT_ELSEIF = 50013
> MODEL_META_DATA_CONDITIONAL_STATEMENT_ENDIF = 5014
>-MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH = 5015
>
> TOOL_FAMILY_LIST = ["MSFT",
>                     "INTEL",
>                     "GCC",
>                     "RVCT"
>diff --git a/BaseTools/Source/Python/Workspace/BuildClassObject.py
>b/BaseTools/Source/Python/Workspace/BuildClassObject.py
>index b82af49236..3213855e70 100644
>--- a/BaseTools/Source/Python/Workspace/BuildClassObject.py
>+++ b/BaseTools/Source/Python/Workspace/BuildClassObject.py
>@@ -411,11 +411,10 @@ class ModuleBuildClassObject(object):
>         self.Guid                    = ''
>         self.Version                 = ''
>         self.PcdIsDriver             = ''
>         self.BinaryModule            = ''
>         self.Shadow                  = ''
>-        self.SourceOverridePath      = ''
>         self.CustomMakefile          = {}
>         self.Specification           = {}
>         self.LibraryClass            = []
>         self.ModuleEntryPointList    = []
>         self.ModuleUnloadImageList   = []
>diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
>b/BaseTools/Source/Python/Workspace/DscBuildData.py
>index 5e7d7dcd63..58286159db 100644
>--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
>@@ -246,11 +246,10 @@ class DscBuildData(PlatformBuildClassObject):
>         self._Arch = Arch
>         self._Target = Target
>         self._Toolchain = Toolchain
>         self._ToolChainFamily = None
>         self._Clear()
>-        self._HandleOverridePath()
>         self.WorkspaceDir = os.getenv("WORKSPACE") if
>os.getenv("WORKSPACE") else ""
>         self.DefaultStores = None
>         self.SkuIdMgr = SkuClass(self.SkuName, self.SkuIds)
>
>     @property
>@@ -305,28 +304,10 @@ class DscBuildData(PlatformBuildClassObject):
>         self._ISOLanguages      = None
>         self._VpdToolGuid       = None
>         self._MacroDict         = None
>         self.DefaultStores      = None
>
>-    ## handle Override Path of Module
>-    def _HandleOverridePath(self):
>-        RecordList = self._RawData[MODEL_META_DATA_COMPONENT,
>self._Arch]
>-        for Record in RecordList:
>-            ModuleId = Record[6]
>-            LineNo = Record[7]
>-            ModuleFile = PathClass(NormPath(Record[0]), GlobalData.gWorkspace,
>Arch=self._Arch)
>-            RecordList =
>self._RawData[MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PAT
>H, self._Arch, None, ModuleId]
>-            if RecordList != []:
>-                SourceOverridePath = mws.join(GlobalData.gWorkspace,
>NormPath(RecordList[0][0]))
>-
>-                # Check if the source override path exists
>-                if not os.path.isdir(SourceOverridePath):
>-                    EdkLogger.error('build', FILE_NOT_FOUND, Message='Source
>override path does not exist:', File=self.MetaFile,
>ExtraData=SourceOverridePath, Line=LineNo)
>-
>-                # Add to GlobalData Variables
>-                GlobalData.gOverrideDir[ModuleFile.Key] = SourceOverridePath
>-
>     ## Get current effective macros
>     @property
>     def _Macros(self):
>         if self._MacroDict is None:
>             self._MacroDict = {}
>diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py
>b/BaseTools/Source/Python/Workspace/InfBuildData.py
>index 6148ab0d30..9fed1198fd 100644
>--- a/BaseTools/Source/Python/Workspace/InfBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
>@@ -98,13 +98,11 @@ class InfBuildData(ModuleBuildClassObject):
>         TAB_INF_DEFINES_DPX_SOURCE                  :"_DxsFile",
>         TAB_INF_DEFINES_VERSION_NUMBER              : "_Version",
>         TAB_INF_DEFINES_VERSION_STRING              : "_Version",
>         TAB_INF_DEFINES_VERSION                     : "_Version",
>         TAB_INF_DEFINES_PCD_IS_DRIVER               : "_PcdIsDriver",
>-        TAB_INF_DEFINES_SHADOW                      : "_Shadow",
>-
>-        TAB_COMPONENTS_SOURCE_OVERRIDE_PATH         :
>"_SourceOverridePath",
>+        TAB_INF_DEFINES_SHADOW                      : "_Shadow"
>     }
>
>     # regular expression for converting XXX_FLAGS in [nmake] section to new
>type
>     _NMAKE_FLAG_PATTERN_ = re.compile("(?:EBC_)?([A-
>Z]+)_(?:STD_|PROJ_|ARCH_)?FLAGS(?:_DLL|_ASL|_EXE)?", re.UNICODE)
>     # dict used to convert old tool name used in [nmake] section to new ones
>@@ -133,14 +131,10 @@ class InfBuildData(ModuleBuildClassObject):
>         self._Bdb = BuildDatabase
>         self._Arch = Arch
>         self._Target = Target
>         self._Toolchain = Toolchain
>         self._Platform = TAB_COMMON
>-        if FilePath.Key in GlobalData.gOverrideDir:
>-            self._SourceOverridePath = GlobalData.gOverrideDir[FilePath.Key]
>-        else:
>-            self._SourceOverridePath = None
>         self._TailComments = None
>         self._BaseName = None
>         self._DxsFile = None
>         self._ModuleType = None
>         self._ComponentType = None
>@@ -665,13 +659,10 @@ class InfBuildData(ModuleBuildClassObject):
>
>     ## Retrieve include paths necessary for this module (for Edk.x style of
>modules)
>     @cached_property
>     def Includes(self):
>         RetVal = []
>-        if self._SourceOverridePath:
>-            RetVal.append(self._SourceOverridePath)
>-
>         Macros = self._Macros
>         Macros['PROCESSOR'] = GlobalData.gEdkGlobal.get('PROCESSOR',
>self._Arch)
>         RecordList = self._RawData[MODEL_EFI_INCLUDE, self._Arch,
>self._Platform]
>         for Record in RecordList:
>             File = NormPath(Record[0], Macros)
>diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py
>b/BaseTools/Source/Python/Workspace/MetaFileParser.py
>index e5fb3f5473..519d30013c 100644
>--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
>+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
>@@ -862,11 +862,10 @@ class DscParser(MetaFileParser):
>         TAB_PCDS_DYNAMIC_VPD_NULL.upper()           :
>MODEL_PCD_DYNAMIC_VPD,
>         TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL.upper()    :
>MODEL_PCD_DYNAMIC_EX_DEFAULT,
>         TAB_PCDS_DYNAMIC_EX_HII_NULL.upper()        :
>MODEL_PCD_DYNAMIC_EX_HII,
>         TAB_PCDS_DYNAMIC_EX_VPD_NULL.upper()        :
>MODEL_PCD_DYNAMIC_EX_VPD,
>         TAB_COMPONENTS.upper()                      :
>MODEL_META_DATA_COMPONENT,
>-        TAB_COMPONENTS_SOURCE_OVERRIDE_PATH.upper() :
>MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH,
>         TAB_DSC_DEFINES.upper()                     :   MODEL_META_DATA_HEADER,
>         TAB_DSC_DEFINES_DEFINE                      :   MODEL_META_DATA_DEFINE,
>         TAB_DSC_DEFINES_EDKGLOBAL                   :
>MODEL_META_DATA_GLOBAL_DEFINE,
>         TAB_INCLUDE.upper()                         :   MODEL_META_DATA_INCLUDE,
>         TAB_IF.upper()                              :
>MODEL_META_DATA_CONDITIONAL_STATEMENT_IF,
>@@ -1290,12 +1289,10 @@ class DscParser(MetaFileParser):
>                             ExtraData=self._CurrentLine + "
>(<LibraryClassName>|<LibraryInstancePath>)",
>                             File=self.MetaFile, Line=self._LineIndex + 1)
>
>         self._ValueList[0:len(TokenList)] = TokenList
>
>-    def _CompponentSourceOverridePathParser(self):
>-        self._ValueList[0] = self._CurrentLine
>
>     ## [BuildOptions] section parser
>     @ParseMacro
>     def _BuildOptionParser(self):
>         self._CurrentLine = CleanString(self._CurrentLine, BuildOption=True)
>@@ -1366,11 +1363,10 @@ class DscParser(MetaFileParser):
>             MODEL_PCD_DYNAMIC_VPD                           :   self.__ProcessPcd,
>             MODEL_PCD_DYNAMIC_EX_DEFAULT                    :   self.__ProcessPcd,
>             MODEL_PCD_DYNAMIC_EX_HII                        :   self.__ProcessPcd,
>             MODEL_PCD_DYNAMIC_EX_VPD                        :   self.__ProcessPcd,
>             MODEL_META_DATA_COMPONENT                       :
>self.__ProcessComponent,
>-            MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH  :
>self.__ProcessSourceOverridePath,
>             MODEL_META_DATA_BUILD_OPTION                    :
>self.__ProcessBuildOption,
>             MODEL_UNKNOWN                                   :   self._Skip,
>             MODEL_META_DATA_USER_EXTENSION                  :
>self._SkipUserExtension,
>             MODEL_META_DATA_CONDITIONAL_STATEMENT_ERROR     :
>self._ProcessError,
>         }
>@@ -1701,13 +1697,10 @@ class DscParser(MetaFileParser):
>             print(ValList)
>
>     def __ProcessComponent(self):
>         self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
>
>-    def __ProcessSourceOverridePath(self):
>-        self._ValueList[0] = ReplaceMacro(self._ValueList[0], self._Macros)
>-
>     def __ProcessBuildOption(self):
>         self._ValueList = [ReplaceMacro(Value, self._Macros, RaiseError=False)
>                            for Value in self._ValueList]
>
>     def DisableOverrideComponent(self,module_id):
>@@ -1729,11 +1722,10 @@ class DscParser(MetaFileParser):
>         MODEL_PCD_DYNAMIC_VPD                           :   _PcdParser,
>         MODEL_PCD_DYNAMIC_EX_DEFAULT                    :   _PcdParser,
>         MODEL_PCD_DYNAMIC_EX_HII                        :   _PcdParser,
>         MODEL_PCD_DYNAMIC_EX_VPD                        :   _PcdParser,
>         MODEL_META_DATA_COMPONENT                       :   _ComponentParser,
>-        MODEL_META_DATA_COMPONENT_SOURCE_OVERRIDE_PATH  :
>_CompponentSourceOverridePathParser,
>         MODEL_META_DATA_BUILD_OPTION                    :   _BuildOptionParser,
>         MODEL_UNKNOWN                                   :   MetaFileParser._Skip,
>         MODEL_META_DATA_USER_EXTENSION                  :
>MetaFileParser._SkipUserExtension,
>         MODEL_META_DATA_SECTION_HEADER                  :
>MetaFileParser._SectionHeaderParser,
>         MODEL_META_DATA_SUBSECTION_HEADER               :
>_SubsectionHeaderParser,
>--
>2.18.0.windows.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-19  7:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-15 15:17 [Patch] BaseTools: Remove the logic SourceOverridePath Feng, Bob C
2019-03-19  7:24 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox