embench / embench-iot

The main Embench repository
https://www.embench.org/
GNU General Public License v3.0
259 stars 105 forks source link

Repeated attempts to build will fail noisily #69

Closed BrianGraysonSiV closed 4 years ago

BrianGraysonSiV commented 4 years ago

Invoking ./build_all.py --arch native --chip default --board default, and then re-invoking it, will cause it to die with messages like this:

AttributeError: 'NoneType' object has no attribute 'stdout'

The reason is that if all files are up to date, the 'res' object is still None.

A quick fix is to indent the 'res' lines, and the preceding "if not succeeded" lines, as shown here:

diff --git a/build_all.py b/build_all.py
index 8bc38be..2b1263d 100755
--- a/build_all.py
+++ b/build_all.py
@@ -483,12 +483,12 @@ def compile_file(f_root, srcdir, bindir, suffix='.c'):
             )
             succeeded = False

-    if not succeeded:
-        log.debug('Command was:')
-        log.debug(arglist_to_str(arglist))
+        if not succeeded:
+            log.debug('Command was:')
+            log.debug(arglist_to_str(arglist))

-    log.debug(res.stdout.decode('utf-8'))
-    log.debug(res.stderr.decode('utf-8'))
+        log.debug(res.stdout.decode('utf-8'))
+        log.debug(res.stderr.decode('utf-8'))

     return succeeded
jeremybennett commented 4 years ago

Thanks Brian and sorry for the slow response. Applied your fix via pull request 74.