diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-11-26 21:37:55 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-11-26 21:37:55 +0200 |
commit | 8ac075a6849393994ec467a03fdf9ff62c91932f (patch) | |
tree | bcb5d1f957d4ed002233fa15c2b98ea2e85824d1 | |
parent | f70760a5108ac7802f5385fb5e7c15229bf5d5c8 (diff) | |
download | meson-dotpath.tar.gz |
Fix running tests when there is a period in PATH.dotpath
-rw-r--r-- | mesonbuild/mesonlib.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index b432bf372..3d1eaec4d 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -32,6 +32,13 @@ def detect_meson_py_location(): # $ meson <args> (gets run from /usr/bin/meson) in_path_exe = shutil.which(c_fname) if in_path_exe: + # Special case: when run like "./meson.py <opts" and user has + # period in PATH, we need to expand it out, because, for example, + # "ninja test" will be run from a different directory. + if '.' in os.environ['PATH'].split(':'): + p, f = os.path.split(in_path_exe) + if p == '' or p == '.': + return os.path.join(os.getcwd(), f) return in_path_exe # $ python3 ./meson.py <args> if os.path.exists(c): @@ -52,7 +59,6 @@ else: python_command = [sys.executable] meson_command = python_command + [detect_meson_py_location()] - # Put this in objects that should not get dumped to pickle files # by accident. import threading |