]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: report error if source module INF is only list in FDF file
authorYonghong Zhu <yonghong.zhu@intel.com>
Wed, 20 Jul 2016 05:58:03 +0000 (13:58 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Wed, 27 Jul 2016 01:48:58 +0000 (09:48 +0800)
If source module INF is not listed in DSC, it will not be built. And it
is listed in FDF, GenFds will fail to find its build output. To reminder
user this issue early, build tool should report failure to user in early
phase.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools/Source/Python/GenFds/FdfParser.py

index 8da441f6b9cb4f3d67bcd236a98d493b37c26501..9a9501415ff1fe7850877ef2029482538f276ec5 100644 (file)
@@ -329,6 +329,34 @@ class WorkspaceAutoGen(AutoGen):
                 if fvname.upper() not in self.FdfProfile.FvDict:\r
                     EdkLogger.error("build", OPTION_VALUE_INVALID,\r
                                     "No such an FV in FDF file: %s" % fvname)\r
+\r
+            for key in self.FdfProfile.InfDict:\r
+                if key == 'ArchTBD':\r
+                    Platform_cache = {}\r
+                    for Arch in self.ArchList:\r
+                        Platform_cache[Arch] = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]\r
+                    for Inf in self.FdfProfile.InfDict[key]:\r
+                        ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch)\r
+                        for Arch in self.ArchList:\r
+                            if ModuleFile in Platform_cache[Arch].Modules:\r
+                                break\r
+                        else:\r
+                            ModuleData = self.BuildDatabase[ModuleFile, Arch, Target, Toolchain]\r
+                            if not ModuleData.IsBinaryModule:\r
+                                EdkLogger.error('build', PARSER_ERROR, "Module %s NOT found in DSC file; Is it really a binary module?" % ModuleFile)\r
+\r
+                else:\r
+                    for Arch in self.ArchList:\r
+                        if Arch == key:\r
+                            Platform = self.BuildDatabase[self.MetaFile, Arch, Target, Toolchain]\r
+                            for Inf in self.FdfProfile.InfDict[key]:\r
+                                ModuleFile = PathClass(NormPath(Inf), GlobalData.gWorkspace, Arch)\r
+                                if ModuleFile in Platform.Modules:\r
+                                    continue\r
+                                ModuleData = self.BuildDatabase[ModuleFile, Arch, Target, Toolchain]\r
+                                if not ModuleData.IsBinaryModule:\r
+                                    EdkLogger.error('build', PARSER_ERROR, "Module %s NOT found in DSC file; Is it really a binary module?" % ModuleFile)\r
+\r
         else:\r
             PcdSet = {}\r
             ModuleList = []\r
index 56303e1694f8dc1c82c3f16407f103760d9d3993..8709cfc0917860a0391cd5ab73a005a94b2953a7 100644 (file)
@@ -231,6 +231,7 @@ class FileProfile :
 \r
         self.PcdDict = {}\r
         self.InfList = []\r
+        self.InfDict = {'ArchTBD':[]}\r
         # ECC will use this Dict and List information\r
         self.PcdFileLineDict = {}\r
         self.InfFileLineList = []\r
@@ -2472,6 +2473,13 @@ class FdfParser:
             self.Profile.InfList.append(ffsInf.InfFileName)\r
             FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)\r
             self.Profile.InfFileLineList.append(FileLineTuple)\r
+            if ffsInf.UseArch:\r
+                if ffsInf.UseArch not in self.Profile.InfDict:\r
+                    self.Profile.InfDict[ffsInf.UseArch] = [ffsInf.InfFileName]\r
+                else:\r
+                    self.Profile.InfDict[ffsInf.UseArch].append(ffsInf.InfFileName)\r
+            else:\r
+                self.Profile.InfDict['ArchTBD'].append(ffsInf.InfFileName)\r
 \r
         if self.__IsToken('|'):\r
             if self.__IsKeyword('RELOCS_STRIPPED'):\r
@@ -4351,6 +4359,13 @@ class FdfParser:
             self.Profile.InfList.append(ffsInf.InfFileName)\r
             FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)\r
             self.Profile.InfFileLineList.append(FileLineTuple)\r
+            if ffsInf.UseArch:\r
+                if ffsInf.UseArch not in self.Profile.InfDict:\r
+                    self.Profile.InfDict[ffsInf.UseArch] = [ffsInf.InfFileName]\r
+                else:\r
+                    self.Profile.InfDict[ffsInf.UseArch].append(ffsInf.InfFileName)\r
+            else:\r
+                self.Profile.InfDict['ArchTBD'].append(ffsInf.InfFileName)\r
 \r
         \r
         self.__GetOptRomOverrides (ffsInf)\r