]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/build/build.py
BaseTools: Add error condition for the path in PACKAGES_PATH env
[mirror_edk2.git] / BaseTools / Source / Python / build / build.py
index 37afe52ac298858627170c545b77fcba28242c80..4f859bf5a774268c62c20ee9bfc89159ec19a8d8 100644 (file)
@@ -110,6 +110,12 @@ def CheckEnvVariable():
     # set multiple workspace\r
     PackagesPath = os.getenv("PACKAGES_PATH")\r
     mws.setWs(WorkspaceDir, PackagesPath)\r
+    if mws.PACKAGES_PATH:\r
+        for Path in mws.PACKAGES_PATH:\r
+            if not os.path.exists(Path):\r
+                EdkLogger.error("build", FILE_NOT_FOUND, "One Path in PACKAGES_PATH doesn't exist", ExtraData="%s" % Path)\r
+            elif ' ' in Path:\r
+                EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allowed in PACKAGES_PATH", ExtraData=Path)\r
 \r
     #\r
     # Check EFI_SOURCE (Edk build convention). EDK_SOURCE will always point to ECP\r
@@ -920,6 +926,9 @@ class Build():
 \r
     def InitPreBuild(self):\r
         self.LoadConfiguration()\r
+        ErrorCode, ErrorInfo = self.PlatformFile.Validate(".dsc", False)\r
+        if ErrorCode != 0:\r
+            EdkLogger.error("build", ErrorCode, ExtraData=ErrorInfo)\r
         if self.BuildTargetList:\r
             GlobalData.gGlobalDefines['TARGET'] = self.BuildTargetList[0]\r
         if self.ArchList:\r
@@ -2105,8 +2114,8 @@ def MyOptionParser():
     Parser.add_option("-D", "--define", action="append", type="string", dest="Macros", help="Macro: \"Name [= Value]\".")\r
 \r
     Parser.add_option("-y", "--report-file", action="store", dest="ReportFile", help="Create/overwrite the report to the specified filename.")\r
-    Parser.add_option("-Y", "--report-type", action="append", type="choice", choices=['PCD', 'LIBRARY', 'FLASH', 'DEPEX', 'BUILD_FLAGS', 'FIXED_ADDRESS', 'EXECUTION_ORDER'], dest="ReportType", default=[],\r
-        help="Flags that control the type of build report to generate.  Must be one of: [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS, EXECUTION_ORDER].  "\\r
+    Parser.add_option("-Y", "--report-type", action="append", type="choice", choices=['PCD','LIBRARY','FLASH','DEPEX','BUILD_FLAGS','FIXED_ADDRESS','HASH','EXECUTION_ORDER'], dest="ReportType", default=[],\r
+        help="Flags that control the type of build report to generate.  Must be one of: [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS, HASH, EXECUTION_ORDER].  "\\r
              "To specify more than one flag, repeat this option on the command line and the default flag set is [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS]")\r
     Parser.add_option("-F", "--flag", action="store", type="string", dest="Flag",\r
         help="Specify the specific option to parse EDK UNI file. Must be one of: [-c, -s]. -c is for EDK framework UNI file, and -s is for EDK UEFI UNI file. "\\r