public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Irene Park" <ipark@nvidia.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	Irene Park <ipark@nvidia.com>
Cc: "bob.c.feng@intel.com" <bob.c.feng@intel.com>
Subject: Re: [edk2-devel] [PATCH v2] BaseTools/Python: sys.exit(1) when error occurred
Date: Mon, 1 Jun 2020 20:31:06 +0000	[thread overview]
Message-ID: <BN8PR12MB3458B39620CF0778CE021B10C98A0@BN8PR12MB3458.namprd12.prod.outlook.com> (raw)
In-Reply-To: <1614857659D31804.27457@groups.io>

Hi Bob,
Would you please review this patch again?
Thank you,
Irene

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Irene Park
Sent: Monday, June 1, 2020 4:28 PM
To: devel@edk2.groups.io
Cc: Irene Park <ipark@nvidia.com>
Subject: [edk2-devel] [PATCH v2] BaseTools/Python: sys.exit(1) when error occurred

External email: Use caution opening links or attachments


From: Irene Park <ipark@nvidia.com>

AutoGen manager/workers halt the progress when an error occurs but doesn't propagate the error code to main and makes main sys.exit(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 sys.exit(1).

Signed-off-by: Irene Park <ipark@nvidia.com>
---
 BaseTools/Source/Python/build/build.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
index ed3a3b9..1ab1e60 100755
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -880,7 +880,10 @@ class Build():

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





       reply	other threads:[~2020-06-01 20:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1614857659D31804.27457@groups.io>
2020-06-01 20:31 ` Irene Park [this message]
2020-06-01 20:28 [PATCH v2] BaseTools/Python: sys.exit(1) when error occurred Irene Park
2020-06-02  9:18 ` [edk2-devel] " Bob Feng
2020-06-02 15:32   ` Irene Park

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN8PR12MB3458B39620CF0778CE021B10C98A0@BN8PR12MB3458.namprd12.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox