]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/build.py: Exit with 1 when AutoGen error occurred
authorIrene Park <ipark@nvidia.com>
Tue, 2 Jun 2020 21:58:50 +0000 (05:58 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 7 Jun 2020 12:51:25 +0000 (12:51 +0000)
AutoGen manager/workers halt the progress when an error occurs but
doesn't propagate the error code to main and allows main exit with 0
and gets the build system unable to catch the occurrence of an error.
This change informs main with an error when a progress is halted and
helps main exit with 1.

Signed-off-by: Irene Park <ipark@nvidia.com>
Reviewed-by: Bob Feng<bob.c.feng@intel.com>
BaseTools/Source/Python/build/build.py

index ed3a3b978da1e0717530656fdafc81c263169cca..1ab1e60a6499f4876da081726db171f4bde51464 100755 (executable)
@@ -880,7 +880,10 @@ class Build():
 \r
             self.AutoGenMgr.join()\r
             rt = self.AutoGenMgr.Status\r
-            return rt, 0\r
+            err = 0\r
+            if not rt:\r
+                err = UNKNOWN_ERROR\r
+            return rt, err\r
         except FatalError as e:\r
             return False, e.args[0]\r
         except:\r
@@ -2724,4 +2727,3 @@ if __name__ == '__main__':
     ## 0-127 is a safe return range, and 1 is a standard default error\r
     if r < 0 or r > 127: r = 1\r
     sys.exit(r)\r
-\r