Re: [Patch V2] BaseTools: Add build info for binary modules that only list in FDF file

Liming Gao

Reviewed-by: Liming Gao <liming.gao@...>

-----Original Message-----
From: Zhu, Yonghong
Sent: Thursday, July 28, 2016 9:33 AM
To: edk2-devel@...
Cc: Gao, Liming <liming.gao@...>
Subject: [Patch V2] BaseTools: Add build info for binary modules that only list
in FDF file

If the binary module is list in the FDF file but not list in the DSC
file, current build report would not include these binary module's info
in the report "Module section". The patch fix this issue.

Cc: Liming Gao <liming.gao@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@...>
BaseTools/Source/Python/AutoGen/ | 4 ++++
BaseTools/Source/Python/build/ | 18 +++++++++++++++++-
2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/
index 9a95014..9c548be 100644
--- a/BaseTools/Source/Python/AutoGen/
+++ b/BaseTools/Source/Python/AutoGen/
@@ -1940,10 +1940,14 @@ class PlatformAutoGen(AutoGen):
# @param Module The module from which the library classes will be
# @retval library_list List of library instances sorted
def ApplyLibraryInstance(self, Module):
+ # Cover the case that the binary INF file is list in the FDF file but not DSC
file, return empty list directly
+ if str(Module) not in self.Platform.Modules:
+ return []
ModuleType = Module.ModuleType

# for overridding library instances with module specific setting
PlatformModule = self.Platform.Modules[str(Module)]

diff --git a/BaseTools/Source/Python/build/
index ef99989..4c57754 100644
--- a/BaseTools/Source/Python/build/
+++ b/BaseTools/Source/Python/build/
@@ -45,10 +45,13 @@ from Common.DataType import TAB_BRG_PCD
from Common.DataType import TAB_BRG_LIBRARY
from Common.DataType import TAB_BACK_SLASH
from Common.LongFilePathSupport import OpenLongFilePath as open
from Common.MultipleWorkspace import MultipleWorkspace as mws
import Common.GlobalData as GlobalData
+from AutoGen.AutoGen import ModuleAutoGen
+from Common.Misc import PathClass
+from Common.String import NormPath

## Pattern to extract contents in EDK DXS files
gDxsDependencyPattern =

## Pattern to find total FV total size, occupied size in flash report
intermediate file
@@ -1645,12 +1648,25 @@ class PlatformReport(object):
for Ma in MaList:
self.ModuleReportList.append(ModuleReport(Ma, ReportType))
self._IsModuleBuild = False
for Pa in Wa.AutoGenObjectList:
+ ModuleAutoGenList = []
for ModuleKey in Pa.Platform.Modules:
Key].M, ReportType))
+ if GlobalData.gFdfParser != None:
+ if Pa.Arch in GlobalData.gFdfParser.Profile.InfDict:
+ INFList = GlobalData.gFdfParser.Profile.InfDict[Pa.Arch]
+ for InfName in INFList:
+ InfClass = PathClass(NormPath(InfName), Wa.WorkspaceDir,
+ Ma = ModuleAutoGen(Wa, InfClass, Pa.BuildTarget,
Pa.ToolChain, Pa.Arch, Wa.MetaFile)
+ if Ma == None:
+ continue
+ if Ma not in ModuleAutoGenList:
+ ModuleAutoGenList.append(Ma)
+ for MGen in ModuleAutoGenList:
+ self.ModuleReportList.append(ModuleReport(MGen,

# Generate report for the whole platform.

Join to automatically receive all group messages.