setup.py, python/lib/: use sorted glob.glob to improve reproducibility
authorPaul Brossier <piem@piem.org>
Mon, 28 Nov 2016 14:48:34 +0000 (15:48 +0100)
committerPaul Brossier <piem@piem.org>
Mon, 28 Nov 2016 14:48:47 +0000 (15:48 +0100)
python/lib/gen_external.py
python/lib/moresetuptools.py
setup.py

index 533116e..c6a13d4 100644 (file)
@@ -174,7 +174,7 @@ def print_cpp_output_results(lib, cpp_output):
 
 def generate_external(header=header, output_path=output_path, usedouble=False, overwrite=True):
     if not os.path.isdir(output_path): os.mkdir(output_path)
 
 def generate_external(header=header, output_path=output_path, usedouble=False, overwrite=True):
     if not os.path.isdir(output_path): os.mkdir(output_path)
-    elif not overwrite: return glob.glob(os.path.join(output_path, '*.c'))
+    elif not overwrite: return sorted(glob.glob(os.path.join(output_path, '*.c')))
 
     cpp_output, cpp_objects = get_cpp_objects(header)
 
 
     cpp_output, cpp_objects = get_cpp_objects(header)
 
index 8eb6113..08f4592 100644 (file)
@@ -58,8 +58,8 @@ def add_local_aubio_sources(ext, usedouble = False):
     # create an empty header, macros will be passed on the command line
     fake_config_header = os.path.join('python', 'ext', 'config.h')
     distutils.file_util.write_file(fake_config_header, "")
     # create an empty header, macros will be passed on the command line
     fake_config_header = os.path.join('python', 'ext', 'config.h')
     distutils.file_util.write_file(fake_config_header, "")
-    aubio_sources = glob.glob(os.path.join('src', '**.c'))
-    aubio_sources += glob.glob(os.path.join('src', '*', '**.c'))
+    aubio_sources = sorted(glob.glob(os.path.join('src', '**.c')))
+    aubio_sources += sorted(glob.glob(os.path.join('src', '*', '**.c')))
     ext.sources += aubio_sources
     # define macros (waf puts them in build/src/config.h)
     for define_macro in ['HAVE_STDLIB_H', 'HAVE_STDIO_H',
     ext.sources += aubio_sources
     # define macros (waf puts them in build/src/config.h)
     for define_macro in ['HAVE_STDLIB_H', 'HAVE_STDIO_H',
index f79e59a..277669c 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -37,7 +37,7 @@ except ImportError:
 if sys.platform.startswith('darwin'):
     extra_link_args += ['-framework','CoreFoundation', '-framework','AudioToolbox']
 
 if sys.platform.startswith('darwin'):
     extra_link_args += ['-framework','CoreFoundation', '-framework','AudioToolbox']
 
-sources = glob.glob(os.path.join('python', 'ext', '*.c'))
+sources = sorted(glob.glob(os.path.join('python', 'ext', '*.c')))
 
 aubio_extension = Extension("aubio._aubio",
     sources,
 
 aubio_extension = Extension("aubio._aubio",
     sources,