diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-06-01 13:00:17 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-06-01 22:46:37 +0530 |
commit | 9d6bd8a622250bb09246ca7cdf281e96634a198f (patch) | |
tree | cb122eb5604fb7de3572533131afe75b843cf99d /mesonbuild/scripts/regen_checker.py | |
parent | 4e0a4177632831f761b46d340e7a0934327ff321 (diff) | |
download | meson-nirbheek/rework-meson-script-handling.tar.gz |
Set the meson command to use when we know what it isnirbheek/rework-meson-script-handling
Instead of using fragile guessing to figure out how to invoke meson,
set the value when meson is run. Also rework how we pass of
meson_script_launcher to regenchecker.py -- it wasn't even being used
With this change, we only need to guess the meson path when running
the tests, and in that case:
1. If MESON_EXE is set in the env, we know how to run meson
for project tests.
2. MESON_EXE is not set, which means we run the configure in-process
for project tests and need to guess what meson to run, so either
- meson.py is found next to run_tests.py, or
- meson, meson.py, or meson.exe is in PATH
Otherwise, you can invoke meson in the following ways:
1. meson is installed, and mesonbuild is available in PYTHONPATH:
- meson, meson.py, meson.exe from PATH
- python3 -m mesonbuild.mesonmain
- python3 /path/to/meson.py
- meson is a shell wrapper to meson.real
2. meson is not installed, and is run from git:
- Absolute path to meson.py
- Relative path to meson.py
- Symlink to meson.py
All these are tested in test_meson_commands.py, except meson.exe since
that involves building the meson msi and installing it.
Diffstat (limited to 'mesonbuild/scripts/regen_checker.py')
-rw-r--r-- | mesonbuild/scripts/regen_checker.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mesonbuild/scripts/regen_checker.py b/mesonbuild/scripts/regen_checker.py index a9b00c7b4..80d9242b4 100644 --- a/mesonbuild/scripts/regen_checker.py +++ b/mesonbuild/scripts/regen_checker.py @@ -14,7 +14,6 @@ import sys, os import pickle, subprocess -from mesonbuild.mesonlib import meson_command # This could also be used for XCode. @@ -32,7 +31,7 @@ def need_regen(regeninfo, regen_timestamp): Vs2010Backend.touch_regen_timestamp(regeninfo.build_dir) return False -def regen(regeninfo, mesonscript, backend): +def regen(regeninfo, meson_command, backend): cmd = meson_command + ['--internal', 'regenerate', regeninfo.build_dir, @@ -48,11 +47,10 @@ def run(args): regeninfo = pickle.load(f) with open(coredata, 'rb') as f: coredata = pickle.load(f) - mesonscript = coredata.meson_script_launcher backend = coredata.get_builtin_option('backend') regen_timestamp = os.stat(dumpfile).st_mtime if need_regen(regeninfo, regen_timestamp): - regen(regeninfo, mesonscript, backend) + regen(regeninfo, coredata.meson_command, backend) sys.exit(0) if __name__ == '__main__': |