diff options
author | Jon Schlueter <jschlueter@navigationsolutions.com> | 2015-01-23 08:20:28 -0500 |
---|---|---|
committer | Jon Schlueter <jschlueter@navigationsolutions.com> | 2015-01-23 08:37:44 -0500 |
commit | c79128c56a135fb944d4f70ced9d3e0e7727fec4 (patch) | |
tree | 237a2d63795c2e2ec880b441aba88e5d76c50177 /devtools | |
parent | 33ef7b5682dc27b902ed0eaf08d8a098ecf07073 (diff) | |
download | gpsd-c79128c56a135fb944d4f70ced9d3e0e7727fec4.tar.gz |
Add identify_failing_build_options script to devtools
This script is a helper script to run through various combinations
of build options as enumerated in the script looking for broken
builds. This has helped identify several bugs and some other general
cleanup in the code base.
to run:
> devtools/identify_failing_build_options.py
it will run for as long as you let it trying to build different build
configurations with minimal=on to find failing ones. It prints out
hopefully useful status as well as stderr but discards stdout from the
builds. Any failing build configurations are logged to
failed_build_configs.txt and can be easily checked later to see why they
failed and how to fix them.
Diffstat (limited to 'devtools')
-rw-r--r-- | devtools/README | 7 | ||||
-rwxr-xr-x | devtools/identify_failing_build_options.py | 125 |
2 files changed, 132 insertions, 0 deletions
diff --git a/devtools/README b/devtools/README index 390d29ea..0d482055 100644 --- a/devtools/README +++ b/devtools/README @@ -68,6 +68,13 @@ explanation. Retrieves the latest build logs from Debian's buildds and extracts a list of failed regression tests, sorted by architecture. +== identify_failing_build_options.py == + +Run from the top level to try to identify any combinations of build +options that don't compile. To run cd to the root of the repo and +run "devtools/identify_failing_build_options.py" it will generate +failed_build_configs.txt for any that failed to compile. + == logextract == Extract pure NMEA from an emailed gpsd error log. The output can be fed diff --git a/devtools/identify_failing_build_options.py b/devtools/identify_failing_build_options.py new file mode 100755 index 00000000..65129b23 --- /dev/null +++ b/devtools/identify_failing_build_options.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python + +import os + +always_on = [ + 'minimal', +] + +always_off = [ + 'leapfetch', +] + +other = [ + 'debug', + 'chrpath', + 'ipv6', + 'manbuild', + 'nostrip', + 'slow', + 'profiling', + 'libQgpsmm', +] + +knobs = [ + 'aivdm', + 'ashtech', + 'bluez', + 'clientdebug', + 'control_socket', + 'controlsend', + 'coveraging', + 'dbus_export', + 'earthmate', + 'evermore', + 'force_global', + 'fury', + 'fv18', + 'garmin', + 'garmintxt', + 'geostar', + 'gpsclock', + 'itrax', + 'libgpsmm', + 'mtk3301', + 'navcom', + 'ncurses', + 'netfeed', + 'nmea0183', + 'nmea2000', + 'nofloats', + 'ntpshm', + 'ntrip', + 'oceanserver', + 'oldstyle', + 'oncore', + 'passthrough', + 'pps', + 'python', + 'qt', + 'reconfigure', + 'rtcm104v2', + 'rtcm104v3', + 'shared', + 'shm_export', + 'sirf', + 'socket_export', + 'squelch', + 'superstar2', + 'systemd', + 'timing', + 'tnt', + 'tripmate', + 'tsip', + 'ublox', + 'usb', +] + + +def main(starting_number_of_options=0): + import itertools + failed_configurations = [] + + for i in range(starting_number_of_options, len(knobs)): + jj = itertools.combinations(knobs, i) + print 'Testing at length {}'.format(i) + + for row in list(jj): + print row + params = [] + + for key in always_on: + params.append(key + "=on") + + for key in always_off: + params.append(key + "=off") + + for key in knobs: + if key in row: + params.append(key + "=on") + + # print {'on_params': row, 'scons_params': params} + + dev_null = open('/dev/null', 'w') + import subprocess + command = ['scons', '-j9'] + command.extend(params) + if os.path.exists('.scons-option-cache'): + os.remove('.scons-option-cache') + retval = subprocess.call(['scons', '-c'], stdout=dev_null) + + retval = subprocess.call(command, stdout=dev_null) + if retval != 0: + failed_configurations.append(command) + print command + with open('failed_build_configs.txt', 'a') as failed_configs: + failed_configs.write(' '.join(command) + '\n') + + return failed_configurations + +if __name__ == '__main__': + failed = main(0) + for row in failed: + print ' '.join(row) + + |