gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH] A few fixes and improvements for the broken-build che


From: Fred Wright
Subject: [gpsd-dev] [PATCH] A few fixes and improvements for the broken-build checker.
Date: Fri, 25 Mar 2016 18:25:51 -0700

1) Adds the recently added 'gpsd' and 'gpsdclients' to the test list.

2) Uses 'build-all' rather than 'build', for more complete testing.

3) Fixes a potential ordering issue with the pre-clean.

4) Makes the removal of scons temporaries more complete.

5) Derives the number of jobs from the number of CPUs, rather than
hard-coding it.

6) Applies parallelism to "check' as well as 'build-all'.

7) Makes the error-list file names more descriptive.

TESTED:
Runs and gets a couple of failures, which don't appear to be new
problems.
---
 devtools/identify_failing_build_options.py | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/devtools/identify_failing_build_options.py 
b/devtools/identify_failing_build_options.py
index 9a53498..99dedc8 100755
--- a/devtools/identify_failing_build_options.py
+++ b/devtools/identify_failing_build_options.py
@@ -39,6 +39,8 @@ knobs = [
     'garmintxt',
     'geostar',
     'gpsclock',
+    'gpsd',
+    'gpsdclients',
     'itrax',
     'libgpsmm',
     'mtk3301',
@@ -79,8 +81,13 @@ knobs = [
 
 def main(starting_number_of_options=0):
     import itertools
+    import multiprocessing
+    import shutil
     import subprocess
 
+    num_cpus = multiprocessing.cpu_count()
+    job_arg = '-j%d' % num_cpus
+
     failed_configurations = []
     dev_null = open('/dev/null', 'w')
 
@@ -89,7 +96,7 @@ def main(starting_number_of_options=0):
             return True
         failed_configurations.append(command)
         print command
-        with open(phase + '_build_configs.txt', 'a') as failed_configs:
+        with open('failed_%s_configs.txt' % phase, 'a') as failed_configs:
             failed_configs.write(' '.join(command) + '\n')
         return False
 
@@ -105,12 +112,22 @@ def main(starting_number_of_options=0):
 
             # print {'on_params': row, 'scons_params': params}
 
-            if os.path.exists('.scons-option-cache'):
-                os.remove('.scons-option-cache')
+            # Clean before clearing cached options, in case options
+            # affect what's cleaned.
             subprocess.call(['scons', '-c'], stdout=dev_null)
-
-            if _run(['scons', '-j9'] + params, 'build'):
-                _run(['scons', 'check'] + params, 'check')
+            # Now remove all the scons temporaries
+            try:
+                shutil.rmtree('.sconf_temp')
+            except OSError:
+                pass
+            for f in ['.sconsign.dblite', '.scons-option-cache']:
+                try:
+                    os.remove(f)
+                except OSError:
+                    pass
+
+            if _run(['scons', job_arg, 'build-all'] + params, 'build'):
+                _run(['scons', job_arg, 'check'] + params, 'check')
 
     return failed_configurations
 
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]