From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by mx.groups.io with SMTP id smtpd.web12.19840.1590693844660209590 for ; Thu, 28 May 2020 12:24:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=n1 header.b=gBscSz+W; spf=pass (domain: nvidia.com, ip: 203.18.50.4, mailfrom: ipark@nvidia.com) Received: from hkpgpgate101.nvidia.com (Not Verified[10.18.92.77]) by nat-hk.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 29 May 2020 03:24:02 +0800 Received: from HKMAIL104.nvidia.com ([10.18.16.13]) by hkpgpgate101.nvidia.com (PGP Universal service); Thu, 28 May 2020 12:24:02 -0700 X-PGP-Universal: processed; by hkpgpgate101.nvidia.com on Thu, 28 May 2020 12:24:02 -0700 Received: from HKMAIL101.nvidia.com (10.18.16.10) by HKMAIL104.nvidia.com (10.18.16.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 28 May 2020 19:23:58 +0000 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.51) by HKMAIL101.nvidia.com (10.18.16.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Thu, 28 May 2020 19:23:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oTyytfPzvJrQuYMTXtDRs41zlIzz02/v9JAgvgLEWOz2zRAU3z9/IHv11l4MTo6GZ8aHCLxwpY6I1kq+ATdAr/BqhQ6Whm+K1Q7+GeExcHm6ZEEe6ulxTlwyH1nBo8RqwMFCPyYVaWkSUxNy04SyNd97yDunzOua8rvMZnEnCjyO5qa5QE0LV9cYGep/ZX4cvh6ax5tQTMXBmx2UEWictBSA9khhzCSO+R9zwEWupxlcBXc+FcUfasXgadSY3BkRYkD5CAoIWBqdbenEcX1+8YSfwKb8dPCNru3ZN5m7nkXAHoU0L2fIqRvEk6lhNxQbWupFWh8lG2YsuLnHtJIU4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xfDtRhSLRTGo4DCrSnnMZ2BmV7tdbWiBH93EEg1+vtU=; b=n85ogduJDJHxgfIqMw+cFOm1tM84vmpxpMpCD57e7iXbF9B4hLwqCKuvVAY0p/5q5euPmiY0oB10y49Xe6AVL+eGAo2/ZvDEsw7/7sRT6llGYHJ4JjLKyWq92WBFxRyAzkgbWjewFA+HrnxOGVF845LvGiQBBCplKlgrrvr6nuJRZ9ODg5W5gxvxvfKNwLkeKZMmKfZdAfaXWHpd3H4C9kqRFj6m09MFgqEtc3huEfNeK9K6nxmiM/n1dNeaE0MYXrc6r+lSZ5yruAcRb1Wf8slji3h9EEVXqtdp1rT1A5T4Fp6f8PXciLttm9m3VrV8+/41+qganmngIycgw2G70A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from MN2PR12MB3469.namprd12.prod.outlook.com (2603:10b6:208:ca::29) by MN2PR12MB3263.namprd12.prod.outlook.com (2603:10b6:208:ab::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17; Thu, 28 May 2020 19:23:54 +0000 Received: from MN2PR12MB3469.namprd12.prod.outlook.com ([fe80::cc96:f292:2c5f:557]) by MN2PR12MB3469.namprd12.prod.outlook.com ([fe80::cc96:f292:2c5f:557%5]) with mapi id 15.20.3045.018; Thu, 28 May 2020 19:23:54 +0000 From: Irene Park To: "devel@edk2.groups.io" CC: "bob.c.feng@intel.com" , "liming.gao@intel.com" Subject: Re: [PATCH] BaseTools/Python: Add missing FatalError handling Thread-Topic: [PATCH] BaseTools/Python: Add missing FatalError handling Thread-Index: AQHWNF7ncTRzMWt6X0G81yD5vNcE4qi94eCA Date: Thu, 28 May 2020 19:23:54 +0000 Message-ID: References: <9bbe8b916c10aa4dd79f7cfceb1ed35dd1a8c5f5.1590607347.git.ipark@nvidia.com> In-Reply-To: <9bbe8b916c10aa4dd79f7cfceb1ed35dd1a8c5f5.1590607347.git.ipark@nvidia.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Enabled=True; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SiteId=43083d15-7273-40c1-b7db-39efd9ccc17a; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Owner=ipark@nvidia.com; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SetDate=2020-05-28T19:23:52.4803032Z; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Name=Unrestricted; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Application=Microsoft Azure Information Protection; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_ActionId=bfb9afcc-fe10-436b-88c6-f169291cd995; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Extended_MSFT_Method=Automatic authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [12.22.141.131] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 636246f4-bdaf-49d9-063b-08d8033ca970 x-ms-traffictypediagnostic: MN2PR12MB3263: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 0417A3FFD2 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tcfYKXqDJvd2gC+ezM9+jwjZZbmz8+aDqYC/zKIIdOM8QHa1mCQZAlLxCbDnn9xspYLZVIEVHptAGfHMbHk0Y361BilB5K0kZT+WAoxEpRSZptsuApI4SrUFAI2rKGAEhavOZBDOLYqolqwyLgD1rsZ5ISKUKMidIrBDTDFBUqccuQenA7mWj89WZoz4OF75SYtHTLzSNN2Z/tcmnGfeM7932BxXCYPyVnEe9rgkD0NqgMmSa7tDGLBWABp2M9r86bKyW0NMRc/NtXouolxqo+3KHaweCNcWYPCx0j+s7R1Fu/VfArzeVWH8oWdzUc5O x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3469.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(366004)(39860400002)(396003)(376002)(346002)(136003)(54906003)(186003)(478600001)(7696005)(83380400001)(86362001)(6506007)(8676002)(8936002)(26005)(71200400001)(6916009)(53546011)(66946007)(66446008)(76116006)(64756008)(4326008)(66476007)(66556008)(52536014)(316002)(55016002)(9686003)(33656002)(2906002)(5660300002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: Z0M5fKU0c+6J9WJU9cPbwLXLU9DlFPy7kkty4KWxV6jVbUXvywEJqcrqjwSclHnaA935qR4er6rgqk0xslAXpfdvabypGUM7M1EIfPKVtg7QiJv3wUBFtAzc98vviGCH704saC3aEbwElQpQeg8LA05ETaDk47HU3k/qedJ3d748duZKwbrLYG1x8wT9v7mNHBmU1aWfh+kcT7siThnQ7zUfEFqAxrhoj2KkXUgXXfVYQ87Hn8pzZx0AXW/9U8+14G87XvFzO4cBtW9vDyxn0+V1pByQ1got9TwbWPBiXhHNlVsFZ9rh7ieZ+L7MGOG3jr1E+P0XWTEDXUD54nQ0DAQKFxlygSrdw3Zf5gP97yQ5fuEDVbalWYtDWJ3r56Y7h0YApn/lKIxnKCE6s7JluMvyH7kDaOXjSp7Wm+Sgdbju8xUNiLCJq/98wGRqQ33jD2Wk292MGC2of930QlkZP8gSFUNhRKO8QhQb+3gQfRM= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 636246f4-bdaf-49d9-063b-08d8033ca970 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 May 2020 19:23:54.6518 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 3Z78dFk+7LLCJvYuUypHkWF2PQ8uyMVrPANZwOMunVyRghXpMfiALj6JChP5pawZ/eHrDx/CYRf//KAPC/NarA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3263 Return-Path: ipark@nvidia.com X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1590693842; bh=xfDtRhSLRTGo4DCrSnnMZ2BmV7tdbWiBH93EEg1+vtU=; h=X-PGP-Universal:ARC-Seal:ARC-Message-Signature: ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic: Thread-Index:Date:Message-ID:References:In-Reply-To: Accept-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator:msip_labels: authentication-results:x-originating-ip:x-ms-publictraffictype: x-ms-office365-filtering-correlation-id:x-ms-traffictypediagnostic: x-microsoft-antispam-prvs:x-ms-oob-tlc-oobclassifiers: x-forefront-prvs:x-ms-exchange-senderadcheck:x-microsoft-antispam: x-microsoft-antispam-message-info:x-forefront-antispam-report: x-ms-exchange-antispam-messagedata:x-ms-exchange-transport-forked: MIME-Version:X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg: Content-Language:Content-Type:Content-Transfer-Encoding; b=gBscSz+Wcf7s/xZRn452l0YgAuuqhtw4mNyJbVyskA8Q+9d2vWx7idf/HIbycVT02 aFwcdtABZk4JhusVt0NyVTTLxKMFpqaeAiEVaDeIxwkfy0xIghE/bKWxX4qGkijmue jyI2K+ZHZiQClnI9m2JEUR7PEruw2/zZNn9MSbm+UVnVhyu5JoY9fzdd+m/4FTe3HF 6kUl2mMcW1kQ3ArX3lHA0/5GcMfQbAzwKfAhg1Lk1g5yGdjgaJ6qq3vFGoc5q6joAi s0D6JPfKA3spHKd4QZegqRVjCLCqNwdW12HBuSWlQKv/19CUFdmEswPS+aNH99+Vu5 NktaOIF60HpDw== Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable A gentle reminder and adding Bob Feng and Liming Gao to CC. Thank you, Irene -----Original Message----- From: Irene Park =20 Sent: Wednesday, May 27, 2020 3:42 PM To: devel@edk2.groups.io Cc: Irene Park Subject: [PATCH] BaseTools/Python: Add missing FatalError handling From: Irene Park AutoGenWorker doesn't handle the exception from FatalError therefore the bu= ild fails to return the proper error code at the exit. Signed-off-by: Irene Park --- 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/S= ource/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 =20 def clearQ(q): try: @@ -101,6 +102,7 @@ class AutoGenManager(threading.Thread): self.autogen_workers =3D autogen_workers self.feedback_q =3D feedback_q self.Status =3D True + self.Error =3D 0 self.error_event =3D error_event def run(self): try: @@ -113,6 +115,7 @@ class AutoGenManager(threading.Thread): fin_num +=3D 1 else: self.Status =3D False + self.Error =3D self.feedback_q.get() self.TerminateWorkers() if fin_num =3D=3D len(self.autogen_workers): self.clearQueue() @@ -282,6 +285,9 @@ class AutoGenWorkerInProcess(mp.Process): =20 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/Pyth= on/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(): =20 self.AutoGenMgr.join() rt =3D self.AutoGenMgr.Status - return rt, 0 + err =3D 0 + if not rt: + err =3D self.AutoGenMgr.Error + return rt, err except FatalError as e: return False, e.args[0] except: -- 2.7.4