diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2019-08-29 15:52:54 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-09-01 22:58:33 +0300 |
commit | 96088d3e51b200fda5b09965ab8e0688542b5ea4 (patch) | |
tree | 5d0c17daf91b41260c0e9eaab275be255b748e95 /run_tests.py | |
parent | 2048bd41ec662ca0c9f395c1a11ff0010e78de1c (diff) | |
download | meson-96088d3e51b200fda5b09965ab8e0688542b5ea4.zip meson-96088d3e51b200fda5b09965ab8e0688542b5ea4.tar.gz meson-96088d3e51b200fda5b09965ab8e0688542b5ea4.tar.bz2 |
tests: Detect ninja v1.9 and disable timestamp hack
The high-res timestamp PR by QuLogic was merged in v1.9, so we can
switch back to upstream ninja.
Diffstat (limited to 'run_tests.py')
-rwxr-xr-x | run_tests.py | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/run_tests.py b/run_tests.py index dbb21df..f747b66 100755 --- a/run_tests.py +++ b/run_tests.py @@ -34,6 +34,8 @@ from mesonbuild import mlog from mesonbuild.environment import Environment, detect_ninja from mesonbuild.coredata import backendlist +NINJA_1_9_OR_NEWER = False + def guess_backend(backend, msbuild_exe: str): # Auto-detect backend if unspecified backend_flags = [] @@ -201,8 +203,18 @@ def get_backend_commands(backend, debug=False): clean_cmd = cmd + ['-alltargets', 'clean', '-UseNewBuildSystem=FALSE'] test_cmd = cmd + ['-target', 'RUN_TESTS'] elif backend is Backend.ninja: - # We need at least 1.6 because of -w dupbuild=err - cmd = [detect_ninja('1.6'), '-w', 'dupbuild=err', '-d', 'explain'] + global NINJA_1_9_OR_NEWER + # Look for 1.9 to see if https://github.com/ninja-build/ninja/issues/1219 + # is fixed, else require 1.6 for -w dupbuild=err + for v in ('1.9', '1.6'): + ninja_cmd = detect_ninja(v) + if ninja_cmd is not None: + if v == '1.9': + NINJA_1_9_OR_NEWER = True + else: + print('Found ninja <1.9, tests will run slower') + break + cmd = [ninja_cmd, '-w', 'dupbuild=err', '-d', 'explain'] if cmd[0] is None: raise RuntimeError('Could not find Ninja v1.6 or newer') if debug: @@ -216,11 +228,12 @@ def get_backend_commands(backend, debug=False): return cmd, clean_cmd, test_cmd, install_cmd, uninstall_cmd def ensure_backend_detects_changes(backend): - # We're using a ninja with QuLogic's patch for sub-1s resolution timestamps - # and not running on HFS+ which only stores dates in seconds: + global NINJA_1_9_OR_NEWER + # We're using ninja >= 1.9 which has QuLogic's patch for sub-1s resolution + # timestamps and not running on HFS+ which only stores dates in seconds: # https://developer.apple.com/legacy/library/technotes/tn/tn1150.html#HFSPlusDates # FIXME: Upgrade Travis image to Apple FS when that becomes available - if 'MESON_FIXED_NINJA' in os.environ and not mesonlib.is_osx(): + if (NINJA_1_9_OR_NEWER or ('MESON_FIXED_NINJA' in os.environ)) and not mesonlib.is_osx(): return # This is needed to increase the difference between build.ninja's # timestamp and the timestamp of whatever you changed due to a Ninja |