diff mbox series

[for,9.1,v3,2/2] meson: Fix MESONINTROSPECT parsing

Message ID 20240327-meson-v3-2-7e6cdef1be8a@daynix.com (mailing list archive)
State New, archived
Headers show
Series meson: Fix MESONINTROSPECT parsing | expand

Commit Message

Akihiko Odaki March 27, 2024, 1:49 a.m. UTC
The arguments in MESONINTROSPECT are quoted with shlex.quote() so it
must be parsed with shlex.split().

meson<1.4.0 quotes arguments in MESONINTROSPECT with the
Windows-specific format on the platform, which is incompatible with
shlex.split(). meson>=1.4.0 uses shlex.quote() also on the platform and
fixes the incompatibility so make sure meson>=1.4.0 on Windows.

Fixes: cf60ccc330 ("cutils: Introduce bundle mechanism")
Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 configure                       | 5 +++++
 scripts/symlink-install-tree.py | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/configure b/configure
index 3cd736b139f3..57c2f1a2273d 100755
--- a/configure
+++ b/configure
@@ -956,6 +956,11 @@  fi
 $mkvenv ensuregroup --dir "${source_path}/python/wheels" \
      ${source_path}/pythondeps.toml meson || exit 1
 
+# Windows needs: https://github.com/mesonbuild/meson/pull/12807
+if test "$host_os" = "windows"; then
+  $mkvenv ensure --dir "$source_path/python/wheels" 'meson>=1.4.0' || exit 1
+fi
+
 # At this point, we expect Meson to be installed and available.
 # We expect mkvenv or pip to have created pyvenv/bin/meson for us.
 # We ignore PATH completely here: we want to use the venv's Meson
diff --git a/scripts/symlink-install-tree.py b/scripts/symlink-install-tree.py
index 8ed97e3c943d..b72563895c56 100644
--- a/scripts/symlink-install-tree.py
+++ b/scripts/symlink-install-tree.py
@@ -4,6 +4,7 @@ 
 import errno
 import json
 import os
+import shlex
 import subprocess
 import sys
 
@@ -14,7 +15,7 @@  def destdir_join(d1: str, d2: str) -> str:
     return str(PurePath(d1, *PurePath(d2).parts[1:]))
 
 introspect = os.environ.get('MESONINTROSPECT')
-out = subprocess.run([*introspect.split(' '), '--installed'],
+out = subprocess.run([*shlex.split(introspect), '--installed'],
                      stdout=subprocess.PIPE, check=True).stdout
 for source, dest in json.loads(out).items():
     bundle_dest = destdir_join('qemu-bundle', dest)