public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* Re: [edk2-devel] [PATCH] BaseTools/build.py: Exit with 1 when AutoGen error occurred
       [not found] <1614D8FC854AA05C.21938@groups.io>
@ 2020-06-02 22:00 ` Irene Park
  0 siblings, 0 replies; 3+ messages in thread
From: Irene Park @ 2020-06-02 22:00 UTC (permalink / raw)
  To: devel@edk2.groups.io, Irene Park, bob.c.feng@intel.com



-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Irene Park
Sent: Tuesday, June 2, 2020 5:59 PM
To: devel@edk2.groups.io
Cc: Irene Park <ipark@nvidia.com>
Subject: [edk2-devel] [PATCH] BaseTools/build.py: Exit with 1 when AutoGen 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 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>
---
 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





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH] BaseTools/build.py: Exit with 1 when AutoGen error occurred
  2020-06-02 21:58 Irene Park
@ 2020-06-03  7:23 ` Bob Feng
  2020-06-29  0:32 ` Yuwei Chen
  1 sibling, 0 replies; 3+ messages in thread
From: Bob Feng @ 2020-06-03  7:23 UTC (permalink / raw)
  To: devel@edk2.groups.io, ipark@nvidia.com

Reviewed-by: Bob Feng<bob.c.feng@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Irene Park
Sent: Wednesday, June 3, 2020 5:59 AM
To: devel@edk2.groups.io
Cc: Irene Park <ipark@nvidia.com>
Subject: [edk2-devel] [PATCH] BaseTools/build.py: Exit with 1 when AutoGen error occurred

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 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>
---
 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





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH] BaseTools/build.py: Exit with 1 when AutoGen error occurred
  2020-06-02 21:58 Irene Park
  2020-06-03  7:23 ` [edk2-devel] " Bob Feng
@ 2020-06-29  0:32 ` Yuwei Chen
  1 sibling, 0 replies; 3+ messages in thread
From: Yuwei Chen @ 2020-06-29  0:32 UTC (permalink / raw)
  To: devel@edk2.groups.io, ipark@nvidia.com

Reivewed-by: Yuwei Chen<yuwei.chen@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Irene
> Park
> Sent: Wednesday, June 3, 2020 5:59 AM
> To: devel@edk2.groups.io
> Cc: Irene Park <ipark@nvidia.com>
> Subject: [edk2-devel] [PATCH] BaseTools/build.py: Exit with 1 when AutoGen
> error occurred
> 
> 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 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>
> ---
>  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
> 
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-29  0:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1614D8FC854AA05C.21938@groups.io>
2020-06-02 22:00 ` [edk2-devel] [PATCH] BaseTools/build.py: Exit with 1 when AutoGen error occurred Irene Park
2020-06-02 21:58 Irene Park
2020-06-03  7:23 ` [edk2-devel] " Bob Feng
2020-06-29  0:32 ` Yuwei Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox