aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/msetup.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-09-15 11:28:49 -0400
committerXavier Claessens <xclaesse@gmail.com>2021-09-20 13:44:32 -0400
commitd7e71f3912df926e0fbb0dcebddfb4a7e6cc19f3 (patch)
treef658d8aedc52a86545c4558f710a3d264cf2f99e /mesonbuild/msetup.py
parente9386e80ae413e04e4fe36d46820c8346ef835e0 (diff)
downloadmeson-d7e71f3912df926e0fbb0dcebddfb4a7e6cc19f3.zip
meson-d7e71f3912df926e0fbb0dcebddfb4a7e6cc19f3.tar.gz
meson-d7e71f3912df926e0fbb0dcebddfb4a7e6cc19f3.tar.bz2
during executable lookup, do not search PATH if a directory component is given
This will always be wrong, because when a directory component is provided we need to match an exact filename on a manual search path, for example find_program with dirs: or the current meson.build subdir. If we ever get this far, shutil.which will do the same "is there a dirname, if so just check whether the filename exists relative to cwd"... except that the documented meson lookup path is that we check relative to meson.build subdir, not relative to the cwd, and the cwd could be anything, but is probably the root sourcedir. Since internally, meson does not actually os.chdir into the sourcedir, it could be absolutely anything at all, though. ... The actual returned name for shutil.which(name) given a literal pathname with a directory component is "return name" without adding the absolute path, which means that this is double-broken. Not only does it find things we didn't expect, the resulting ExternalProgram object doesn't have the correct path to the program, so it will report "found" and then fail to actually run when the current directory is changed, for example by ninja -C. Fixes #9262
Diffstat (limited to 'mesonbuild/msetup.py')
0 files changed, 0 insertions, 0 deletions