From: Irene Park <ipark@nvidia.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "bob.c.feng@intel.com" <bob.c.feng@intel.com>,
"liming.gao@intel.com" <liming.gao@intel.com>
Subject: Re: [PATCH] BaseTools/Python: Add missing FatalError handling
Date: Thu, 28 May 2020 19:23:54 +0000 [thread overview]
Message-ID: <MN2PR12MB3469B4510EC641D8A979271EC98E0@MN2PR12MB3469.namprd12.prod.outlook.com> (raw)
In-Reply-To: <9bbe8b916c10aa4dd79f7cfceb1ed35dd1a8c5f5.1590607347.git.ipark@nvidia.com>
A gentle reminder and adding Bob Feng and Liming Gao to CC.
Thank you,
Irene
-----Original Message-----
From: Irene Park <ipark@nvidia.com>
Sent: Wednesday, May 27, 2020 3:42 PM
To: devel@edk2.groups.io
Cc: Irene Park <ipark@nvidia.com>
Subject: [PATCH] BaseTools/Python: Add missing FatalError handling
From: Irene Park <ipark@nvidia.com>
AutoGenWorker doesn't handle the exception from FatalError therefore the build fails to return the proper error code at the exit.
Signed-off-by: Irene Park <ipark@nvidia.com>
---
BaseTools/Source/Python/AutoGen/AutoGenWorker.py | 6 ++++++
BaseTools/Source/Python/build/build.py | 5 ++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py b/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
index 563d91b..2395964 100755
--- a/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGenWorker.py
@@ -24,6 +24,7 @@ import traceback
import sys
from AutoGen.DataPipe import MemoryDataPipe import logging
+from Common.BuildToolError import FatalError
def clearQ(q):
try:
@@ -101,6 +102,7 @@ class AutoGenManager(threading.Thread):
self.autogen_workers = autogen_workers
self.feedback_q = feedback_q
self.Status = True
+ self.Error = 0
self.error_event = error_event
def run(self):
try:
@@ -113,6 +115,7 @@ class AutoGenManager(threading.Thread):
fin_num += 1
else:
self.Status = False
+ self.Error = self.feedback_q.get()
self.TerminateWorkers()
if fin_num == len(self.autogen_workers):
self.clearQueue()
@@ -282,6 +285,9 @@ class AutoGenWorkerInProcess(mp.Process):
except Empty:
pass
+ except FatalError as e:
+ self.feedback_q.put(taskname)
+ self.feedback_q.put(e.args[0])
except:
self.feedback_q.put(taskname)
finally:
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
index ed3a3b9..d6e3d84 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 = self.AutoGenMgr.Error
+ return rt, err
except FatalError as e:
return False, e.args[0]
except:
--
2.7.4
next prev parent reply other threads:[~2020-05-28 19:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-27 19:41 [PATCH] BaseTools/Python: Add missing FatalError handling Name
2020-05-28 19:23 ` Irene Park [this message]
2020-05-29 1:08 ` Bob Feng
2020-05-29 7:27 ` [edk2-devel] " 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=MN2PR12MB3469B4510EC641D8A979271EC98E0@MN2PR12MB3469.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