aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/base.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-09-08 18:17:48 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2020-09-08 14:38:59 +0000
commit757b838d81a10f178ec52664c566772c55e71005 (patch)
tree60cf34a9e2b65c568c12f1a51fdbd5903186f671 /mesonbuild/dependencies/base.py
parent7ad66e8a1a8e90aeb5ae0f7cbc73b923e1d2c868 (diff)
downloadmeson-757b838d81a10f178ec52664c566772c55e71005.zip
meson-757b838d81a10f178ec52664c566772c55e71005.tar.gz
meson-757b838d81a10f178ec52664c566772c55e71005.tar.bz2
Fix picking up tools with args from the env on Windows
This was a regression in https://github.com/mesonbuild/meson/pull/7059. We do not need to do a full search for all windows special cases. We only want to check whether the command provided is actually a full path to a script so we can add the interpreter. Fixes https://github.com/mesonbuild/meson/issues/7645
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r--mesonbuild/dependencies/base.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 24d035d..26564f4 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -1804,7 +1804,14 @@ class ExternalProgram:
if mesonlib.is_windows():
cmd = self.command[0]
args = self.command[1:]
- self.command = self._search_windows_special_cases(name, cmd) + args
+ # Check whether the specified cmd is a path to a script, in
+ # which case we need to insert the interpreter. If not, try to
+ # use it as-is.
+ ret = self._shebang_to_cmd(cmd)
+ if ret:
+ self.command = ret + args
+ else:
+ self.command = [cmd] + args
else:
all_search_dirs = [search_dir]
if extra_search_dirs: