diff --git a/BaseTools/Plugin/OverrideValidation/OverrideValidation.py b/BaseTools/Plugin/OverrideValidation/OverrideValidation.py index 69a3c9c4d16..0408c2613aa 100644 --- a/BaseTools/Plugin/OverrideValidation/OverrideValidation.py +++ b/BaseTools/Plugin/OverrideValidation/OverrideValidation.py @@ -400,7 +400,7 @@ def deprecation_process_line_with_version1(self, thebuilder, filepath, Deprecati normalized_file_path = filepath.replace("\\", "/") # Check if the module is part of the skip list - skip_list = thebuilder.env.GetValue("DEPRECATED_MODULES_SKIPLIST").split(";") + skip_list = thebuilder.env.GetValue("DEPRECATED_MODULES_SKIPLIST") for module in skip_list: if module.strip() == "": continue @@ -705,12 +705,12 @@ def path_parse(): if Paths.DeprecatedPath is not None: if not os.path.isfile(Paths.DeprecatedPath): - raise RuntimeError("Deprecation path module is invalid") + raise RuntimeError(f"Deprecation path {Paths.DeprecatedPath} module is invalid") # Needs to strip os.sep is to take care of the root path case # For a folder, this will do nothing on a formatted abspath # For a drive root, this will rip off the os.sep if not os.path.normcase(Paths.DeprecatedPath).startswith(os.path.normcase(Paths.WorkSpace.rstrip(os.sep)) + os.sep): - raise RuntimeError("Module is not within specified Workspace.") + raise RuntimeError(f"Module {Paths.DeprecatedPath} is not within the specified Workspace {Paths.WorkSpace.rstrip(os.sep)}.") return Paths diff --git a/BaseTools/Plugin/OverrideValidation/ReadMe.md b/BaseTools/Plugin/OverrideValidation/ReadMe.md index a5b102a1deb..ed770adfa55 100644 --- a/BaseTools/Plugin/OverrideValidation/ReadMe.md +++ b/BaseTools/Plugin/OverrideValidation/ReadMe.md @@ -105,13 +105,13 @@ Override record to be included in overriding module's inf: Command to generate a deprecation record: ``` cmd -OverrideValidation.py -w C:\Repo -d C:\Repo\MU_BASECORE\MdeModulePkg\BaseMemoryLib\BaseMemoryLib.inf -dr C:\Repo\MU_BASECORE\MdeModulePkg\BaseMemoryLibV2\BaseMemoryLib.inf +OverrideValidation.py -w C:\Repo -d C:\Repo\MU_BASECORE\MdeModulePkg\BaseMemoryLib\BaseMemoryLib.inf -dr C:\Repo\MU_BASECORE\MdeModulePkg\BaseMemoryLibV2\BaseMemoryLib.inf -dt 120 ``` Deprecation record to be included in the deprecated module's inf: ``` cmd -#Deprecated : 00000001 | MdeModulePkg/BaseMemoryLibV2/BaseMemoryLib.inf | 2024-02-16T04-00-28 +#Deprecated : 00000001 | MdeModulePkg/BaseMemoryLibV2/BaseMemoryLib.inf | 2024-02-16T04-00-28 | 120 ``` Deprecation warning example: @@ -120,10 +120,10 @@ Deprecation warning example: WARNING - Use of Deprecated module: C:\Repo\MU_BASECORE\MdeModulePkg\BaseMemoryLib\BaseMemoryLib.inf, Please switch to: C:\Repo\MU_BASECORE\MdeModulePkg\BaseMemoryLibV2\BaseMemoryLib.inf. ``` -To disable Deprecation warnings, Set the following value in the build scripts. +To disable Deprecation warnings for a given module, add it to the deprecation modules skip list. ``` cmd -self.env.SetValue("ALLOW_DEPRECATED_MODULES", "TRUE", "Allow the usage of deprecated modules") +self.env.SetValue("DEPRECATED_MODULES_SKIPLIST", ["MdeModulePkg\BaseMemoryLib\BaseMemoryLib.inf"], "Skip list for platforms") ``` Override log generated during pre-build process: