aboutsummaryrefslogtreecommitdiff
path: root/meson.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-10-12 19:44:40 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-10-12 20:25:03 +0530
commit69ca8f5b544f700210d9f18613311bcce3c2e37a (patch)
tree2ba1c807884ffaca1cbd0ce5e08e40bf5beca95f /meson.py
parenta513bcfde613f2a0403f7b0cd34d4bd62674c1d8 (diff)
downloadmeson-69ca8f5b544f700210d9f18613311bcce3c2e37a.zip
meson-69ca8f5b544f700210d9f18613311bcce3c2e37a.tar.gz
meson-69ca8f5b544f700210d9f18613311bcce3c2e37a.tar.bz2
meson.py: Always resolve full path to meson.py
There is no reason to not always do this. Without this, we end up with a relative path to meson.py in build.ninja files when meson.py is launched using subprocess.Popen and friends from the meson source root. This was causing the unittests to intermittently fail when regen was getting invoked by the pic test. Funnily enough, this only happened when run via ./run_tests.py because __file__ was 'run_unittests.py' in that (as opposed to './run_unittests.py') case which made os.path.dirname(__file__) be '', and the os.path.split test in meson.py thought that meson.py was invoked via PATH.
Diffstat (limited to 'meson.py')
-rwxr-xr-xmeson.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/meson.py b/meson.py
index 4d8a269..8c223e5 100755
--- a/meson.py
+++ b/meson.py
@@ -18,10 +18,8 @@ from mesonbuild import mesonmain
import sys, os
def main():
- launcher = sys.argv[0]
- # resolve the command path if not launched from $PATH
- if os.path.split(launcher)[0]:
- launcher = os.path.realpath(launcher)
+ # Always resolve the command path so Ninja can find it for regen, tests, etc.
+ launcher = os.path.realpath(sys.argv[0])
return mesonmain.run(launcher, sys.argv[1:])
if __name__ == '__main__':