Skip to content

Commit

Permalink
buildreport_parser.py: Properly handle NULL libraries (#671)
Browse files Browse the repository at this point in the history
Currently, buildreport_parser maintains a dictionary of library classes.

This fails for NULL libraries. If more than one NULL library exists, only the last instance encountered will be in the dictionary.

To match edk2 build tool behavior, NULL libraries will have an instance number appened to the name.

i.e. NULL0, NULL1, etc
  • Loading branch information
apop5 authored Nov 22, 2024
1 parent 049e96b commit 55350f3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions edk2toollib/uefi/edk2/parsers/buildreport_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def __init__(self, content: str, ws: str, packagepatahlist: list, pathconverter:
self.Type = ""
self.PCDs = {}
self.Libraries = {}
self.NullLibraryCount = 0
self.Depex = ""
self.WorkspacePath = ws
self.PackagePathList = packagepatahlist
Expand Down Expand Up @@ -118,6 +119,10 @@ def Parse(self) -> None:
lib_class = templine.partition("{")[2].partition("}")[0].partition(":")[0].strip()
lib_instance = templine.partition("{")[0].strip()

if lib_class.strip().lower() == "null":
lib_class += str(self.NullLibraryCount)
self.NullLibraryCount += 1

# Take absolute path and convert to EDK build path
RelativePath = self.pathConverter.GetEdk2RelativePathFromAbsolutePath(lib_instance)
if RelativePath is not None:
Expand Down

0 comments on commit 55350f3

Please sign in to comment.