From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by mx.groups.io with SMTP id smtpd.web10.758.1591135147206799552 for ; Tue, 02 Jun 2020 14:59:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=n1 header.b=gHPx43JR; spf=pass (domain: nvidia.com, ip: 216.228.121.64, mailfrom: ipark@nvidia.com) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 02 Jun 2020 14:57:39 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 02 Jun 2020 14:59:06 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 02 Jun 2020 14:59:06 -0700 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 2 Jun 2020 21:59:06 +0000 Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 2 Jun 2020 21:59:06 +0000 Received: from ipark-ubuntu.nvidia.com (Not Verified[10.28.100.106]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Tue, 02 Jun 2020 14:59:06 -0700 From: "Irene Park" To: CC: Irene Park Subject: [PATCH] BaseTools/build.py: Exit with 1 when AutoGen error occurred Date: Tue, 2 Jun 2020 17:58:50 -0400 Message-ID: <09637bf9f163742b1ebdd3700441c4b808e55b50.1591135082.git.ipark@nvidia.com> X-Mailer: git-send-email 2.7.4 X-NVConfidentiality: public Return-Path: ipark@nvidia.com MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1591135060; bh=25dbRIuUTxgNtDPd4Jl9RtQhnVtzB76DF2rICjTdM18=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: X-NVConfidentiality:MIME-Version:Content-Type; b=gHPx43JRNHRfjQn2Ovf0K3YeBVvPCQ/1x/Ol1QW1CeoSaoqSONvSk2iPqZoNjg9yg JUzKbCILFmrCoGoAH5ZMybzVIGRtXSBFua42SdVNlprqehtzkpLq7OM5JPTHRT61kH voIQWM/vtA1aOlLYloBOiRcfYLtjqiw0oTq3tsqPldEilAl+/TLunHXbXlwuK8IZpt AzTlV+zafsspGX0gM5054Pj2O2Q4VHN+tDTNJg2uQMbmgiL+Z1vF0i1icgJEw2kpSJ 2bBbbvlNxdirJ57AY+jAR2FWPpnrbWodfK5Dje541DEkWO1dlAFDlR2gaqq+mXUJuc r+/smRcKQx7UQ== Content-Type: text/plain From: Irene Park 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 --- 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