From ff9ba84426629eb8f66c9c2c65526bad5f733726 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 25 Oct 2018 11:21:53 -0700 Subject: [PATCH] dependencies/base: Replace windows path separators with \\\\ Replace '\\' with \\\\ in config values args. Otherwise shlex will helpfully remove path separators on windows, resulting in values like: `-Ic:mydataishere` fixup! dependencies/base: Replace windows path separators with / --- mesonbuild/dependencies/base.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index a80423fe4..0a028166c 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -448,6 +448,9 @@ class ConfigToolDependency(ExternalDependency): def get_config_value(self, args, stage): p, out, err = Popen_safe([self.config] + args) + # This is required to keep shlex from stripping path separators on + # Windows. Also, don't put escape sequences in config values, okay? + out = out.replace('\\', '\\\\') if p.returncode != 0: if self.required: raise DependencyException(