Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NishanthSanjeevi committed May 7, 2024
1 parent 3bae2c2 commit e8e0dd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions BaseTools/Plugin/OverrideValidation/OverrideValidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions BaseTools/Plugin/OverrideValidation/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:

Expand Down

0 comments on commit e8e0dd2

Please sign in to comment.