Skip to content

Commit

Permalink
BaseTools: InfBuildData: Fix Private value retrieval
Browse files Browse the repository at this point in the history
Update retrieval of private guids, protocols, or ppis from a package's
declaration file to use the original path of the module's INF file
rather than the current path. When building the same module multiple
times in the same INF (by override the define's FILE_GUID), a temporary
instance of the module is generated outside the package, causing the
retrieval of private values to fail as the check to access private
values is done by verifying the module to build, is inside the package.

Signed-off-by: Joey Vagedes <[email protected]>

Cc: Rebecca Cran <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Bob Feng <[email protected]>
Cc: Yuwei Chen <[email protected]>
  • Loading branch information
Javagedes committed Jul 1, 2024
1 parent 1c5a8b1 commit e8ae6a9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions BaseTools/Source/Python/Workspace/InfBuildData.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ def Protocols(self):
RecordList = self._RawData[MODEL_EFI_PROTOCOL, self._Arch, self._Platform]
for Record in RecordList:
CName = Record[0]
Value = _ProtocolValue(CName, self.Packages, self.MetaFile.Path)
Value = _ProtocolValue(CName, self.Packages, self.MetaFile.OriginalPath.Path) # MU_CHANGE: BZ4730
if Value is None:
PackageList = "\n\t".join(str(P) for P in self.Packages)
EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
Expand All @@ -619,7 +619,7 @@ def Ppis(self):
RecordList = self._RawData[MODEL_EFI_PPI, self._Arch, self._Platform]
for Record in RecordList:
CName = Record[0]
Value = _PpiValue(CName, self.Packages, self.MetaFile.Path)
Value = _PpiValue(CName, self.Packages, self.MetaFile.OriginalPath.Path) # MU_CHANGE: BZ4730
if Value is None:
PackageList = "\n\t".join(str(P) for P in self.Packages)
EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
Expand All @@ -643,7 +643,7 @@ def Guids(self):
RecordList = self._RawData[MODEL_EFI_GUID, self._Arch, self._Platform]
for Record in RecordList:
CName = Record[0]
Value = GuidValue(CName, self.Packages, self.MetaFile.Path)
Value = GuidValue(CName, self.Packages, self.MetaFile.OriginalPath.Path) # MU_CHANGE: BZ4730
if Value is None:
PackageList = "\n\t".join(str(P) for P in self.Packages)
EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
Expand All @@ -658,7 +658,7 @@ def Guids(self):
for TokenSpaceGuid, _, _, _, _, _, LineNo in RecordList:
# get the guid value
if TokenSpaceGuid not in RetVal:
Value = GuidValue(TokenSpaceGuid, self.Packages, self.MetaFile.Path)
Value = GuidValue(TokenSpaceGuid, self.Packages, self.MetaFile.OriginalPath.Path) # MU_CHANGE: BZ4730
if Value is None:
PackageList = "\n\t".join(str(P) for P in self.Packages)
EdkLogger.error('build', RESOURCE_NOT_AVAILABLE,
Expand Down Expand Up @@ -821,11 +821,11 @@ def Depex(self):
Value = Token
else:
# get the GUID value now
Value = _ProtocolValue(Token, self.Packages, self.MetaFile.Path)
Value = _ProtocolValue(Token, self.Packages, self.MetaFile.OriginalPath.Path) # MU_CHANGE: BZ4730
if Value is None:
Value = _PpiValue(Token, self.Packages, self.MetaFile.Path)
Value = _PpiValue(Token, self.Packages, self.MetaFile.OriginalPath.Path) # MU_CHANGE: BZ4730
if Value is None:
Value = GuidValue(Token, self.Packages, self.MetaFile.Path)
Value = GuidValue(Token, self.Packages, self.MetaFile.OriginalPath.Path) # MU_CHANGE: BZ4730

if Value is None:
PackageList = "\n\t".join(str(P) for P in self.Packages)
Expand Down

0 comments on commit e8ae6a9

Please sign in to comment.