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 @@ -1141,7 +1141,6 @@ class PlatformAutoGen(AutoGen): 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 @@ -2559,11 +2558,6 @@ class ModuleAutoGen(AutoGen): 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 @@ -2768,12 +2762,7 @@ class ModuleAutoGen(AutoGen): 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 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 @@ -306,8 +306,6 @@ 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' 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 @@ -29,7 +29,6 @@ gPlatformOtherPcds = {} gActivePlatform = None gCommandLineDefines = {} gEdkGlobal = {} -gOverrideDir = {} gCommandMaxLength = 4096 # for debug trace purpose when problem occurs gProcessingFile = '' 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 @@ -105,7 +105,6 @@ 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 @@ -177,7 +176,6 @@ MODEL_LIST = [('MODEL_UNKNOWN', MODEL_UNKNOWN), ("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), 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 @@ -739,7 +739,6 @@ class DscParser(MetaFileParser): 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, @@ -1072,8 +1071,6 @@ class DscParser(MetaFileParser): self._ValueList[0:len(TokenList)] = TokenList - def _CompponentSourceOverridePathParser(self): - self._ValueList[0] = self._CurrentLine ## [BuildOptions] section parser @ParseMacro @@ -1138,7 +1135,6 @@ class DscParser(MetaFileParser): 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, @@ -1437,9 +1433,6 @@ class DscParser(MetaFileParser): 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] @@ -1459,7 +1452,6 @@ class DscParser(MetaFileParser): 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, 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 @@ -1597,7 +1597,7 @@ class Eot(object): 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!") 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 @@ -40,11 +40,8 @@ class EdkInfParser(object): # @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 = {} @@ -53,7 +50,6 @@ class EdkInfParser(object): 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: 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 @@ -672,8 +672,6 @@ 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' @@ -943,7 +941,6 @@ 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", 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 @@ -413,7 +413,6 @@ class ModuleBuildClassObject(object): self.PcdIsDriver = '' self.BinaryModule = '' self.Shadow = '' - self.SourceOverridePath = '' self.CustomMakefile = {} self.Specification = {} self.LibraryClass = [] 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 @@ -248,7 +248,6 @@ class DscBuildData(PlatformBuildClassObject): 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) @@ -307,24 +306,6 @@ class DscBuildData(PlatformBuildClassObject): 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): 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 @@ -100,9 +100,7 @@ class InfBuildData(ModuleBuildClassObject): 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 @@ -135,10 +133,6 @@ class InfBuildData(ModuleBuildClassObject): 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 @@ -667,9 +661,6 @@ class InfBuildData(ModuleBuildClassObject): @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] 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 @@ -864,7 +864,6 @@ class DscParser(MetaFileParser): 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, @@ -1292,8 +1291,6 @@ class DscParser(MetaFileParser): self._ValueList[0:len(TokenList)] = TokenList - def _CompponentSourceOverridePathParser(self): - self._ValueList[0] = self._CurrentLine ## [BuildOptions] section parser @ParseMacro @@ -1368,7 +1365,6 @@ class DscParser(MetaFileParser): 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, @@ -1703,9 +1699,6 @@ class DscParser(MetaFileParser): 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] @@ -1731,7 +1724,6 @@ class DscParser(MetaFileParser): 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,